1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: XGUI_ErrorMgr.h
4 // Created: 22 July 2015
5 // Author: Sergey POKHODENKO
7 #ifndef XGUI_ErrorMgr_H
8 #define XGUI_ErrorMgr_H
12 #include <ModuleBase_IErrorMgr.h>
13 #include <ModelAPI_Feature.h>
19 class XGUI_EXPORT XGUI_ErrorMgr : public ModuleBase_IErrorMgr
23 XGUI_ErrorMgr(QObject* theParent = 0);
24 /// Virtual destructor
25 virtual ~XGUI_ErrorMgr();
27 /// It updates the action state according to the given parameter
28 /// \param theAction an action to be changed
29 /// \param theFeature an feature that corresponds to the action
30 /// \param theEnabled an enable state
31 void updateActionState(QAction* theAction, const FeaturePtr& theFeature,
32 const bool theEnabled);
34 /// Return true if the feature has no error. If there is an error and the action
35 /// is not valid, the dialog with the error information is shown.
36 /// \param theAction an action, which is checked on validity
37 /// \param theFeature a feature that provides error information
38 bool canProcessClick(QAction* theAction, const FeaturePtr& theFeature);
41 /// Reimplemented from ModuleBase_ErrorMgr::onValidationStateChanged().
42 //virtual void onValidationStateChanged();
45 /// Reimplemented from ModuleBase_ErrorMgr::onWidgetChanged().
46 virtual void onWidgetChanged();
49 /// Returns the feature error message
50 /// \param theFeature a feature
51 /// \return the error message
52 QString getFeatureError(const FeaturePtr& theFeature) const;
55 QDialog* myErrorDialog; /// contains the error message
56 QLabel* myErrorLabel; /// contains an error information
59 #endif // XGUI_ErrorMgr_H