Salome HOME
[bos #35140] [EDF] (2023-T1) Memory communication between SHAPER and GEOM
[modules/shaper.git] / src / PartSet / PartSet_Module.cpp
index c4dc84c15c976b86d033e98574fd530843e7a47e..73113c0066ee5a3db32218dfd89d467381d73b2c 100644 (file)
@@ -1630,23 +1630,24 @@ void PartSet_Module::addObjectBrowserMenu(QMenu* theMenu) const
       } else if (aObject->document() == aMgr->activeDocument()) {
         if (hasParameter || hasFeature) {
 
-          // disable Edit menu for groups under ImportResult feature
           bool isEnabled = true;
-          if (aFeature.get() && aFeature->getKind() == "Group")
-          {
-            std::shared_ptr<ModelAPI_CompositeFeature> anOwner =
-              ModelAPI_Tools::compositeOwner (aFeature);
-
-            if (anOwner.get() && anOwner->getKind() == "ImportResult")
-            {
-              myMenuMgr->action("EDIT_CMD")->setEnabled(false);
-              isEnabled = false;
+          if (aFeature.get()) {
+            // disable Edit menu for not editable features
+            isEnabled = aFeature->isEditable();
+
+            // disable Edit menu for groups under ImportResult feature
+            if (aFeature->getKind() == "Group") {
+              std::shared_ptr<ModelAPI_CompositeFeature> anOwner =
+                ModelAPI_Tools::compositeOwner (aFeature);
+              if (anOwner.get() && anOwner->getKind() == "ImportResult") {
+                isEnabled = false;
+              }
             }
           }
 
-          if (isEnabled)
-          {
-            myMenuMgr->action("EDIT_CMD")->setEnabled(true);
+          myMenuMgr->action("EDIT_CMD")->setEnabled(isEnabled);
+
+          if (isEnabled) {
             theMenu->addAction(myMenuMgr->action("EDIT_CMD"));
             if (aCurrentOp && aFeature.get()) {
               if (aCurrentOp->id().toStdString() == aFeature->getKind())