Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom.git into Dev_0.7.1
[modules/shaper.git] / src / XGUI / XGUI_ErrorDialog.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 /*
4  * XGUI_ErrorDialog.h
5  *
6  *  Created on: Apr 28, 2014
7  *      Author: sbh
8  */
9
10 #ifndef XGUI_ERRORDIALOG_H_
11 #define XGUI_ERRORDIALOG_H_
12
13 #include <XGUI.h>
14 #include <QDialog>
15
16 class QTextEdit;
17
18 /**
19 * A class of dialog to show error message
20 */
21 class XGUI_ErrorDialog : public QDialog
22 {
23 Q_OBJECT
24  public:
25    /// Constructor
26    /// \param parent a parent widget
27   XGUI_EXPORT XGUI_ErrorDialog(QWidget* parent);XGUI_EXPORT virtual ~XGUI_ErrorDialog();
28
29  public slots:
30    /// Update dialog box
31   XGUI_EXPORT void refresh();
32
33   /// Clear messages
34   XGUI_EXPORT void clear();
35
36   /// Add error message
37   XGUI_EXPORT void addError(const QString&);
38
39   /// Remove error message
40   XGUI_EXPORT void removeError(const QString&);
41
42  private:
43    /// Widget for error log
44   QTextEdit* myErrorLog;
45
46   /// List of errors
47   QStringList myErrors;
48 };
49
50 #endif /* XGUI_ERRORDIALOG_H_ */