Salome HOME
Set font of the Root Label the same as in Tree View
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index a36332730b570611608c46bbe04b44f08cb4ad95..25ed50fd39464097d6644633235e667595e9f337 100755 (executable)
@@ -310,6 +310,10 @@ void XGUI_Workshop::initMenu()
   aCommand->connectTo(this, SLOT(onSave()));
   //aCommand->disable();
 
+  aCommand = aGroup->addFeature("SAVEAS_CMD", tr("Save as..."), tr("Save the document into a file"),
+                                QIcon(":pictures/save.png"), QKeySequence());
+  aCommand->connectTo(this, SLOT(onSaveAs()));
+
   QString aUndoId = "UNDO_CMD";
   aCommand = aGroup->addFeature(aUndoId, tr("Undo"), tr("Undo last command"),
                                 QIcon(":pictures/undo.png"), QKeySequence::Undo);
@@ -328,13 +332,10 @@ void XGUI_Workshop::initMenu()
                  SIGNAL(updateRedoHistory(const QList<ActionInfo>&)),
                  SLOT(onRedo(int)));
 
-  aCommand = aGroup->addFeature("REBUILD_CMD", tr("Rebuild"), tr("Rebuild data objects"),
-    QIcon(":pictures/rebuild.png"), QKeySequence());
-  aCommand->connectTo(this, SLOT(onRebuild()));
+  //aCommand = aGroup->addFeature("REBUILD_CMD", tr("Rebuild"), tr("Rebuild data objects"),
+  //  QIcon(":pictures/rebuild.png"), QKeySequence());
+  //aCommand->connectTo(this, SLOT(onRebuild()));
 
-  aCommand = aGroup->addFeature("SAVEAS_CMD", tr("Save as..."), tr("Save the document into a file"),
-                                QIcon(":pictures/save.png"), QKeySequence());
-  aCommand->connectTo(this, SLOT(onSaveAs()));
   //aCommand->disable();
 
   aCommand = aGroup->addFeature("OPEN_CMD", tr("Open..."), tr("Open a new document"),
@@ -486,6 +487,7 @@ void XGUI_Workshop::onOperationResumed(ModuleBase_Operation* theOperation)
 
   if (theOperation->getDescription()->hasXmlRepresentation()) {  //!< No need for property panel
     setPropertyPanel(theOperation);
+    connectToPropertyPanel(true);
   }
   updateCommandStatus();
 
@@ -617,10 +619,10 @@ void XGUI_Workshop::connectToPropertyPanel(const bool isToConnect)
     foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
        myModule->connectToPropertyPanel(aWidget, isToConnect);
       if (isToConnect) {
-        connect(aWidget, SIGNAL(valueStateChanged()), this, SLOT(onValueStateChanged()));
+        connect(aWidget, SIGNAL(valueStateChanged(int)), this, SLOT(onWidgetStateChanged(int)));
       }
       else {
-        disconnect(aWidget, SIGNAL(valueStateChanged()), this, SLOT(onValueStateChanged()));
+        disconnect(aWidget, SIGNAL(valueStateChanged(int)), this, SLOT(onWidgetStateChanged(int)));
       }
     }
   }
@@ -862,10 +864,7 @@ void XGUI_Workshop::onRebuild()
 }
 
 //******************************************************
-}
-
-//******************************************************
-void XGUI_Workshop::onValueStateChanged()
+void XGUI_Workshop::onWidgetStateChanged(int thePreviousState)
 {
   ModuleBase_ModelWidget* anActiveWidget = 0;
   ModuleBase_Operation* anOperation = myOperationMgr->currentOperation();
@@ -874,8 +873,12 @@ void XGUI_Workshop::onValueStateChanged()
     if (aPanel)
       anActiveWidget = aPanel->activeWidget();
   }
-  if (anActiveWidget && anActiveWidget->getValueState() != ModuleBase_ModelWidget::Stored)
+  if (anActiveWidget)
     operationMgr()->onValidateOperation();
+
+  myModule->widgetStateChanged(thePreviousState);
+}
+
 ModuleBase_IModule* XGUI_Workshop::loadModule(const QString& theModule)
 {
   QString libName = QString::fromStdString(library(theModule.toStdString()));
@@ -1043,7 +1046,6 @@ void XGUI_Workshop::createDockWidgets()
 
   QAction* aCancelAct = myActionsMgr->operationStateAction(XGUI_ActionsMgr::Abort);
   connect(aCancelAct, SIGNAL(triggered()), myOperationMgr, SLOT(onAbortOperation()));
-  connect(myPropertyPanel, SIGNAL(noMoreWidgets()), myModule, SLOT(onNoMoreWidgets()));
   connect(myPropertyPanel, SIGNAL(keyReleased(QKeyEvent*)),
           myOperationMgr,  SLOT(onKeyReleased(QKeyEvent*)));
   //connect(myOperationMgr,  SIGNAL(validationStateChanged(bool)),