From: sbh Date: Tue, 11 Nov 2014 08:39:04 +0000 (+0300) Subject: Disable undo on active operation (to prevent crash on undo the sketch creation) X-Git-Tag: V_0.5~6^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b8a6a9047f1bbc365f653fc286d676291274a49a;p=modules%2Fshaper.git Disable undo on active operation (to prevent crash on undo the sketch creation) --- diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 83dc099fc..c7a98185b 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -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();