SHAPER  9.12.0
XGUI_ErrorMgr.h
1 // Copyright (C) 2014-2023 CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef XGUI_ErrorMgr_H
21 #define XGUI_ErrorMgr_H
22 
23 #include "XGUI.h"
24 
25 #include <ModuleBase_IErrorMgr.h>
26 #include <ModelAPI_Feature.h>
27 
28 class XGUI_Workshop;
31 
32 class QAction;
33 class QDialog;
34 class QLabel;
35 
41 class XGUI_EXPORT XGUI_ErrorMgr : public ModuleBase_IErrorMgr
42 {
43  Q_OBJECT
44 public:
48  XGUI_ErrorMgr(QObject* theParent, ModuleBase_IWorkshop* theWorkshop);
50  virtual ~XGUI_ErrorMgr();
51 
54  virtual void updateActions(const FeaturePtr& theFeature);
55 
58  void updateAcceptAllAction(const FeaturePtr& theFeature);
59 
61  bool isApplyEnabled() const;
62 
63 protected slots:
65  virtual void onWidgetChanged();
66 
67 private:
69  void storeInitialActionValues();
70 
75  void updateAcceptActionState(const QString& theError);
76 
80  void updateToolTip(ModuleBase_ModelWidget* theWidget, const QString& theError);
81 
83  XGUI_Workshop* workshop() const;
84 
87  ModuleBase_ModelWidget* activeWidget() const;
88 
89 private:
90  ModuleBase_IWorkshop* myWorkshop;
91  QDialog* myErrorDialog;
92  QLabel* myErrorLabel;
93  QString myAcceptToolTip;
94  QString myAcceptAllToolTip;
95  QString myAcceptStatusTip;
96  QString myAcceptAllStatusTip;
97 };
98 
99 #endif // XGUI_ErrorMgr_H
An interface to Errors manager object.
Definition: ModuleBase_IErrorMgr.h:38
virtual void updateActions(const std::shared_ptr< ModelAPI_Feature > &theFeature)=0
Update actions for the given feature.
virtual void onWidgetChanged()=0
Process values changed event for processing feature attribute validation errors.
Class which provides access to Workshop object services.
Definition: ModuleBase_IWorkshop.h:48
An abstract custom widget class.
Definition: ModuleBase_ModelWidget.h:60
Class of Errors manager object.
Definition: XGUI_ErrorMgr.h:42
Class which defines a configuration of the application (Workshop) and launches it.
Definition: XGUI_Workshop.h:82