]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Wrap the rebuild operation by transaction braces to avoid warnings and allow to undo...
authormpv <mikhail.ponikarov@opencascade.com>
Wed, 24 Sep 2014 04:45:38 +0000 (08:45 +0400)
committermpv <mikhail.ponikarov@opencascade.com>
Wed, 24 Sep 2014 04:45:38 +0000 (08:45 +0400)
src/XGUI/XGUI_Workshop.cpp

index 25866c87cd26bb6216df220c51dbd62c819548de..1f3bee21adc295a453990955c459f5f996f9a8f9 100644 (file)
@@ -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<Events_Message>(
     new Events_Message(aRebuildEvent, this)));
+  if (!aWasOperation) {
+    aMgr->finishOperation();
+  }
 }
 
 //******************************************************