- QString aData = theAction->data().toString();
-
- bool isActionEnabled = theAction->data() != INVALID_VALUE;
-
- QString anError = getFeatureError(theFeature);
- if (!isActionEnabled && !anError.isEmpty()) {
- if (!myErrorDialog) {
- myErrorDialog = new QDialog(QApplication::desktop(), Qt::Popup);
- QHBoxLayout* aLay = new QHBoxLayout(myErrorDialog);
- aLay->setContentsMargins(0, 0, 0, 0);
-
- QFrame* aMarginWidget = new QFrame(myErrorDialog);
- aMarginWidget->setFrameStyle(QFrame::Panel | QFrame::Raised);
-
- aLay->addWidget(aMarginWidget);
- QHBoxLayout* aMarginLay = new QHBoxLayout(aMarginWidget);
- aMarginLay->setContentsMargins(4, 4, 4, 4);
-
- myErrorLabel = new QLabel(aMarginWidget);
- aMarginLay->addWidget(myErrorLabel);
+ //update Ok Action and header of property panel if the current operation started for the feature
+ XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr();
+ ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
+ (workshop()->operationMgr()->currentOperation());
+ if (aFOperation && aFOperation->feature() == theFeature) {
+ QAction* anOkAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::Accept);
+
+ ModuleBase_ModelWidget* anActiveWidget = activeWidget();
+ bool isApplyEnabledByActiveWidget = false;
+ if (anActiveWidget)
+ isApplyEnabledByActiveWidget = anActiveWidget->getValueState() ==
+ ModuleBase_ModelWidget::ModifiedInPP;
+ QString anError = "";
+ QString aWidgetError = "";
+ if (!isApplyEnabledByActiveWidget) {
+ anError = myWorkshop->module()->getFeatureError(theFeature);
+ if (anActiveWidget)
+ aWidgetError = anActiveWidget->getError();
+ if (anError.isEmpty())
+ anError = aWidgetError;