From b8a6a9047f1bbc365f653fc286d676291274a49a Mon Sep 17 00:00:00 2001 From: sbh Date: Tue, 11 Nov 2014 11:39:04 +0300 Subject: [PATCH] Disable undo on active operation (to prevent crash on undo the sketch creation) --- src/XGUI/XGUI_Workshop.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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(); -- 2.39.2