summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/NotificationDialog.h
diff options
context:
space:
mode:
authorJan Dalheimer <jan@dalheimer.de>2014-03-15 14:18:29 +0100
committerJan Dalheimer <jan@dalheimer.de>2014-03-15 14:18:29 +0100
commit4f452d5815e14043f3c0977673bf338491032520 (patch)
treeaedccbef29aeb0eb4bb586d50d77f1949e18ab97 /gui/dialogs/NotificationDialog.h
parentde2eb3fc5404cbbfd438919c250885e5e8450a82 (diff)
downloadMultiMC-4f452d5815e14043f3c0977673bf338491032520.tar
MultiMC-4f452d5815e14043f3c0977673bf338491032520.tar.gz
MultiMC-4f452d5815e14043f3c0977673bf338491032520.tar.lz
MultiMC-4f452d5815e14043f3c0977673bf338491032520.tar.xz
MultiMC-4f452d5815e14043f3c0977673bf338491032520.zip
Add a timer for clicking away the notification dialog
Diffstat (limited to 'gui/dialogs/NotificationDialog.h')
-rw-r--r--gui/dialogs/NotificationDialog.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/gui/dialogs/NotificationDialog.h b/gui/dialogs/NotificationDialog.h
new file mode 100644
index 00000000..b7980a98
--- /dev/null
+++ b/gui/dialogs/NotificationDialog.h
@@ -0,0 +1,44 @@
+#ifndef NOTIFICATIONDIALOG_H
+#define NOTIFICATIONDIALOG_H
+
+#include <QDialog>
+
+#include "logic/updater/NotificationChecker.h"
+
+namespace Ui {
+class NotificationDialog;
+}
+
+class NotificationDialog : public QDialog
+{
+ Q_OBJECT
+
+public:
+ explicit NotificationDialog(const NotificationChecker::NotificationEntry &entry, QWidget *parent = 0);
+ ~NotificationDialog();
+
+ enum ExitCode
+ {
+ Normal,
+ DontShowAgain
+ };
+
+protected:
+ void timerEvent(QTimerEvent *event);
+
+private:
+ Ui::NotificationDialog *ui;
+
+ int m_dontShowAgainTime = 10;
+ int m_closeTime = 5;
+
+ QString m_dontShowAgainText;
+ QString m_closeText;
+
+private
+slots:
+ void on_dontShowAgainBtn_clicked();
+ void on_closeBtn_clicked();
+};
+
+#endif // NOTIFICATIONDIALOG_H