mirror of
https://github.com/fwbuilder/fwbuilder
synced 2026-09-16 09:59:37 +02:00
* ObjectManipulator.cpp (ObjectManipulator::getMenuState): fixed #1676
"Crash when deleting an interface that has multiple IP addresses and not all addresses are selected for deletion"
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2010-08-08 Vadim Kurland <vadim@vk.crocodile.org>
|
||||||
|
|
||||||
|
* ObjectManipulator.cpp (ObjectManipulator::getMenuState): fixed #1676
|
||||||
|
"Crash when deleting an interface that has multiple IP addresses
|
||||||
|
and not all addresses are selected for deletion"
|
||||||
|
|
||||||
2010-08-06 vadim <vadim@vk.crocodile.org>
|
2010-08-06 vadim <vadim@vk.crocodile.org>
|
||||||
|
|
||||||
* ObjectManipulator_tree_ops.cpp (ObjectManipulator::clearObjects):
|
* ObjectManipulator_tree_ops.cpp (ObjectManipulator::clearObjects):
|
||||||
|
|||||||
@@ -854,6 +854,11 @@ void ObjectManipulator::getMenuState(bool haveMoveTargets,
|
|||||||
|
|
||||||
if (getCurrentObjectTree()==NULL) return;
|
if (getCurrentObjectTree()==NULL) return;
|
||||||
|
|
||||||
|
// delete, cut and copy menu items will be enabled only if all
|
||||||
|
// selected objects have the same parent (so user can not select
|
||||||
|
// an interface and one but not all of its addresses for deletion,
|
||||||
|
// see #1676)
|
||||||
|
FWObject *parent = NULL;
|
||||||
vector<FWObject*> so = getCurrentObjectTree()->getSelectedObjects();
|
vector<FWObject*> so = getCurrentObjectTree()->getSelectedObjects();
|
||||||
for (vector<FWObject*>::iterator i=so.begin(); i!=so.end(); ++i)
|
for (vector<FWObject*>::iterator i=so.begin(); i!=so.end(); ++i)
|
||||||
{
|
{
|
||||||
@@ -867,6 +872,16 @@ void ObjectManipulator::getMenuState(bool haveMoveTargets,
|
|||||||
|
|
||||||
QString object_path = obj->getPath(true).c_str();
|
QString object_path = obj->getPath(true).c_str();
|
||||||
|
|
||||||
|
if (parent == NULL) parent = obj->getParent();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (parent != obj->getParent())
|
||||||
|
{
|
||||||
|
delMenuItem = false;
|
||||||
|
copyMenuItem = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
copyMenuItem = copyMenuItem && FWBTree().getCopyMenuState(object_path);
|
copyMenuItem = copyMenuItem && FWBTree().getCopyMenuState(object_path);
|
||||||
pasteMenuItem = pasteMenuItem &&
|
pasteMenuItem = pasteMenuItem &&
|
||||||
FWBTree().getPasteMenuState(object_path) &&
|
FWBTree().getPasteMenuState(object_path) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user