summaryrefslogtreecommitdiffstats
path: root/gui/MainWindow.cpp
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/MainWindow.cpp
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/MainWindow.cpp')
-rw-r--r--gui/MainWindow.cpp23
1 files changed, 3 insertions, 20 deletions
diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp
index 17d4630b..65db066b 100644
--- a/gui/MainWindow.cpp
+++ b/gui/MainWindow.cpp
@@ -62,6 +62,7 @@
#include "gui/dialogs/UpdateDialog.h"
#include "gui/dialogs/EditAccountDialog.h"
#include "gui/dialogs/ScreenshotDialog.h"
+#include "gui/dialogs/NotificationDialog.h"
#include "gui/ConsoleWindow.h"
@@ -673,26 +674,8 @@ void MainWindow::notificationsChanged()
NotificationChecker::NotificationEntry entry = *it;
if (!shownNotifications.contains(entry.id) && entry.applies())
{
- QMessageBox::Icon icon;
- switch (entry.type)
- {
- case NotificationChecker::NotificationEntry::Critical:
- icon = QMessageBox::Critical;
- break;
- case NotificationChecker::NotificationEntry::Warning:
- icon = QMessageBox::Warning;
- break;
- case NotificationChecker::NotificationEntry::Information:
- icon = QMessageBox::Information;
- break;
- }
-
- QMessageBox box(icon, tr("Notification"), entry.message, QMessageBox::Close, this);
- QPushButton *dontShowAgainButton =
- box.addButton(tr("Don't show again"), QMessageBox::AcceptRole);
- box.setDefaultButton(QMessageBox::Close);
- box.exec();
- if (box.clickedButton() == dontShowAgainButton)
+ NotificationDialog dialog(entry, this);
+ if (dialog.exec() == NotificationDialog::DontShowAgain)
{
shownNotifications.append(entry.id);
}