From 00580238b84621c46d2c8f2f24e9cfc953852040 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 6 Sep 2018 12:27:41 +0300 Subject: [PATCH] Check state of auto update blocked on operations. Switch Off the state on save a document. --- src/XGUI/XGUI_Workshop.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 9c6c4fd88..82495a49f 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -1052,6 +1052,10 @@ bool XGUI_Workshop::onSave() if (myCurrentDir.isEmpty()) { return onSaveAs(); } + SessionPtr aMgr = ModelAPI_Session::get(); + if (aMgr->isAutoUpdateBlocked()) + aMgr->blockAutoUpdate(false); + std::list aFiles; saveDocument(myCurrentDir, aFiles); updateCommandStatus(); @@ -1324,6 +1328,9 @@ void XGUI_Workshop::updateCommandStatus() else aCmd->setEnabled(myModule->canRedo()); } + else if (aId == "AUTOCOMPUTE_CMD") { + aCmd->setChecked(aMgr->isAutoUpdateBlocked()); + } else // Enable all commands aCmd->setEnabled(true); -- 2.39.2