From: nds Date: Thu, 5 Nov 2015 04:32:05 +0000 (+0300) Subject: Separation part of the function in an additional function. Preparation to create... X-Git-Tag: V_2.0.0_alfa1~6^2~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a540d07fbd26fd974fc34e0bdf25feaa45d2cd0f;p=modules%2Fshaper.git Separation part of the function in an additional function. Preparation to create/remove a new feature for validating preselection of a new create operation. --- diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp index 0bb3ce4de..b095ff9c4 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp @@ -242,21 +242,7 @@ void PartSet_SketcherReetntrantMgr::onBeforeStopped() if (!isActiveMgr() || !myIsInternalEditOperation) return; - ModuleBase_OperationFeature* aFOperation = dynamic_cast - (myWorkshop->currentOperation()); - if (aFOperation) { - disconnect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped())); - disconnect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped())); - } - - 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); - } + beforeStopInternalEdit(); } bool PartSet_SketcherReetntrantMgr::canBeCommittedByPreselection() @@ -316,6 +302,25 @@ void PartSet_SketcherReetntrantMgr::startInternalEdit(const std::string& thePrev } } +void PartSet_SketcherReetntrantMgr::beforeStopInternalEdit() +{ + ModuleBase_OperationFeature* aFOperation = dynamic_cast + (myWorkshop->currentOperation()); + if (aFOperation) { + disconnect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped())); + disconnect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped())); + } + + 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); + } +} + void PartSet_SketcherReetntrantMgr::restartOperation() { if (myIsInternalEditOperation) { diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.h b/src/PartSet/PartSet_SketcherReetntrantMgr.h index c43796693..2bdeb8617 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.h +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.h @@ -122,6 +122,10 @@ private: /// \param thePreviousAttributeID an index of the previous attribute to set focus to this widget void startInternalEdit(const std::string& thePreviousAttributeID); + /// Disconnects this manager from operation signals, deactivate selection of the first control + /// in the viewer. + void beforeStopInternalEdit(); + /// Commits the current operation and launches a new with the commited operation feature index void restartOperation();