From: nds Date: Thu, 12 Nov 2015 15:58:16 +0000 (+0300) Subject: #1083 errors in parameter X-Git-Tag: V_2.0.0_alfa2~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fb22ba72114328242bb0bd465abbca43321dcfe4;p=modules%2Fshaper.git #1083 errors in parameter The correction for widgets, which are not in the parameters dialog. They also should show tool tip errors. --- diff --git a/src/ModuleBase/ModuleBase_IErrorMgr.cpp b/src/ModuleBase/ModuleBase_IErrorMgr.cpp index 1d1c8a8d2..293c2b80f 100644 --- a/src/ModuleBase/ModuleBase_IErrorMgr.cpp +++ b/src/ModuleBase/ModuleBase_IErrorMgr.cpp @@ -29,6 +29,7 @@ void ModuleBase_IErrorMgr::setPropertyPanel(ModuleBase_IPropertyPanel* theProp) foreach(const ModuleBase_ModelWidget* aWgt, myPropertyPanel->modelWidgets()) { connect(aWgt, SIGNAL(afterValuesChanged()), this, SLOT(onWidgetChanged())); connect(aWgt, SIGNAL(afterValuesRestored()), this, SLOT(onWidgetChanged())); + connect(aWgt, SIGNAL(valueStateChanged(int)), this, SLOT(onWidgetChanged())); } } } diff --git a/src/ModuleBase/ModuleBase_IModule.cpp b/src/ModuleBase/ModuleBase_IModule.cpp index 29e89f3ef..c73bf3c1c 100644 --- a/src/ModuleBase/ModuleBase_IModule.cpp +++ b/src/ModuleBase/ModuleBase_IModule.cpp @@ -8,9 +8,11 @@ #include "ModuleBase_ISelection.h" #include "ModuleBase_OperationDescription.h" #include "ModuleBase_OperationFeature.h" +#include #include +#include #include #include #include @@ -78,7 +80,7 @@ const char* toString(ModelAPI_ExecState theExecState) #undef TO_STRING } -QString ModuleBase_IModule::getFeatureError(const FeaturePtr& theFeature, const bool isCheckGUI) +QString ModuleBase_IModule::getFeatureError(const FeaturePtr& theFeature) { QString anError; if (!theFeature.get() || !theFeature->data()->isValid() || theFeature->isAction()) @@ -101,6 +103,35 @@ QString ModuleBase_IModule::getFeatureError(const FeaturePtr& theFeature, const return anError; } +QString ModuleBase_IModule::getWidgetError(ModuleBase_ModelWidget* theWidget) +{ + QString anError; + + if (!theWidget || !theWidget->feature().get()) + return anError; + + std::string anAttributeID = theWidget->attributeID(); + AttributePtr anAttribute = theWidget->feature()->attribute(anAttributeID); + if (!anAttribute.get()) + return anError; + + std::string aValidatorID; + std::string anErrorMsg; + + static ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators(); + if (!aValidators->validate(anAttribute, aValidatorID, anErrorMsg)) { + if (anErrorMsg.empty()) + anErrorMsg = "unknown error."; + anErrorMsg = anAttributeID + " - " + aValidatorID + ": " + anErrorMsg; + } + + anError = QString::fromStdString(anErrorMsg); + if (anError.isEmpty()) + anError = theWidget->getValueStateError(); + + return anError; +} + void ModuleBase_IModule::grantedOperationIds(ModuleBase_Operation* theOperation, QStringList& theIds) const { diff --git a/src/ModuleBase/ModuleBase_IModule.h b/src/ModuleBase/ModuleBase_IModule.h index de02c0dfe..11e7949cf 100755 --- a/src/ModuleBase/ModuleBase_IModule.h +++ b/src/ModuleBase/ModuleBase_IModule.h @@ -189,7 +189,12 @@ class MODULEBASE_EXPORT ModuleBase_IModule : public QObject //! Returns the feature error if the current state of the feature in the module is not correct //! If the feature is correct, it returns an empty value //! \return string value - virtual QString getFeatureError(const FeaturePtr& theFeature, const bool isCheckGUI = true); + virtual QString getFeatureError(const FeaturePtr& theFeature); + + //! Returns the widget error, get it from the attribute validator and state of the widget + //! If the feature is correct, it returns an empty value + //! \return string value + virtual QString getWidgetError(ModuleBase_ModelWidget* theWidget); /// Returns list of granted operation indices virtual void grantedOperationIds(ModuleBase_Operation* theOperation, QStringList& theIds) const; diff --git a/src/ModuleBase/ModuleBase_ModelWidget.cpp b/src/ModuleBase/ModuleBase_ModelWidget.cpp index f0d330553..11a884722 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.cpp +++ b/src/ModuleBase/ModuleBase_ModelWidget.cpp @@ -55,6 +55,33 @@ bool ModuleBase_ModelWidget::isInitialized(ObjectPtr theObject) const return theObject->data()->attribute(attributeID())->isInitialized(); } +QString ModuleBase_ModelWidget::getValueStateError() const +{ + QString anError = ""; + + ModuleBase_ModelWidget::ValueState aState = getValueState(); + if (aState != ModuleBase_ModelWidget::Stored) { + AttributePtr anAttr = feature()->attribute(attributeID()); + if (anAttr.get()) { + QString anAttributeName = anAttr->id().c_str(); + switch (aState) { + case ModuleBase_ModelWidget::ModifiedInPP: + anError = "Attribute \"" + anAttributeName + + "\" modification is not applyed. Please click \"Enter\" or \"Tab\"."; + break; + case ModuleBase_ModelWidget::ModifiedInViewer: + anError = "Attribute \"" + anAttributeName + + "\" is locked by modification value in the viewer."; + break; + case ModuleBase_ModelWidget::Reset: + anError = "Attribute \"" + anAttributeName + "\" is not initialized."; + break; + } + } + } + return anError; +} + void ModuleBase_ModelWidget::enableFocusProcessing() { QList aMyControls = getControls(); diff --git a/src/ModuleBase/ModuleBase_ModelWidget.h b/src/ModuleBase/ModuleBase_ModelWidget.h index 6e6b1aac4..3a2f19961 100644 --- a/src/ModuleBase/ModuleBase_ModelWidget.h +++ b/src/ModuleBase/ModuleBase_ModelWidget.h @@ -81,6 +81,10 @@ Q_OBJECT /// \return the enumeration result ValueState getValueState() const { return myState; } + /// Returns an attribute error according to the value state + /// It exists in all cases excepring the "Store" case + QString getValueStateError() const; + /// Defines if it is supposed that the widget should interact with the viewer. virtual bool isViewerSelector() { return false; } diff --git a/src/PartSet/PartSet_Module.cpp b/src/PartSet/PartSet_Module.cpp index 69d58a916..3346c8a75 100755 --- a/src/PartSet/PartSet_Module.cpp +++ b/src/PartSet/PartSet_Module.cpp @@ -373,11 +373,11 @@ void PartSet_Module::updateViewerMenu(const QMap& theStdActio myMenuMgr->updateViewerMenu(theStdActions); } -QString PartSet_Module::getFeatureError(const FeaturePtr& theFeature, const bool isCheckGUI) +QString PartSet_Module::getFeatureError(const FeaturePtr& theFeature) { - QString anError = ModuleBase_IModule::getFeatureError(theFeature, isCheckGUI); + QString anError = ModuleBase_IModule::getFeatureError(theFeature); if (anError.isEmpty()) - anError = sketchMgr()->getFeatureError(theFeature, isCheckGUI); + anError = sketchMgr()->getFeatureError(theFeature); return anError; } diff --git a/src/PartSet/PartSet_Module.h b/src/PartSet/PartSet_Module.h index 26f7ace34..b83286bf5 100755 --- a/src/PartSet/PartSet_Module.h +++ b/src/PartSet/PartSet_Module.h @@ -206,7 +206,7 @@ public: //! Returns the feature error if the current state of the feature in the module is not correct //! If the feature is correct, it returns an empty value //! \return string value - virtual QString getFeatureError(const FeaturePtr& theFeature, const bool isCheckGUI = true); + virtual QString getFeatureError(const FeaturePtr& theFeature); /// Returns list of granted operation indices virtual void grantedOperationIds(ModuleBase_Operation* theOperation, QStringList& theIds) const; diff --git a/src/PartSet/PartSet_SketcherMgr.cpp b/src/PartSet/PartSet_SketcherMgr.cpp index a9a2232fa..5accebfb8 100755 --- a/src/PartSet/PartSet_SketcherMgr.cpp +++ b/src/PartSet/PartSet_SketcherMgr.cpp @@ -680,7 +680,7 @@ bool PartSet_SketcherMgr::sketchSolverError() return anError; } -QString PartSet_SketcherMgr::getFeatureError(const FeaturePtr& theFeature, const bool isCheckGUI) +QString PartSet_SketcherMgr::getFeatureError(const FeaturePtr& theFeature) { QString anError = ""; if (!theFeature.get() || !theFeature->data()->isValid()) @@ -691,31 +691,6 @@ QString PartSet_SketcherMgr::getFeatureError(const FeaturePtr& theFeature, const AttributeStringPtr aAttributeString = aSketch->string(SketchPlugin_Sketch::SOLVER_ERROR()); anError = aAttributeString->value().c_str(); } - else { - ModuleBase_ModelWidget* anActiveWidget = getActiveWidget(); - if (isCheckGUI && anActiveWidget) { - ModuleBase_ModelWidget::ValueState aState = anActiveWidget->getValueState(); - if (aState != ModuleBase_ModelWidget::Stored) { - AttributePtr anAttr = anActiveWidget->feature()->attribute(anActiveWidget->attributeID()); - if (anAttr.get()) { - QString anAttributeName = anAttr->id().c_str(); - switch (aState) { - case ModuleBase_ModelWidget::ModifiedInPP: - anError = "Attribute \"" + anAttributeName + - "\" modification is not applyed. Please click \"Enter\" or \"Tab\"."; - break; - case ModuleBase_ModelWidget::ModifiedInViewer: - anError = "Attribute \"" + anAttributeName + - "\" is locked by modification value in the viewer."; - break; - case ModuleBase_ModelWidget::Reset: - anError = "Attribute \"" + anAttributeName + "\" is not initialized."; - break; - } - } - } - } - } return anError; } diff --git a/src/PartSet/PartSet_SketcherMgr.h b/src/PartSet/PartSet_SketcherMgr.h index 8971ba26f..3b3280152 100644 --- a/src/PartSet/PartSet_SketcherMgr.h +++ b/src/PartSet/PartSet_SketcherMgr.h @@ -184,7 +184,7 @@ public: //! Incorrect states: the feature is sketch, the solver error value //! The feature value is reset, this is the flag of sketch mgr //! \return string value - QString getFeatureError(const FeaturePtr& theFeature, const bool isCheckGUI = true); + QString getFeatureError(const FeaturePtr& theFeature); /// It nullify internal flags concerned to clicked mouse event void clearClickedFlags(); diff --git a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp index 083cbd36f..24d2b3309 100755 --- a/src/PartSet/PartSet_SketcherReetntrantMgr.cpp +++ b/src/PartSet/PartSet_SketcherReetntrantMgr.cpp @@ -178,7 +178,7 @@ void PartSet_SketcherReetntrantMgr::onNoMoreWidgets(const std::string& thePrevio ModuleBase_OperationFeature* aFOperation = dynamic_cast (myWorkshop->currentOperation()); - if (!myWorkshop->module()->getFeatureError(aFOperation->feature(), false).isEmpty()) + if (!myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty()) return; if (aFOperation && PartSet_SketcherMgr::isNestedSketchOperation(aFOperation)) { @@ -201,7 +201,7 @@ bool PartSet_SketcherReetntrantMgr::processEnter(const std::string& thePreviousA ModuleBase_OperationFeature* aFOperation = dynamic_cast (myWorkshop->currentOperation()); - if (!myWorkshop->module()->getFeatureError(aFOperation->feature(), false).isEmpty()) + if (!myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty()) return isDone; myRestartingMode = RM_EmptyFeatureUsed; diff --git a/src/XGUI/XGUI_ErrorMgr.cpp b/src/XGUI/XGUI_ErrorMgr.cpp index 4da32c077..afacb5d82 100644 --- a/src/XGUI/XGUI_ErrorMgr.cpp +++ b/src/XGUI/XGUI_ErrorMgr.cpp @@ -49,21 +49,29 @@ XGUI_ErrorMgr::~XGUI_ErrorMgr() void XGUI_ErrorMgr::updateActions(const FeaturePtr& theFeature) { - QString anError = myWorkshop->module()->getFeatureError(theFeature); - //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 (workshop()->operationMgr()->currentOperation()); if (aFOperation && aFOperation->feature() == theFeature) { QAction* anOkAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::Accept); - updateActionState(anOkAction, theFeature); + QString anError = myWorkshop->module()->getFeatureError(theFeature); + + ModuleBase_ModelWidget* anActiveWidget = activeWidget(); + QString aWidgetError = myWorkshop->module()->getWidgetError(anActiveWidget); + if (anError.isEmpty()) + anError = aWidgetError; + + updateActionState(anOkAction, anError); + updateToolTip(anActiveWidget, aWidgetError); } } void XGUI_ErrorMgr::updateAcceptAllAction(const FeaturePtr& theFeature) { QString anError = myWorkshop->module()->getFeatureError(theFeature); + if (anError.isEmpty()) + anError = myWorkshop->module()->getWidgetError(activeWidget()); XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr(); if (workshop()->isFeatureOfNested(theFeature)) { @@ -74,134 +82,36 @@ void XGUI_ErrorMgr::updateAcceptAllAction(const FeaturePtr& theFeature) } } -bool XGUI_ErrorMgr::canProcessClick(QAction* theAction, const FeaturePtr& theFeature) +void XGUI_ErrorMgr::updateActionState(QAction* theAction, const QString& theError) { - QString anError = myWorkshop->module()->getFeatureError(theFeature); - bool isActionEnabled = anError.isEmpty(); - 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); - } - myErrorLabel->setText(anError); - myErrorDialog->move(QCursor::pos()); - myErrorDialog->show(); - } - return isActionEnabled; -} + bool anEnabled = theError.isEmpty(); -void XGUI_ErrorMgr::updateActionState(QAction* theAction, const FeaturePtr& theFeature/*, - const bool theEnabled*/) -{ - QString anError = myWorkshop->module()->getFeatureError(theFeature); - bool anEnabled = anError.isEmpty(); - - /*bool isActionEnabled = theAction->data() != INVALID_VALUE; - if (anEnabled != isActionEnabled) { - // update enable state of the button - theAction->setIcon(anEnabled ? QIcon(":pictures/button_ok.png"): QIcon(":pictures/button_ok_error.png")); - if (anEnabled) - theAction->setData(""); - else - theAction->setData(INVALID_VALUE); - }*/ theAction->setEnabled(anEnabled); // some operations have no property panel, so it is important to check that it is not null if (myPropertyPanel) { // update controls error information QWidget* aWidget = myPropertyPanel->headerWidget(); if (aWidget) - aWidget->setToolTip(anError); + aWidget->setToolTip(theError); } } - -/*const char* toString(ModelAPI_ExecState theExecState) -{ -#define TO_STRING(__NAME__) case __NAME__: return #__NAME__; - switch (theExecState) { - TO_STRING(ModelAPI_StateDone) - TO_STRING(ModelAPI_StateMustBeUpdated) - TO_STRING(ModelAPI_StateExecFailed) - TO_STRING(ModelAPI_StateInvalidArgument) - TO_STRING(ModelAPI_StateNothing) - default: return "Unknown ExecState."; - } -#undef TO_STRING -}*/ - -/*void XGUI_ErrorMgr::onValidationStateChanged() -{ - XGUI_OperationMgr* anOperationMgr = dynamic_cast(sender()); - if (!anOperationMgr) - return; - ModuleBase_OperationFeature* aFOperation = dynamic_cast - (anOperationMgr->currentOperation()); - if (!myPropertyPanel || !aFOperation) - return; - - FeaturePtr aFeature = aFOperation->feature(); - QString anError = getFeatureError(aFeature); - - QWidget* aWidget = myPropertyPanel->headerWidget(); - if (aWidget) { - aWidget->setToolTip(anError); - aWidget->setStyleSheet(anError.isEmpty() ? "" : "background-color:pink;"); - } -}*/ - -/*QString XGUI_ErrorMgr::getFeatureError(const FeaturePtr& theFeature) const -{ - QString anError; - // get feature - if (!theFeature.get() || !theFeature->data()->isValid()) - return anError; - - // set error indication - anError = QString::fromStdString(theFeature->error()); - if (anError.isEmpty()) { - bool isDone = ( theFeature->data()->execState() == ModelAPI_StateDone - || theFeature->data()->execState() == ModelAPI_StateMustBeUpdated ); - if (!isDone) - anError = toString(theFeature->data()->execState()); - } - - return anError; -}*/ - void XGUI_ErrorMgr::onWidgetChanged() { - static ModelAPI_ValidatorsFactory* aValidators = ModelAPI_Session::get()->validators(); - ModuleBase_ModelWidget* aModelWidget = dynamic_cast(sender()); if (!aModelWidget || !aModelWidget->feature().get()) return; - std::string anAttributeID = aModelWidget->attributeID(); - AttributePtr anAttribute = aModelWidget->feature()->attribute(anAttributeID); - if (!anAttribute.get()) - return; + QString aWidgetError = myWorkshop->module()->getWidgetError(aModelWidget); + updateToolTip(aModelWidget, aWidgetError); +} - std::string aValidatorID; - std::string anErrorMsg; - if (!aValidators->validate(anAttribute, aValidatorID, anErrorMsg)) { - if (anErrorMsg.empty()) - anErrorMsg = "unknown error."; - anErrorMsg = anAttributeID + " - " + aValidatorID + ": " + anErrorMsg; - } +void XGUI_ErrorMgr::updateToolTip(ModuleBase_ModelWidget* theWidget, + const QString& theError) +{ + if (!theWidget) + return; - QString anError = QString::fromStdString(anErrorMsg); - QList aWidgetList = aModelWidget->getControls(); + QList aWidgetList = theWidget->getControls(); foreach(QWidget* aWidget, aWidgetList) { QLabel* aLabel = qobject_cast(aWidget); // We won't set the effect to QLabels - it looks ugly @@ -210,10 +120,10 @@ void XGUI_ErrorMgr::onWidgetChanged() // Get the original tool tip of the widget QString aTTip = aWidget->toolTip().section("Errors:\n", 0, 0).trimmed(); // Add the error message into the tool tip - if (!anError.isEmpty()) { + if (!theError.isEmpty()) { if (!aTTip.isEmpty()) aTTip.append('\n'); - aTTip += "Errors:\n" + anError; + aTTip += "Errors:\n" + theError; } aWidget->setToolTip(aTTip); //aWidget->setStyleSheet(anError.isEmpty() ? "" : "background-color:pink;"); @@ -225,3 +135,19 @@ XGUI_Workshop* XGUI_ErrorMgr::workshop() const XGUI_ModuleConnector* aConnector = dynamic_cast(myWorkshop); return aConnector->workshop(); } + +ModuleBase_ModelWidget* XGUI_ErrorMgr::activeWidget() const +{ + ModuleBase_ModelWidget* anActiveWidget = 0; + + ModuleBase_OperationFeature* aFOperation = dynamic_cast + (workshop()->operationMgr()->currentOperation()); + if (aFOperation) { + ModuleBase_IPropertyPanel* aPropertyPanel = aFOperation->propertyPanel(); + if (aPropertyPanel) { + anActiveWidget = aPropertyPanel->activeWidget(); + } + } + return anActiveWidget; +} + diff --git a/src/XGUI/XGUI_ErrorMgr.h b/src/XGUI/XGUI_ErrorMgr.h index 89deaeef9..7295a52a4 100644 --- a/src/XGUI/XGUI_ErrorMgr.h +++ b/src/XGUI/XGUI_ErrorMgr.h @@ -14,6 +14,8 @@ class XGUI_Workshop; class ModuleBase_IWorkshop; +class ModuleBase_ModelWidget; + class QAction; class QDialog; class QLabel; @@ -42,12 +44,6 @@ public: /// \param theFeature a feature void updateAcceptAllAction(const FeaturePtr& theFeature); - /// Return true if the feature has no error. If there is an error and the action - /// is not valid, the dialog with the error information is shown. - /// \param theAction an action, which is checked on validity - /// \param theFeature a feature that provides error information - bool canProcessClick(QAction* theAction, const FeaturePtr& theFeature); - public slots: /// Reimplemented from ModuleBase_ErrorMgr::onValidationStateChanged(). //virtual void onValidationStateChanged(); @@ -57,21 +53,26 @@ protected slots: virtual void onWidgetChanged(); private: - /// It updates the action state according to the given parameter + /// It disables the action if the error message is not empty + /// The message is set to the header tool tip. /// \param theAction an action to be changed - /// \param theFeature an feature that corresponds to the action - void updateActionState(QAction* theAction, const FeaturePtr& theFeature); + /// \param theError an error state + void updateActionState(QAction* theAction, const QString& theError); - /// Returns the feature error message - /// \param theFeature a feature - /// \return the error message - //QString getFeatureError(const FeaturePtr& theFeature) const; + /// It updates the tool tip of the widget controls according to the widget error + /// \param theWidget a widget + /// \param theError an error state + void updateToolTip(ModuleBase_ModelWidget* theWidget, const QString& theError); /// Returns casted workshop XGUI_Workshop* workshop() const; + /// Returns an active widget of the current operation + /// \return the widget or zero + ModuleBase_ModelWidget* activeWidget() const; + private: - ModuleBase_IWorkshop* myWorkshop; + ModuleBase_IWorkshop* myWorkshop; /// workshop QDialog* myErrorDialog; /// contains the error message QLabel* myErrorLabel; /// contains an error information }; diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 4cf2001e1..e0139d8f5 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -198,8 +198,18 @@ void XGUI_OperationMgr::onValidateOperation() return; ModuleBase_OperationFeature* aFOperation = dynamic_cast (currentOperation()); - if(aFOperation && aFOperation->feature().get()) - setApplyEnabled(myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty()); + if(aFOperation && aFOperation->feature().get()) { + QString anError = myWorkshop->module()->getFeatureError(aFOperation->feature()); + if (anError.isEmpty()) { + ModuleBase_IPropertyPanel* aPanel = aFOperation->propertyPanel(); + if (aPanel) { + ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget(); + if (anActiveWidget) + anError = myWorkshop->module()->getWidgetError(anActiveWidget); + } + } + setApplyEnabled(anError.isEmpty()); + } } void XGUI_OperationMgr::setApplyEnabled(const bool theEnabled) @@ -541,7 +551,7 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent) if (!aActiveWgt || !aActiveWgt->processEnter()) { if (!myWorkshop->module()->processEnter(aActiveWgt ? aActiveWgt->attributeID() : "")) { ModuleBase_OperationFeature* aFOperation = dynamic_cast(currentOperation()); - if (!aFOperation || myWorkshop->module()->getFeatureError(aFOperation->feature(), false).isEmpty()) { + if (!aFOperation || myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty()) { emit keyEnterReleased(); commitOperation(); } diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 25ed50fd3..2199df248 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -387,8 +387,8 @@ void XGUI_Workshop::onAcceptActionClicked() ModuleBase_OperationFeature* aFOperation = dynamic_cast (anOperationMgr->currentOperation()); if (aFOperation) { - if (errorMgr()->canProcessClick(anAction, aFOperation->feature())) - myOperationMgr->onCommitOperation(); + //if (errorMgr()->canProcessClick(anAction, aFOperation->feature())) + myOperationMgr->onCommitOperation(); } } }