aboutsummaryrefslogtreecommitdiff
path: root/VMProtect/message_dialog.h
diff options
context:
space:
mode:
Diffstat (limited to 'VMProtect/message_dialog.h')
-rw-r--r--VMProtect/message_dialog.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/VMProtect/message_dialog.h b/VMProtect/message_dialog.h
new file mode 100644
index 0000000..520fc00
--- /dev/null
+++ b/VMProtect/message_dialog.h
@@ -0,0 +1,31 @@
+#ifndef MESSAGE_DIALOG_H
+#define MESSAGE_DIALOG_H
+
+class MessageDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ MessageDialog(QMessageBox::Icon icon, const QString &text,
+ QMessageBox::StandardButtons buttons = QMessageBox::NoButton, QWidget *parent = 0);
+ static QMessageBox::StandardButton information(QWidget *parent,
+ const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
+ static QMessageBox::StandardButton question(QWidget *parent,
+ const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
+ static QMessageBox::StandardButton warning(QWidget *parent,
+ const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
+ static QMessageBox::StandardButton critical(QWidget *parent,
+ const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
+ QAbstractButton *clickedButton() const { return clickedButton_; }
+ void setDefaultButton(QPushButton *button);
+ QAbstractButton *defaultButton() const { return defaultButton_; }
+private slots:
+ void buttonClicked(QAbstractButton *button);
+private:
+ static QMessageBox::StandardButton showMessageBox(QWidget *parent, QMessageBox::Icon icon,
+ const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton);
+ QDialogButtonBox *buttonBox_;
+ QAbstractButton *clickedButton_;
+ QAbstractButton *defaultButton_;
+};
+
+#endif \ No newline at end of file