From a540d07fbd26fd974fc34e0bdf25feaa45d2cd0f Mon Sep 17 00:00:00 2001 From: nds Date: Thu, 5 Nov 2015 07:32:05 +0300 Subject: [PATCH] Separation part of the function in an additional function. Preparation to create/remove a new feature for validating preselection of a new create operation. --- src/PartSet/PartSet_SketcherReetntrantMgr.cpp | 35 +++++++++++-------- src/PartSet/PartSet_SketcherReetntrantMgr.h | 4 +++ 2 files changed, 24 insertions(+), 15 deletions(-) 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(); -- 2.39.2