Salome HOME
Merge branch 'BR_internationalization'
[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 class Events_InfoMessage;
18
19 /**
20 * \ingroup GUI
21 * A class of dialog to show error message
22 */
23 class XGUI_ErrorDialog : public QDialog
24 {
25 Q_OBJECT
26  public:
27    /// Constructor
28    /// \param parent a parent widget
29   XGUI_EXPORT XGUI_ErrorDialog(QWidget* parent);
30   XGUI_EXPORT virtual ~XGUI_ErrorDialog();
31
32  public slots:
33    /// Update dialog box
34   XGUI_EXPORT void refresh();
35
36   /// Clear messages
37   XGUI_EXPORT void clear();
38
39   /// Add error message
40   XGUI_EXPORT void addError(std::shared_ptr<Events_InfoMessage> theMsg);
41
42   /// Remove error message
43   XGUI_EXPORT void removeError(const QString&);
44
45  private:
46    /// Widget for error log
47   QTextEdit* myErrorLog;
48
49   /// List of errors
50   QStringList myErrors;
51 };
52
53 #endif /* XGUI_ERRORDIALOG_H_ */