From: nds Date: Wed, 9 Sep 2015 12:02:34 +0000 (+0300) Subject: Issue #905 Update of invalid feature representation in property panel X-Git-Tag: V_1.4.0_beta4~62 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=af41da73910b8b5261374ce227edb56cb2d7bc46;p=modules%2Fshaper.git Issue #905 Update of invalid feature representation in property panel Widget should not be in pink also. --- diff --git a/src/XGUI/XGUI_ErrorMgr.cpp b/src/XGUI/XGUI_ErrorMgr.cpp index 190f9c1ed..1cf0d45b9 100644 --- a/src/XGUI/XGUI_ErrorMgr.cpp +++ b/src/XGUI/XGUI_ErrorMgr.cpp @@ -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)