]> 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>
Thu, 14 Dec 2017 11:21:58 +0000 (14:21 +0300)
committernds <nds@opencascade.com>
Thu, 14 Dec 2017 11:22:20 +0000 (14:22 +0300)
Scenario 1: After activation of selection control in propety panel, selection with (previous value is edge, not selected - box) SHIFT should give two objects in control.

src/XGUI/XGUI_FacesPanel.cpp
src/XGUI/XGUI_PropertyPanel.cpp

index 6c1e40370672d9f413acc44158bc470b25fd28d1..dcdeaa5972c62cb9009fb17e64b14d8a21e383bf 100644 (file)
@@ -136,9 +136,11 @@ void XGUI_FacesPanel::setActivePanel(const bool theIsActive)
   myIsActive = theIsActive;
 
   if (myIsActive) {
+    emit activated();
+    // selection should be cleared after emit of signal to do not process selection change
+    // event by the previous selector
     // the selection is cleared by activating selection control
     XGUI_Tools::workshop(myWorkshop)->selector()->clearSelection();
-    emit activated();
   }
   else
     emit deactivated();
index b878d62c5ae7011c164762686b26ac0717955c49..737027b35aafce7b6bdc1a9fab0d220722499f34 100755 (executable)
@@ -490,12 +490,11 @@ bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget, cons
 #ifdef DEBUG_ACTIVE_WIDGET
   std::cout << "myActiveWidget = " << (theWidget ? theWidget->context().c_str() : "") << std::endl;
 #endif
-  static Events_ID anEvent = Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION);
-  Events_Loop::loop()->flush(anEvent);
-
+  bool anIsNoMoreWidgets = false;
   if (isEmitSignal) {
     //emit widgetActivated(myActiveWidget);
     if (!myActiveWidget && !isEditingMode()) {
+      anIsNoMoreWidgets = true;
       emit noMoreWidgets(aPreviosAttributeID);
     }
   }
@@ -505,6 +504,13 @@ bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget, cons
     emit propertyPanelDeactivated();
   myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
   myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
+
+  if (!anIsNoMoreWidgets && myActiveWidget)
+  {
+    // restore widget selection should be done after selection modes of widget activating
+    static Events_ID anEvent = Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION);
+    Events_Loop::loop()->flush(anEvent);
+  }
   return true;
 }