From a9958035274c760e00d75f1e37781f9dfbf9a8ed Mon Sep 17 00:00:00 2001 From: vsv Date: Fri, 9 Oct 2015 11:36:41 +0300 Subject: [PATCH] Call method setStable inside of transaction --- src/ModuleBase/ModuleBase_OperationFeature.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ModuleBase/ModuleBase_OperationFeature.cpp b/src/ModuleBase/ModuleBase_OperationFeature.cpp index 82f6db270..93c5b6029 100755 --- a/src/ModuleBase/ModuleBase_OperationFeature.cpp +++ b/src/ModuleBase/ModuleBase_OperationFeature.cpp @@ -79,6 +79,9 @@ void ModuleBase_OperationFeature::startOperation() if (!aFeature.get() || !isEditOperation()) return; + if (aFeature.get() && isEditOperation()) + aFeature->setStable(false); + myVisualizedObjects.clear(); // store hidden result features std::list aResults = aFeature->results(); @@ -115,7 +118,6 @@ void ModuleBase_OperationFeature::stopOperation() if (myVisualizedObjects.find(aFeature) != myVisualizedObjects.end()) { aFeature->setDisplayed(false); } - aFeature->setStable(true); if (myVisualizedObjects.size() > 0) Events_Loop::loop()->flush(Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY)); } @@ -158,7 +160,6 @@ FeaturePtr ModuleBase_OperationFeature::createFeature(const bool theFlushMessage void ModuleBase_OperationFeature::setFeature(FeaturePtr theFeature) { myFeature = theFeature; - myFeature->setStable(false); myIsEditing = true; } @@ -221,7 +222,7 @@ void ModuleBase_OperationFeature::start() aDoc->setCurrentFeature(feature(), false); } - startOperation(); + //Already called startOperation(); emit started(); } @@ -243,6 +244,8 @@ void ModuleBase_OperationFeature::abort() if (aPropertyPanel) aPropertyPanel->cleanContent(); + myFeature->setStable(true); + SessionPtr aMgr = ModelAPI_Session::get(); if (myIsEditing) { DocumentPtr aDoc = aMgr->activeDocument(); @@ -281,6 +284,8 @@ bool ModuleBase_OperationFeature::commit() ModuleBase_IPropertyPanel* aPropertyPanel = propertyPanel(); if (aPropertyPanel) aPropertyPanel->cleanContent(); + + myFeature->setStable(true); SessionPtr aMgr = ModelAPI_Session::get(); /// Set current feature and remeber old current feature -- 2.39.2