Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index 51bc022d5b58210b620cb1434d4b8de9decf2336..2655b569456ab43b28ea6227a5a35987696e4185 100644 (file)
@@ -14,6 +14,7 @@
 #include "XGUI_Displayer.h"
 #include "XGUI_OperationMgr.h"
 #include "XGUI_SalomeConnector.h"
+#include "XGUI_ActionsMgr.h"
 
 #include <ModelAPI_PluginManager.h>
 #include <ModelAPI_Feature.h>
@@ -61,6 +62,7 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector)
   mySelector = new XGUI_SelectionMgr(this);
   connect(mySelector, SIGNAL(selectionChanged()), this, SLOT(changeCurrentDocument()));
   myOperationMgr = new XGUI_OperationMgr(this);
+  myActionsMgr = new XGUI_ActionsMgr(this);
   connect(myOperationMgr, SIGNAL(operationStarted()),  this, SLOT(onOperationStarted()));
   connect(myOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)),
           this, SLOT(onOperationStopped(ModuleBase_Operation*)));
@@ -231,10 +233,9 @@ void XGUI_Workshop::onOperationStopped(ModuleBase_Operation* theOperation)
     hidePropertyPanel();
     updateCommandStatus();
 
-  if (myMainWindow) {
-    XGUI_MainMenu* aMenu = myMainWindow->menuObject();
-    aMenu->restoreCommandState();
-  }
+    if (myMainWindow) {
+      myActionsMgr->restoreCommandState();
+    }
   }
 }
 
@@ -278,9 +279,7 @@ void XGUI_Workshop::addFeature(const Config_FeatureMessage* theMessage)
                                                 QString::fromStdString(theMessage->tooltip()),
                                                 QIcon(theMessage->icon().c_str()),
                                                 QKeySequence(), isUsePropPanel);
-    
-    connect(aCommand,                   SIGNAL(toggled(bool)),
-            myMainWindow->menuObject(), SLOT(onFeatureChecked(bool)));
+    myActionsMgr->addCommand(aCommand);
     myPartSetModule->featureCreated(aCommand);
   }
 }
@@ -305,7 +304,7 @@ void XGUI_Workshop::connectWithOperation(ModuleBase_Operation* theOperation)
     aCommand = aMenu->feature(theOperation->operationId());
   }
   //Abort operation on uncheck the command
-  connect(aCommand, SIGNAL(toggled(bool)), theOperation, SLOT(setRunning(bool)));
+  connect(aCommand, SIGNAL(triggered(bool)), theOperation, SLOT(setRunning(bool)));
 }
 
 //******************************************************
@@ -631,4 +630,4 @@ void XGUI_Workshop::changeCurrentDocument()
 void XGUI_Workshop::salomeViewerSelectionChanged()
 {
   emit salomeViewerSelection();
-}
\ No newline at end of file
+}