]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #905 Update of invalid feature representation in property panel
authornds <nds@opencascade.com>
Wed, 9 Sep 2015 12:02:34 +0000 (15:02 +0300)
committernds <nds@opencascade.com>
Wed, 9 Sep 2015 12:02:34 +0000 (15:02 +0300)
Widget should not be in pink also.

src/XGUI/XGUI_ErrorMgr.cpp

index 190f9c1ed303ea9c7d6885beb8466f054c47593f..1cf0d45b99a270ffce23d6080d5c4d67136c8a0c 100644 (file)
@@ -75,19 +75,21 @@ void XGUI_ErrorMgr::updateActionState(QAction* theAction, const FeaturePtr& theF
                                       const bool theEnabled)
 {
   bool isActionEnabled = theAction->data() != INVALID_VALUE;
-  if (theEnabled  == isActionEnabled)
-    return;
+  if (theEnabled  != isActionEnabled) {
+    // update enable state of the button
+    theAction->setIcon(theEnabled ? QIcon(":pictures/button_ok.png"): QIcon(":pictures/button_ok_error.png"));
+    if (theEnabled)
+      theAction->setData("");
+    else
+      theAction->setData(INVALID_VALUE);
+  }
 
-  theAction->setIcon(theEnabled ? QIcon(":pictures/button_ok.png"): QIcon(":pictures/button_ok_error.png"));
+  // update controls error information
   QWidget* aWidget = myPropertyPanel->headerWidget();
-  if (theEnabled) {
-    theAction->setData("");
+  if (theEnabled)
     aWidget->setToolTip("");
-  }
-  else {
-    theAction->setData(INVALID_VALUE);
+  else
     aWidget->setToolTip(getFeatureError(theFeature));
-  }
 }
 
 const char* toString(ModelAPI_ExecState theExecState)