Salome HOME
Issue #1303 Reordering menu items: Sketch action enable state
[modules/shaper.git] / src / XGUI / XGUI_ActionsMgr.cpp
index 8491751974072acaed09bd543d3c15496297d9a2..f1d5e49b15ddf7ab4de2dfc415746b13f76e4823 100644 (file)
@@ -97,7 +97,7 @@ bool XGUI_ActionsMgr::isNested(const QString& theId) const
 
 void XGUI_ActionsMgr::updateCommandsStatus()
 {
-  setAllEnabled(true);
+  setAllEnabled();
   XGUI_Selection* aSelection = myWorkshop->selector()->selection();
   if (aSelection->getSelected(ModuleBase_ISelection::Viewer).size() > 0)
     updateOnViewSelection();
@@ -248,7 +248,7 @@ QAction* XGUI_ActionsMgr::operationStateAction(OperationStateActionId theId, QOb
       }
       break;
       case Preview: {
-        aResult = new QAction("See the preview", theParent);
+        aResult = new QAction("See preview", theParent);
         aResult->setToolTip("Compute preview");
       }
       break;
@@ -281,10 +281,13 @@ ActionInfo XGUI_ActionsMgr::actionInfoById(const QString& theId)
   return aResult;
 }
 
-void XGUI_ActionsMgr::setAllEnabled(bool isEnabled)
+void XGUI_ActionsMgr::setAllEnabled()
 {
   foreach(QString eachAction, myActions.keys()) {
-    setActionEnabled(eachAction, isEnabled);
+    if (myActions.contains(eachAction)) {
+      QAction* aAction = myActions[eachAction];
+      aAction->setEnabled(true);
+    }
   }
 }