Salome HOME
Merge branch 'Dev_GroupsRevision'
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index 6cb816382fe023cad1b64bb5fe99b057df762cce..e55494d77bb45f26be0bba2d24ba54841c36a34f 100755 (executable)
@@ -527,6 +527,21 @@ void XGUI_Workshop::onAcceptActionClicked()
   }
 }
 
+//******************************************************
+void XGUI_Workshop::onAcceptPlusActionClicked()
+{
+  QAction* anAction = dynamic_cast<QAction*>(sender());
+  XGUI_OperationMgr* anOperationMgr = operationMgr();
+  if (anOperationMgr) {
+    ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
+                                                    (anOperationMgr->currentOperation());
+    if (aFOperation) {
+      myOperationMgr->commitOperation();
+      module()->launchOperation(aFOperation->id(), false);
+    }
+  }
+}
+
 //******************************************************
 void XGUI_Workshop::onPreviewActionClicked()
 {
@@ -595,13 +610,15 @@ void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation)
   FeaturePtr aFeature = aFOperation->feature();
   std::string aFeatureKind = aFeature->getKind();
   foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
-    if (!aWidget->attributeID().empty() && !aFeature->attribute(aWidget->attributeID()).get()) {
-      std::string anErrorMsg = "The feature '%1' has no attribute '%2' used by widget '%3'.";
-      Events_InfoMessage("XGUI_Workshop", anErrorMsg)
-        .arg(aFeatureKind).arg(aWidget->attributeID())
-        .arg(aWidget->metaObject()->className()).send();
-      myPropertyPanel->cleanContent();
-      return;
+    if (aWidget->usesAttribute()) {
+      if (!aWidget->attributeID().empty() && !aFeature->attribute(aWidget->attributeID()).get()) {
+        std::string anErrorMsg = "The feature '%1' has no attribute '%2' used by widget '%3'.";
+        Events_InfoMessage("XGUI_Workshop", anErrorMsg)
+          .arg(aFeatureKind).arg(aWidget->attributeID())
+          .arg(aWidget->metaObject()->className()).send();
+        myPropertyPanel->cleanContent();
+        return;
+      }
     }
   }
   // for performance purpose, flush should be done after all controls are filled
@@ -1050,7 +1067,10 @@ void XGUI_Workshop::processUndoRedo(const ModuleBase_ActionType theActionType, i
     if (aOpMgr->canStopOperation(aOpMgr->currentOperation()))
       aOpMgr->abortOperation(aOpMgr->currentOperation());
     else
+    {
+      myDisplayer->enableUpdateViewer(isUpdateEnabled);
       return;
+    }
   }
   objectBrowser()->treeView()->setCurrentIndex(QModelIndex());
   std::list<std::string> anActionList = theActionType == ActionUndo ? aMgr->undoList()
@@ -1070,10 +1090,8 @@ void XGUI_Workshop::processUndoRedo(const ModuleBase_ActionType theActionType, i
   updateCommandStatus();
 
   // unblock the viewer update functionality and make update on purpose
-  if (theActionType == ActionRedo) {
-    myDisplayer->enableUpdateViewer(isUpdateEnabled);
-    myDisplayer->updateViewer();
-  }
+  myDisplayer->enableUpdateViewer(isUpdateEnabled);
+  myDisplayer->updateViewer();
 }
 
 //******************************************************
@@ -1357,6 +1375,9 @@ void XGUI_Workshop::createDockWidgets()
   QAction* aOkAct = myActionsMgr->operationStateAction(XGUI_ActionsMgr::Accept);
   connect(aOkAct, SIGNAL(triggered()), this, SLOT(onAcceptActionClicked()));
 
+  QAction* aOkContAct = myActionsMgr->operationStateAction(XGUI_ActionsMgr::AcceptPlus);
+  connect(aOkContAct, SIGNAL(triggered()), this, SLOT(onAcceptPlusActionClicked()));
+
   QAction* aCancelAct = myActionsMgr->operationStateAction(XGUI_ActionsMgr::Abort);
   connect(aCancelAct, SIGNAL(triggered()), myOperationMgr, SLOT(onAbortOperation()));
 
@@ -1634,7 +1655,7 @@ bool XGUI_Workshop::prepareForDisplay(const std::set<ObjectPtr>& theObjects) con
   int anAnswer = QMessageBox::question(
         desktop(), tr("Show object"),
         tr("'%1'\n are hidden by %2:\nRemove objects from the panel to be displayed?")
-        .arg(aHiddenObjectNames.join(',')).arg(facesPanel()->windowTitle()),
+        .arg(aHiddenObjectNames.join(' ,')).arg(facesPanel()->windowTitle()),
         QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
 
   bool aToBeDisplayed = anAnswer == QMessageBox::Yes;