18 #ifndef CHECKABLEMESSAGEBOX_H
19 #define CHECKABLEMESSAGEBOX_H
21 #include <qcompilerdetection.h>
23 #include <QDialogButtonBox>
25 #include <QMessageBox>
26 #include <QMetaObject>
53 static QDialogButtonBox::StandardButton
58 bool *checkBoxSetting,
59 QDialogButtonBox::StandardButtons
buttons = QDialogButtonBox::Yes|QDialogButtonBox::No,
60 QDialogButtonBox::StandardButton
defaultButton = QDialogButtonBox::No);
62 static QDialogButtonBox::StandardButton
67 bool *checkBoxSetting,
68 QDialogButtonBox::StandardButtons
buttons = QDialogButtonBox::Ok,
69 QDialogButtonBox::StandardButton
defaultButton = QDialogButtonBox::NoButton);
71 static QDialogButtonBox::StandardButton
76 const QString &settingsSubKey,
77 QDialogButtonBox::StandardButtons
buttons = QDialogButtonBox::Yes|QDialogButtonBox::No,
78 QDialogButtonBox::StandardButton
defaultButton = QDialogButtonBox::No,
79 QDialogButtonBox::StandardButton acceptButton = QDialogButtonBox::Yes);
81 static QDialogButtonBox::StandardButton
86 const QString &settingsSubKey,
87 QDialogButtonBox::StandardButtons
buttons = QDialogButtonBox::Ok,
88 QDialogButtonBox::StandardButton
defaultButton = QDialogButtonBox::NoButton);
104 QPushButton *
button(QDialogButtonBox::StandardButton b)
const;
105 QPushButton *
addButton(
const QString &
text, QDialogButtonBox::ButtonRole role);
133 static bool askAgain(QSettings *settings,
const QString &settingsSubKey);
135 const QString &
text, QDialogButtonBox::StandardButtons
buttons,
138 static void doNotAskAgain(QSettings *settings,
const QString &settingsSubKey);
The CheckableMessageBox class implements a message box suitable for questions with a "Do not ask me a...
static QDialogButtonBox::StandardButton doNotAskAgainQuestion(QWidget *parent, const QString &title, const QString &text, QSettings *settings, const QString &settingsSubKey, QDialogButtonBox::StandardButtons buttons=QDialogButtonBox::Yes|QDialogButtonBox::No, QDialogButtonBox::StandardButton defaultButton=QDialogButtonBox::No, QDialogButtonBox::StandardButton acceptButton=QDialogButtonBox::Yes)
Shows a message box with given title and text, and a \gui {Do not ask again} check box.
static QMessageBox::StandardButton dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton)
static QString msgDoNotShowAgain()
Returns the standard \gui {Do not show again} check box text.
CheckableMessageBoxPrivate * d
QDialogButtonBox::StandardButtons buttons
QPushButton * button(QDialogButtonBox::StandardButton b) const
virtual ~CheckableMessageBox() Q_DECL_OVERRIDE
void setStandardButtons(QDialogButtonBox::StandardButtons s)
void slotClicked(QAbstractButton *b)
static void doNotAskAgain(QSettings *settings, const QString &settingsSubKey)
static void resetAllDoNotAskAgainQuestions(QSettings *settings)
Resets all suppression settings for doNotAskAgainQuestion() found in settings, so all these message b...
QDialogButtonBox::StandardButton clickedStandardButton() const
static QDialogButtonBox::StandardButton doNotShowAgainInformation(QWidget *parent, const QString &title, const QString &text, QSettings *settings, const QString &settingsSubKey, QDialogButtonBox::StandardButtons buttons=QDialogButtonBox::Ok, QDialogButtonBox::StandardButton defaultButton=QDialogButtonBox::NoButton)
Shows a message box with given title and text, and a \gui {Do not show again} check box.
void setCheckBoxText(const QString &)
static void initDoNotAskAgainMessageBox(CheckableMessageBox &messageBox, const QString &title, const QString &text, QDialogButtonBox::StandardButtons buttons, QDialogButtonBox::StandardButton defaultButton, DoNotAskAgainType type)
static bool hasSuppressedQuestions(QSettings *settings)
Returns whether any message boxes from doNotAskAgainQuestion() are suppressed in the settings.
void setText(const QString &)
void setCheckBoxVisible(bool)
static bool askAgain(QSettings *settings, const QString &settingsSubKey)
CheckableMessageBox(QWidget *parent)
bool isCheckBoxVisible() const
void setIconPixmap(const QPixmap &p)
static QString msgDoNotAskAgain()
Returns the standard \gui {Do not ask again} check box text.
QDialogButtonBox::StandardButtons standardButtons() const
static QDialogButtonBox::StandardButton question(QWidget *parent, const QString &title, const QString &question, const QString &checkBoxText, bool *checkBoxSetting, QDialogButtonBox::StandardButtons buttons=QDialogButtonBox::Yes|QDialogButtonBox::No, QDialogButtonBox::StandardButton defaultButton=QDialogButtonBox::No)
QDialogButtonBox::StandardButton defaultButton
QPushButton * addButton(const QString &text, QDialogButtonBox::ButtonRole role)
QAbstractButton * clickedButton() const
void setDefaultButton(QDialogButtonBox::StandardButton s)
static QDialogButtonBox::StandardButton information(QWidget *parent, const QString &title, const QString &text, const QString &checkBoxText, bool *checkBoxSetting, QDialogButtonBox::StandardButtons buttons=QDialogButtonBox::Ok, QDialogButtonBox::StandardButton defaultButton=QDialogButtonBox::NoButton)