]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #807: disable the show/hide actions if the part set document is not active
authorasl <asl@opencascade.com>
Fri, 4 Sep 2015 08:25:08 +0000 (11:25 +0300)
committerasl <asl@opencascade.com>
Fri, 4 Sep 2015 08:25:08 +0000 (11:25 +0300)
src/XGUI/XGUI_ContextMenuMgr.cpp

index 28bafc37e37ce35024c643e423ee7432595103a8..1a138f747dd4282a49a217cc59df5b818ea19dd4 100644 (file)
@@ -227,6 +227,16 @@ void XGUI_ContextMenuMgr::updateObjectBrowserMenu()
         action("DELETE_CMD")->setEnabled(true);
     }
   }
+
+  bool isPartSetDocActive = 
+    ModelAPI_Session::get()->activeDocument()==ModelAPI_Session::get()->moduleDocument();
+  if( !isPartSetDocActive )
+  {
+    action("SHOW_CMD")->setEnabled(false);
+    action("HIDE_CMD")->setEnabled(false);
+    action("SHOW_ONLY_CMD")->setEnabled(false);
+  }
+
   if (myWorkshop->canChangeColor())
     action("COLOR_CMD")->setEnabled(true);