From: nds Date: Tue, 3 Nov 2015 06:04:35 +0000 (+0300) Subject: The first activate widget should be deactivated by edited operation is stopped. X-Git-Tag: V_2.0.0_alfa1~6^2~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=28c1b7f575cfd5652fdfdf3d418661c5ce6d5235;p=modules%2Fshaper.git The first activate widget should be deactivated by edited operation is stopped. --- diff --git a/src/ModuleBase/ModuleBase_OperationFeature.cpp b/src/ModuleBase/ModuleBase_OperationFeature.cpp index c7dc8ed3a..35fa3a02d 100755 --- a/src/ModuleBase/ModuleBase_OperationFeature.cpp +++ b/src/ModuleBase/ModuleBase_OperationFeature.cpp @@ -251,6 +251,7 @@ void ModuleBase_OperationFeature::abort() bool ModuleBase_OperationFeature::commit() { if (canBeCommitted()) { + emit beforeCommitted(); // the widgets of property panel should not process any events come from data mode // after commit clicked. Some signal such as redisplay/create influence on content // of the object browser and viewer context. Therefore it influence to the current @@ -265,7 +266,6 @@ bool ModuleBase_OperationFeature::commit() SessionPtr aMgr = ModelAPI_Session::get(); /// Set current feature and remeber old current feature - emit beforeCommitted(); commitOperation(); aMgr->finishOperation(); diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp index af2723111..302dbded4 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp @@ -228,6 +228,30 @@ void PartSet_SketcherReetntrantMgr::onEnterReleased() myRestartingMode = RM_EmptyFeatureUsed; } +void PartSet_SketcherReetntrantMgr::onBeforeStopped() +{ + ModuleBase_OperationFeature* aFOperation = dynamic_cast + (myWorkshop->currentOperation()); + if (aFOperation) { + disconnect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped())); + disconnect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped())); + } + if (!isActiveMgr()) + return; + + if (!myIsInternalEditOperation) + return; + + PartSet_Module* aModule = module(); + ModuleBase_ModelWidget* aFirstWidget = aModule->activeWidget(); + ModuleBase_IPropertyPanel* aPanel = aModule->currentOperation()->propertyPanel(); + if (aFirstWidget != aPanel->activeWidget()) { + ModuleBase_WidgetSelector* aWSelector = dynamic_cast(aFirstWidget); + if (aWSelector) + aWSelector->activateSelectionAndFilters(false); + } +} + bool PartSet_SketcherReetntrantMgr::canBeCommittedByPreselection() { return !isActiveMgr() || myRestartingMode == RM_None; @@ -251,6 +275,9 @@ void PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePrev if (anOperationFeature.get() != NULL) { myIsInternalEditOperation = true; + connect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped())); + connect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped())); + // activate selection filters of the first widget in the viewer onWidgetActivated(); diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.h b/src/PartSet/PartSet_SketcherReetntrantMgr.h index f8f9ae0f9..b72cc047d 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.h +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.h @@ -105,6 +105,10 @@ private slots: /// for initialization of a new started operation. void onEnterReleased(); + /// Deactivates selection and filters of the first operation widget if it is an internal + /// 'edit' operation + void onBeforeStopped(); + private: /// Returns true if the current operation is a sketch or a nested sketch operation bool isActiveMgr() const;