X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_ErrorMgr.h;h=23012267b30a52f781cadcbc07c71b12d27f05b5;hb=1a59f21be05badd17bcac9ce82b2857b961f1d2e;hp=89deaeef928cb6430759c511e1030e4704cd1a8e;hpb=c3ae28ba30027cc4a6a757ef623f40adaae96ead;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_ErrorMgr.h b/src/XGUI/XGUI_ErrorMgr.h index 89deaeef9..23012267b 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,38 +44,38 @@ 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(); + /// Returns true if the apply is enabled for the current feature + bool isApplyEnabled() const; protected slots: /// Reimplemented from ModuleBase_ErrorMgr::onWidgetChanged(). 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 + QString myAcceptToolTip; /// cached tool tip value for enabled Accept action + QString myAcceptAllToolTip; /// cached tool tip value for enabled AcceptAll action }; #endif // XGUI_ErrorMgr_H \ No newline at end of file