diff --git a/build_num b/build_num index a184840d6..a22d90bba 100644 --- a/build_num +++ b/build_num @@ -1 +1 @@ -#define BUILD_NUM 3218 +#define BUILD_NUM 3219 diff --git a/doc/ChangeLog b/doc/ChangeLog index 814f27978..439594cd8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,9 @@ +2010-08-08 Vadim Kurland + + * 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 * ObjectManipulator_tree_ops.cpp (ObjectManipulator::clearObjects): diff --git a/src/gui/ObjectManipulator.cpp b/src/gui/ObjectManipulator.cpp index 9115dcd4f..196e22ace 100644 --- a/src/gui/ObjectManipulator.cpp +++ b/src/gui/ObjectManipulator.cpp @@ -854,6 +854,11 @@ void ObjectManipulator::getMenuState(bool haveMoveTargets, 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 so = getCurrentObjectTree()->getSelectedObjects(); for (vector::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(); + if (parent == NULL) parent = obj->getParent(); + else + { + if (parent != obj->getParent()) + { + delMenuItem = false; + copyMenuItem = false; + } + } + copyMenuItem = copyMenuItem && FWBTree().getCopyMenuState(object_path); pasteMenuItem = pasteMenuItem && FWBTree().getPasteMenuState(object_path) &&