]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2365 problem with active panel in feature and Hide faces windows
authornds <nds@opencascade.com>
Wed, 13 Dec 2017 13:20:33 +0000 (16:20 +0300)
committernds <nds@opencascade.com>
Wed, 13 Dec 2017 13:21:33 +0000 (16:21 +0300)
src/ModuleBase/ModuleBase_ISelectionActivate.h
src/PartSet/PartSet_SketcherReentrantMgr.cpp
src/XGUI/XGUI_ActiveControlMgr.cpp
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanelSelector.cpp
src/XGUI/XGUI_SelectionActivate.cpp
src/XGUI/XGUI_SelectionActivate.h

index 4e79670b41d782673bb020846b161864d5fe7742..c730d7be85b6aff3b1d0f314909c9fae5f5a7f26 100644 (file)
@@ -54,10 +54,6 @@ public:
   MODULEBASE_EXPORT virtual void activateSelectionFilters
     (const SelectMgr_ListOfFilter& theSelectionFilters) = 0;
 
-  /// Activate or deactivate selection and selection filters like the widget is active
-  /// \param theWidget a source widget of selection modes/filters
-  MODULEBASE_EXPORT virtual void activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget) = 0;
-
 protected:
   ModuleBase_IWorkshop* myWorkshop; ///< active workshop
 };
index fbda129472b5e8b2ff88f1d55eeda8774ca496b0..d987f86f7601f55694ef320e1e4cf7c9b163a47a 100644 (file)
@@ -660,13 +660,8 @@ void PartSet_SketcherReentrantMgr::deleteInternalFeature()
   std::cout << "PartSet_SketcherReentrantMgr::deleteInternalFeature: "
             << myInternalFeature->data()->name() << std::endl;
 #endif
-  if (myInternalActiveWidget) {
-    ModuleBase_WidgetSelector* aWSelector =
-      dynamic_cast<ModuleBase_WidgetSelector*>(myInternalActiveWidget);
-    if (aWSelector)
-      myWorkshop->selectionActivate()->activateSelectionAndFilters(aWSelector);
+  if (myInternalActiveWidget)
     myInternalActiveWidget = 0;
-  }
   delete myInternalWidget;
   myInternalWidget = 0;
 
index 13c789c25b5f457ed82620fe76b1fc59c0a2dca6..629ac6d8d46a200cc2f811f0e6647e90a4301bc7 100644 (file)
@@ -76,13 +76,12 @@ void XGUI_ActiveControlMgr::onSelectorActivated()
 void XGUI_ActiveControlMgr::onSelectorDeactivated()
 {
   XGUI_ActiveControlSelector* aSelector = qobject_cast<XGUI_ActiveControlSelector*>(sender());
-  if (!aSelector)
+  if (!aSelector || aSelector != myActiveSelector || !myActiveSelector)
     return;
 
+  myActiveSelector->setActive(false);
   myActiveSelector = NULL;
 
-  aSelector->setActive(false);
-
   XGUI_ActiveControlSelector* aSelectorToBeActivated = 0;
   for (int i = 0, aCount = mySelectors.count(); i < aCount; i++)
   {
index e46ab2d5b6635ff276adab1a34ffc73cea16dd35..b878d62c5ae7011c164762686b26ac0717955c49 100755 (executable)
@@ -499,7 +499,10 @@ bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget, cons
       emit noMoreWidgets(aPreviosAttributeID);
     }
   }
-  emit propertyPanelActivated();
+  if (myActiveWidget)
+    emit propertyPanelActivated();
+  else
+    emit propertyPanelDeactivated();
   myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
   myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
   return true;
index d40f416d7b587666675ee4dc0dca6443e075c632..30fc0f9b2d659f853cec695b94575173423ea441 100644 (file)
@@ -38,17 +38,21 @@ void XGUI_PropertyPanelSelector::reset()
 //********************************************************************
 void XGUI_PropertyPanelSelector::setActive(const bool& isActive)
 {
-  if (isActive) {
-    if (myWidgetToBeActivated)
-      myPanel->activateWidget(myWidgetToBeActivated, true);
+  if (isActive && myWidgetToBeActivated) {
+    // e.g. widget sketch label
+    myPanel->activateWidget(myWidgetToBeActivated, true);
+    myWidgetToBeActivated = NULL;
     return;
   }
-  ModuleBase_ModelWidget* aWidget = myPanel->activeWidget();
-  if (aWidget && aWidget->needToBeActiated())
-  {
-    myWidgetToBeActivated = aWidget;
+
+  if (!isActive) { // on deactivating, store previous active widget
+    ModuleBase_ModelWidget* aWidget = myPanel->activeWidget();
+    if (aWidget && aWidget->needToBeActiated())
+    {
+      myWidgetToBeActivated = aWidget;
+    }
+    myPanel->activateWidget(NULL, false);
   }
-  myPanel->activateWidget(NULL, false);
 }
 
 //********************************************************************
index 9b8d2a5d579a5b7dcb8e5df8bd9c32738b4ae317..af1855f56c91ecb0350c656e496b90c3f81e379c 100644 (file)
@@ -136,20 +136,6 @@ void XGUI_SelectionActivate::activateSelectionFilters
   }
 }
 
-//**************************************************************
-void XGUI_SelectionActivate::activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget)
-{
-  // activate selection modes
-  QIntList aModes;
-  getSelectionModes(theWidget, aModes);
-  activateObjects(aModes, getDisplayer()->displayedObjects(), true);
-
-  // activate selection filters
-  SelectMgr_ListOfFilter aSelectionFilters;
-  getSelectionFilters(theWidget, aSelectionFilters);
-  activateSelectionFilters(aSelectionFilters);
-}
-
 //**************************************************************
 void XGUI_SelectionActivate::getSelectionModes(ModuleBase_ModelWidget* theWidget,
                                                QIntList& theModes)
index 9795c48d902a7cc5fcc07ae9cc42c3d05d87655f..89c12fcaafc2c558268fb22cf9337b1021a298f2 100644 (file)
@@ -133,10 +133,6 @@ public:
   XGUI_EXPORT void deactivateTrihedronInSelectionModes();
 
 protected:
-  /// Activate or deactivate selection and selection filters like the widget is active
-  /// \param theWidget a source widget of selection modes/filters
-  virtual void activateSelectionAndFilters(ModuleBase_ModelWidget* theWidget);
-
   /// Returns selection modes of the widget
   /// \param theWidget model widget
   /// \param theModes selection modes