From: vsv Date: Wed, 11 Nov 2015 11:26:48 +0000 (+0300) Subject: Issue #1075: Disable Delete command on sub-feature object X-Git-Tag: V_2.0.0_alfa2~36 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f3a79bbb5aa60a5d1866e2e6707071244e3029f9;p=modules%2Fshaper.git Issue #1075: Disable Delete command on sub-feature object --- diff --git a/src/ModuleBase/ModuleBase_Tools.cpp b/src/ModuleBase/ModuleBase_Tools.cpp index 5d3643ab7..889da3e0e 100755 --- a/src/ModuleBase/ModuleBase_Tools.cpp +++ b/src/ModuleBase/ModuleBase_Tools.cpp @@ -245,11 +245,11 @@ void checkObjects(const QObjectPtrList& theObjects, bool& hasResult, bool& hasFe ResultPtr aResult = std::dynamic_pointer_cast(aObj); ResultParameterPtr aConstruction = std::dynamic_pointer_cast(aResult); - hasResult = (aResult.get() != NULL); - hasFeature = (aFeature.get() != NULL); - hasParameter = (aConstruction.get() != NULL); + hasResult |= (aResult.get() != NULL); + hasFeature |= (aFeature.get() != NULL); + hasParameter |= (aConstruction.get() != NULL); if (hasFeature) - hasSubFeature = (ModelAPI_Tools::compositeOwner(aFeature) != NULL); + hasSubFeature |= (ModelAPI_Tools::compositeOwner(aFeature) != NULL); if (hasFeature && hasResult && hasParameter && hasSubFeature) break; } diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index 7b570f9cc..7c40774dd 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -218,7 +218,7 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu() if( aMgr->activeDocument() == aObject->document() ) { action("RENAME_CMD")->setEnabled(true); - action("DELETE_CMD")->setEnabled(true); + action("DELETE_CMD")->setEnabled(!hasSubFeature); } } } else {