summaryrefslogtreecommitdiff
path: root/src/libs/utils
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2013-09-13 16:12:04 +0200
committerhjk <hjk121@nokiamail.com>2013-09-13 16:24:30 +0200
commit3bdc50d1b1d24a87a6825f270e2d3cb9df5e2089 (patch)
tree13043697992869e3f5d7d62951a8d75bd68fc6fa /src/libs/utils
parentf29ce3d9b96f859c148b4c0c35ebefb9bab27364 (diff)
downloadqt-creator-3bdc50d1b1d24a87a6825f270e2d3cb9df5e2089.tar.gz
Fix break point warning dialog
QMessageBox apparently only saves the state in the actual QMessageBox instance ... anyhow, it's the only place in QtCreator where we use QMessageBox, which makes it look somewhat alien. Instead, use CheckableMessageBox and extend it for an information dialog. Task-number: QTCREATORBUG-9876 Change-Id: I8014e972943dd4a336952325ebb9f6cbc5dd0902 Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/libs/utils')
-rw-r--r--src/libs/utils/checkablemessagebox.cpp22
-rw-r--r--src/libs/utils/checkablemessagebox.h9
2 files changed, 31 insertions, 0 deletions
diff --git a/src/libs/utils/checkablemessagebox.cpp b/src/libs/utils/checkablemessagebox.cpp
index 5b455e19d9..3d6523a09b 100644
--- a/src/libs/utils/checkablemessagebox.cpp
+++ b/src/libs/utils/checkablemessagebox.cpp
@@ -256,6 +256,28 @@ CheckableMessageBox::question(QWidget *parent,
return mb.clickedStandardButton();
}
+QDialogButtonBox::StandardButton
+CheckableMessageBox::information(QWidget *parent,
+ const QString &title,
+ const QString &text,
+ const QString &checkBoxText,
+ bool *checkBoxSetting,
+ QDialogButtonBox::StandardButtons buttons,
+ QDialogButtonBox::StandardButton defaultButton)
+{
+ CheckableMessageBox mb(parent);
+ mb.setWindowTitle(title);
+ mb.setIconPixmap(QMessageBox::standardIcon(QMessageBox::Information));
+ mb.setText(text);
+ mb.setCheckBoxText(checkBoxText);
+ mb.setChecked(*checkBoxSetting);
+ mb.setStandardButtons(buttons);
+ mb.setDefaultButton(defaultButton);
+ mb.exec();
+ *checkBoxSetting = mb.isChecked();
+ return mb.clickedStandardButton();
+}
+
QMessageBox::StandardButton CheckableMessageBox::dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton db)
{
return static_cast<QMessageBox::StandardButton>(int(db));
diff --git a/src/libs/utils/checkablemessagebox.h b/src/libs/utils/checkablemessagebox.h
index ced2847a1c..42756a4d49 100644
--- a/src/libs/utils/checkablemessagebox.h
+++ b/src/libs/utils/checkablemessagebox.h
@@ -62,6 +62,15 @@ public:
QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Yes|QDialogButtonBox::No,
QDialogButtonBox::StandardButton defaultButton = QDialogButtonBox::No);
+ 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);
+
QString text() const;
void setText(const QString &);