From: mpv Date: Wed, 24 Sep 2014 04:45:38 +0000 (+0400) Subject: Wrap the rebuild operation by transaction braces to avoid warnings and allow to undo... X-Git-Tag: V_0.4.4~28^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=49dc72f9ae537e39e40e5c5f319d5b3744c680d0;p=modules%2Fshaper.git Wrap the rebuild operation by transaction braces to avoid warnings and allow to undo the rebuilding. --- diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 25866c87c..1f3bee21a 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -789,9 +789,17 @@ void XGUI_Workshop::onRedo() //****************************************************** void XGUI_Workshop::onRebuild() { + SessionPtr aMgr = ModelAPI_Session::get(); + bool aWasOperation = aMgr->isOperation(); // keep this value + if (!aWasOperation) { + aMgr->startOperation(); + } static const Events_ID aRebuildEvent = Events_Loop::loop()->eventByName("Rebuild"); Events_Loop::loop()->send(boost::shared_ptr( new Events_Message(aRebuildEvent, this))); + if (!aWasOperation) { + aMgr->finishOperation(); + } } //******************************************************