]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Activation objects redesign : property panel selector is activated by propertyPanelAc...
authornds <nds@opencascade.com>
Wed, 13 Dec 2017 06:03:55 +0000 (09:03 +0300)
committernds <nds@opencascade.com>
Wed, 13 Dec 2017 06:03:55 +0000 (09:03 +0300)
Problem: Start extrusion, sketch face can not be selected.

src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h
src/XGUI/XGUI_PropertyPanelSelector.cpp

index bab01f75150cb882e6e00dec54d1790ee8ab7669..f2531ef37c684dde33ecd43e2e710594bd759ad8 100755 (executable)
@@ -436,7 +436,7 @@ bool XGUI_PropertyPanel::focusNextPrevChild(bool theIsNext)
       bool isFirstControl = !theIsNext;
       QWidget* aLastFocusControl = myActiveWidget->getControlAcceptingFocus(isFirstControl);
       if (aFocusWidget == aLastFocusControl) {
-        setActiveWidget(NULL);
+        setActiveWidget(NULL, false);
       }
     }
 
@@ -464,15 +464,10 @@ void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget, const
     aPreviosAttributeID = myActiveWidget->attributeID();
 
   // Avoid activation of already actve widget. It could happen on focusIn event many times
-  if (setActiveWidget(theWidget) && theEmitSignal) {
-    emit widgetActivated(myActiveWidget);
-    if (!myActiveWidget && !isEditingMode()) {
-      emit noMoreWidgets(aPreviosAttributeID);
-    }
-  }
+  setActiveWidget(theWidget, theEmitSignal);
 }
 
-bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
+bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget, const bool isEmitSignal)
 {
   // Avoid activation of already actve widget. It could happen on focusIn event many times
   if (theWidget == myActiveWidget) {
@@ -491,8 +486,6 @@ bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
     theWidget->activate();
   }
   myActiveWidget = theWidget;
-  myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
-  myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
 
 #ifdef DEBUG_ACTIVE_WIDGET
   std::cout << "myActiveWidget = " << (theWidget ? theWidget->context().c_str() : "") << std::endl;
@@ -500,6 +493,15 @@ bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
   static Events_ID anEvent = Events_Loop::eventByName(EVENT_UPDATE_BY_WIDGET_SELECTION);
   Events_Loop::loop()->flush(anEvent);
 
+  if (isEmitSignal) {
+    emit widgetActivated(myActiveWidget);
+    if (!myActiveWidget && !isEditingMode()) {
+      emit noMoreWidgets(aPreviosAttributeID);
+    }
+  }
+  emit propertyPanelActivated();
+  myOperationMgr->workshop()->selectionActivate()->updateSelectionModes();
+  myOperationMgr->workshop()->selectionActivate()->updateSelectionFilters();
   return true;
 }
 
index d2b5b4966aa75ccc1ba7d35a5a52a4cb148fd661..fe16ed11529cb4ac619a22bc50cf8410bb1fa3ab 100644 (file)
@@ -163,13 +163,16 @@ signals:
   /// \param theObject a sender of the event
   void enterClicked(QObject* theObject);
 
-  /// Emits on clear content
+  /// Emits on deactivating property panel (e.g. by clearContent)
   void propertyPanelDeactivated();
+  /// Emits on widget activating
+  void propertyPanelActivated();
 
 protected:
   /// Makes the widget active, deactivate the previous, activate and hightlight the given one
   /// \param theWidget a widget
-  bool setActiveWidget(ModuleBase_ModelWidget* theWidget);
+  /// \param isEmitSignal flag whether panel signals should be emitted
+  bool setActiveWidget(ModuleBase_ModelWidget* theWidget, const bool isEmitSignal);
   /// The parent method that processes the "Tab"/"SHIF + Tab" keyboard events
   /// Emits a signal about focus change
   /// If theIsNext is true, this function searches forward, if next is false, it searches backward.
index 5039168365c17c3278cc8f09a083f6b881cf36eb..d40f416d7b587666675ee4dc0dca6443e075c632 100644 (file)
@@ -25,7 +25,7 @@
 XGUI_PropertyPanelSelector::XGUI_PropertyPanelSelector(XGUI_PropertyPanel* thePanel)
 : myPanel(thePanel), myWidgetToBeActivated (NULL)
 {
-  connect(myPanel, SIGNAL(widgetActivated(ModuleBase_ModelWidget*)), this, SIGNAL(activated()));
+  connect(myPanel, SIGNAL(propertyPanelActivated()), this, SIGNAL(activated()));
   connect(myPanel, SIGNAL(propertyPanelDeactivated()), this, SIGNAL(deactivated()));
 }