Salome HOME
Unpressing the button of the current action must behave like a validation if the...
[modules/shaper.git] / src / XGUI / XGUI_OperationMgr.cpp
index b41264d77b160e08096eb11793e6e8ba74ed6d24..d975519a338c303e0dd4808f12c21f44de39a9c8 100644 (file)
@@ -368,10 +368,7 @@ bool XGUI_OperationMgr::canStartOperation(const QString& theId)
       else if (canStopOperation(aCurrentOp)) {
         // the started operation is granted in the parrent operation,
         // e.g. current - Line in Sketch, started Circle 
-        if (XGUI_Tools::workshop(myWorkshop)->errorMgr()->isApplyEnabled() && aCurrentOp->isModified())
-          aCurrentOp->commit();
-        else
-          abortOperation(aCurrentOp);
+        stopOperation(aCurrentOp);
       } else {
         aCanStart = false;
       }
@@ -380,6 +377,14 @@ bool XGUI_OperationMgr::canStartOperation(const QString& theId)
   return aCanStart;
 }
 
+void XGUI_OperationMgr::stopOperation(ModuleBase_Operation* theOperation)
+{
+  if (XGUI_Tools::workshop(myWorkshop)->errorMgr()->isApplyEnabled() && theOperation->isModified())
+    theOperation->commit();
+  else
+    abortOperation(theOperation);
+}
+
 void XGUI_OperationMgr::abortOperation(ModuleBase_Operation* theOperation)
 {
   ModuleBase_Operation* aCurrentOperation = currentOperation();