From: vsv Date: Thu, 5 Sep 2019 13:16:02 +0000 (+0300) Subject: Issue #2984: Prevent deletion of predefined constructions from viewer and on multi... X-Git-Tag: VEDF2019Lot4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4838c3a4883dd0f7194d4fe672381a4e82f9469c;p=modules%2Fshaper.git Issue #2984: Prevent deletion of predefined constructions from viewer and on multi-selection --- diff --git a/src/XGUI/XGUI_ContextMenuMgr.cpp b/src/XGUI/XGUI_ContextMenuMgr.cpp index b0314faec..226aa30dd 100644 --- a/src/XGUI/XGUI_ContextMenuMgr.cpp +++ b/src/XGUI/XGUI_ContextMenuMgr.cpp @@ -353,6 +353,15 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu() action("SHOW_ONLY_CMD")->setEnabled(true); action("SHADING_CMD")->setEnabled(true); action("WIREFRAME_CMD")->setEnabled(true); + + foreach(ObjectPtr aObj, aObjects) { + FeaturePtr aFeature = ModelAPI_Feature::feature(aObj); + if (!aFeature->isInHistory()) { + canBeDeleted = false; + break; + } + } + action("DELETE_CMD")->setEnabled(canBeDeleted); } } // end multi-selection @@ -600,7 +609,8 @@ void XGUI_ContextMenuMgr::updateViewerMenu() if (myWorkshop->canChangeProperty("TRANSPARENCY_CMD")) action("TRANSPARENCY_CMD")->setEnabled(true); - action("DELETE_CMD")->setEnabled(true); + // Delete command is not used in viewer pop-up menu + action("DELETE_CMD")->setEnabled(false); } void XGUI_ContextMenuMgr::connectObjectBrowser()