]> 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)
committerspo <sergey.pokhodenko@opencascade.com>
Wed, 21 Oct 2015 09:51:16 +0000 (12:51 +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 cc3fe0521645bdc52f1045b438c3c55fdc3c9a7e..59ad78bf304498df583481ab659e548548b9f601 100644 (file)
@@ -421,8 +421,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.
@@ -431,7 +429,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();
@@ -444,9 +441,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 4154cfb6897d90e480233bcccc43b6e76cb47b0c..5a4dda830e05ee01dd39ce0643a46fec35611c8a 100644 (file)
@@ -244,21 +244,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();
@@ -270,6 +270,7 @@ void XGUI_PropertyPanel::setActiveWidget(ModuleBase_ModelWidget* theWidget)
     theWidget->activate();
   }
   myActiveWidget = theWidget;
+  return true;
 }
 
 void XGUI_PropertyPanel::setFocusOnOkButton()
index d916f4f6484efa52403a31daf1bccc004509cf00..fe6eb0ec87fb6e1fab910df143a2002a4f27a2fc 100644 (file)
@@ -119,7 +119,7 @@ Q_OBJECT
 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