]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Update Apply button for a point widget, do not activate the same widget(regression).
authornds <nds@opencascade.com>
Tue, 20 Oct 2015 10:09:08 +0000 (13:09 +0300)
committernds <nds@opencascade.com>
Mon, 2 Nov 2015 09:50:16 +0000 (12:50 +0300)
src/PartSet/PartSet_WidgetPoint2d.cpp
src/XGUI/XGUI_OperationMgr.cpp
src/XGUI/XGUI_PropertyPanel.cpp
src/XGUI/XGUI_PropertyPanel.h

index 7cdf8cc92e1f3e67ab554d816cbeb3c9e157ffdd..9fbffa98cf98ca0f914bb8e9e202e2083db9224b 100644 (file)
@@ -486,7 +486,7 @@ bool PartSet_WidgetPoint2D::processEnter()
   bool isModified = myXSpin->isModified() || myYSpin->isModified();
   if (isModified) {
     bool isXModified = myXSpin->isModified();
-    emit valuesChanged();
+    onValuesChanged();
     myXSpin->clearModified();
     myYSpin->clearModified();
     if (isXModified)
index 5da8053b03edac501a3ce0e26884df4d0abf9b91..6732dec511a34cbedd16cb6d121ca6f5a22b965e 100644 (file)
@@ -498,8 +498,6 @@ void XGUI_OperationMgr::onOperationStopped()
 
 bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent)
 {
-  qDebug("XGUI_OperationMgr::onKeyReleased");
-
   QObject* aSender = sender();
 
   // Let the manager decide what to do with the given key combination.
@@ -508,7 +506,6 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent)
   switch (theEvent->key()) {
     case Qt::Key_Return:
     case Qt::Key_Enter: {
-      qDebug("XGUI_OperationMgr::onKeyReleased: Key_Return");
       ModuleBase_Operation* aOperation = currentOperation();
       ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
       ModuleBase_ModelWidget* aActiveWgt = aPanel->activeWidget();
@@ -521,9 +518,8 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent)
         else
           isAccepted = false;
       }
-      //else
-      //  isAccepted = false;
     }
+    break;
     case Qt::Key_N:
     case Qt::Key_P: {
       bool noModifiers = (theEvent->modifiers() == Qt::NoModifier);
index 994193c26a84985f233ce3a671fbfb72cfe14873..b5749c7ae7bb46a5560fe6c9afa5f53b962cea1d 100755 (executable)
@@ -241,21 +241,21 @@ void XGUI_PropertyPanel::activateNextWidget()
 void XGUI_PropertyPanel::activateWidget(ModuleBase_ModelWidget* theWidget)
 {
   // Avoid activation of already actve widget. It could happen on focusIn event many times
-  setActiveWidget(theWidget);
-
-  if (myActiveWidget) {
-    emit widgetActivated(myActiveWidget);
-  } else if (!isEditingMode()) {
-    emit noMoreWidgets();
-    setFocusOnOkButton();
+  if (setActiveWidget(theWidget)) {
+    if (myActiveWidget) {
+      emit widgetActivated(myActiveWidget);
+    } else if (!isEditingMode()) {
+      emit noMoreWidgets();
+      setFocusOnOkButton();
+    }
   }
 }
 
-void XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
+bool XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
 {
   // Avoid activation of already actve widget. It could happen on focusIn event many times
   if (theWidget == myActiveWidget) {
-    return;
+    return false;
   }
   if(myActiveWidget) {
     myActiveWidget->deactivate();
@@ -267,7 +267,7 @@ void XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
     theWidget->activate();
   }
   myActiveWidget = theWidget;
-    setFocusOnOkButton();
+  return true;
 }
 
 void XGUI_PropertyPanel::setFocusOnOkButton()
index a85af1e09c71783160d69ef76f17475efb6a3469..9e6c38592dc4ff0a591d65b227969cd4abc98b14 100644 (file)
@@ -123,7 +123,7 @@ public slots:
 protected:
   /// Makes the widget active, deactivate the previous, activate and hightlight the given one
   /// \param theWidget a widget
-  void setActiveWidget(ModuleBase_ModelWidget* theWidget);
+  bool setActiveWidget(ModuleBase_ModelWidget* theWidget);
 
   /// The parent method that processes the "Tab"/"SHIF + Tab" keyboard events
   /// Emits a signal about focus change