]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Disable undo on active operation (to prevent crash on undo the sketch creation)
authorsbh <sergey.belash@opencascade.com>
Tue, 11 Nov 2014 08:39:04 +0000 (11:39 +0300)
committersbh <sergey.belash@opencascade.com>
Tue, 11 Nov 2014 08:39:04 +0000 (11:39 +0300)
src/XGUI/XGUI_Workshop.cpp

index 83dc099fc44d10a7db66717b0d887fc6198e7df9..c7a98185b9d71246dce94c5d101a9e77e0bae25b 100644 (file)
@@ -931,8 +931,7 @@ void XGUI_Workshop::updateCommandStatus()
   }
   SessionPtr aMgr = ModelAPI_Session::get();
   if (aMgr->hasModuleDocument()) {
-    QAction* aUndoCmd;
-    QAction* aRedoCmd;
+    QAction *aUndoCmd, *aRedoCmd;
     foreach(QAction* aCmd, aCommands) {
       QString aId = aCmd->data().toString();
       if (aId == "UNDO_CMD")
@@ -943,8 +942,8 @@ void XGUI_Workshop::updateCommandStatus()
         // Enable all commands
         aCmd->setEnabled(true);
     }
-    aUndoCmd->setEnabled(aMgr->canUndo());
-    aRedoCmd->setEnabled(aMgr->canRedo());
+    aUndoCmd->setEnabled(aMgr->canUndo() && !aMgr->isOperation());
+    aRedoCmd->setEnabled(aMgr->canRedo() && !aMgr->isOperation());
   } else {
     foreach(QAction* aCmd, aCommands) {
       QString aId = aCmd->data().toString();