From: nds Date: Thu, 14 Dec 2017 08:22:16 +0000 (+0300) Subject: Hide faces: Sketch operation: selection of sketch plane after deactivation of Hide... X-Git-Tag: V_2.10.0RC~39 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cf408f7f9c53f7527ce19c217b33c3dbccbb3a97;p=modules%2Fshaper.git Hide faces: Sketch operation: selection of sketch plane after deactivation of Hide faces panel. --- diff --git a/src/XGUI/XGUI_ActiveControlMgr.cpp b/src/XGUI/XGUI_ActiveControlMgr.cpp index 73b7ac610..83d1b04c9 100644 --- a/src/XGUI/XGUI_ActiveControlMgr.cpp +++ b/src/XGUI/XGUI_ActiveControlMgr.cpp @@ -33,13 +33,13 @@ void debugInfo(const QString& theMessage, XGUI_ActiveControlSelector* theSelector) { std::cout << theMessage.toStdString().c_str() << ", active: " - << theSelector ? theSelector->getType().toStdString().c_str() : "NULL" << std::endl; + << (theSelector ? theSelector->getType().toStdString().c_str() : "NULL") << std::endl; } #endif //******************************************************************** XGUI_ActiveControlMgr::XGUI_ActiveControlMgr(ModuleBase_IWorkshop* theWorkshop) -: myWorkshop(theWorkshop), myActiveSelector(0) +: myWorkshop(theWorkshop), myActiveSelector(0), myIsBlocked(false) { connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged())); } @@ -73,9 +73,12 @@ void XGUI_ActiveControlMgr::onSelectorActivated() if (!aSelector || aSelector == myActiveSelector) return; - if (myActiveSelector) + if (myIsBlocked) // we've come here from the same method + return; + myIsBlocked = true; + if (myActiveSelector) { myActiveSelector->setActive(false); - + } activateSelector(aSelector); XGUI_Tools::workshop(myWorkshop)->selectionActivate()->updateSelectionModes(); XGUI_Tools::workshop(myWorkshop)->selectionActivate()->updateSelectionFilters(); @@ -83,6 +86,7 @@ void XGUI_ActiveControlMgr::onSelectorActivated() #ifdef DEBUG_ACTIVE_SELECTOR debugInfo("onSelectorActivated", myActiveSelector); #endif + myIsBlocked = false; } //******************************************************************** @@ -92,6 +96,10 @@ void XGUI_ActiveControlMgr::onSelectorDeactivated() if (!aSelector || aSelector != myActiveSelector || !myActiveSelector) return; + if (myIsBlocked) // we've come here from the same method + return; + myIsBlocked = true; + myActiveSelector->setActive(false); activateSelector(NULL); @@ -111,6 +119,7 @@ void XGUI_ActiveControlMgr::onSelectorDeactivated() #ifdef DEBUG_ACTIVE_SELECTOR debugInfo("onSelectorDeactivated", myActiveSelector); #endif + myIsBlocked = false; } //******************************************************************** diff --git a/src/XGUI/XGUI_ActiveControlMgr.h b/src/XGUI/XGUI_ActiveControlMgr.h index 40355b697..7b0703a5d 100644 --- a/src/XGUI/XGUI_ActiveControlMgr.h +++ b/src/XGUI/XGUI_ActiveControlMgr.h @@ -73,6 +73,8 @@ protected: QList mySelectors; ///< workshop selectors XGUI_ActiveControlSelector* myActiveSelector; ///< active selector + + bool myIsBlocked; ///< blocking flag to avoid cycling signals processing }; #endif