-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinfo_message.h
121 lines (103 loc) · 3.18 KB
/
info_message.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// ---------------------------------------------------------------------
//
// Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------
#ifndef INFOMESSAGE_H
#define INFOMESSAGE_H
#include <QDialog>
#include <QSettings>
#include <QCheckBox>
#include <QTextEdit>
#include <QLabel>
namespace dealii
{
/*! @addtogroup ParameterGui
*@{
*/
namespace ParameterGui
{
/**
* The InfoMessage class implements a special info message for the parameterGUI.
* Besides showing a info message itself, the dialog shows a checkbox "Show this message again".
* If the user unchecks this box, this is stored in the "settings.ini" file and will be reloaded
* the next time the user opens the parameterGUI. The intention of such a info message is the following.
* The user should have some information on how using the GUI "at hand"
* such as "how to edit parameter values" for example. But after reading this message, the user knows
* it and the message should not appear permanently.
*
* @note This class is used in the graphical user interface for the @ref ParameterHandler class.
* It is not compiled into the deal.II libraries and can not be used by applications using deal.II.
*
* @ingroup ParameterGui
* @author Martin Steigemann, Wolfgang Bangerth, 2010
*/
class InfoMessage : public QDialog
{
Q_OBJECT
public:
/**
* Constructor
*/
InfoMessage (QSettings *settings,
QWidget *parent = 0);
/**
* With this function the @p message which will be shown in the
* dialog can be set.
*/
void setInfoMessage(const QString &message);
public slots:
/**
* Show the dialog with the <tt>message</tt>.
*/
void showMessage();
protected:
/**
* Reimplemented from QDialog.
*/
void done(int r);
private:
/**
* This variable stores, if the <tt>message</tt> should be shown again the next time.
*/
bool show_again;
/**
* The <tt>Ok</tt> button.
*/
QPushButton *ok;
/**
* The checkbox<tt>Show this message again</tt>.
*/
QCheckBox *again;
/**
* The <tt>message</tt> editor.
*/
QTextEdit *message;
/**
* An <tt>icon</tt> for the dialog.
*/
QLabel *icon;
#ifdef QT_SOFTKEYS_ENABLED
/**
* A action for pressing the <tt>Ok</tt> button.
*/
QAction *ok_action;
#endif
/**
* An object for storing <tt>settings</tt> in a file.
*/
QSettings *settings;
};
}
/**@}*/
}
#endif