2
* \file messagedialog.h
9
* Copyright (C) 2011 Urs Fleisch
11
* This file is part of Kid3.
13
* Kid3 is free software; you can redistribute it and/or modify
14
* it under the terms of the GNU General Public License as published by
15
* the Free Software Foundation; either version 2 of the License, or
16
* (at your option) any later version.
18
* Kid3 is distributed in the hope that it will be useful,
19
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
* GNU General Public License for more details.
23
* You should have received a copy of the GNU General Public License
24
* along with this program. If not, see <http://www.gnu.org/licenses/>.
27
#ifndef MESSAGEDIALOG_H
28
#define MESSAGEDIALOG_H
32
#ifndef CONFIG_USE_KDE
34
#include <QMessageBox>
38
class QDialogButtonBox;
42
* Drop-in replacement for QMessageBox, but suitable for large texts.
44
class MessageDialog : public QDialog {
50
* @param parent parent widget
52
explicit MessageDialog(QWidget* parent = 0);
57
virtual ~MessageDialog();
60
* Set the text to be displayed.
62
* @param text message text.
64
void setText(const QString& text);
67
* Set the informative text.
68
* This text can be large and is displayed in a text edit.
70
* @param text message text.
72
void setInformativeText(const QString& text);
75
* Set the message box's icon.
77
* @param icon icon to be displayed
79
void setIcon(QMessageBox::Icon icon);
82
* Set buttons to be displayed.
84
* @param buttons buttons to be displayed
86
void setStandardButtons(QMessageBox::StandardButtons buttons);
91
* @param button button which gets default focus
93
void setDefaultButton(QMessageBox::StandardButton button);
96
* Display a modal dialog with a list of items.
98
* @param parent parent widget
99
* @param title dialog title
100
* @param text dialog text
101
* @param list list of items
102
* @param buttons buttons shown
104
* @return QMessageBox::Ok or QMessageBox::Cancel.
106
static int warningList(QWidget* parent, const QString& title,
107
const QString& text, const QStringList& list,
108
QMessageBox::StandardButtons buttons =
109
QMessageBox::Ok | QMessageBox::Cancel);
113
* Called when a button is clicked.
115
* @param button button which was clicked
117
void buttonClicked(QAbstractButton* button);
122
QTextEdit* m_textEdit;
123
QDialogButtonBox* m_buttonBox;
125
#else // !CONFIG_USE_KDE
127
// Just to suppress moc "No relevant classes found" warning.
128
class MessageDialog : public QDialog {
132
#endif // !CONFIG_USE_KDE
134
#endif // MESSAGEDIALOG_H