aboutsummaryrefslogtreecommitdiff
path: root/logic/updater/NotificationChecker.h
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2014-01-05 00:14:10 +0000
committerSky <git@bunnies.cc>2014-01-05 00:14:10 +0000
commit7d5fb1e99be24a884a69f3cf521aee8e310e2a6e (patch)
tree51d25c7f760eef471de31bf5b1a1e563e87def3c /logic/updater/NotificationChecker.h
parent79158144df1b606982bfa722447416c9549de860 (diff)
parente558584af0e6a168d76868e89d132aeebd0aa36a (diff)
downloadPrismLauncher-7d5fb1e99be24a884a69f3cf521aee8e310e2a6e.tar.gz
PrismLauncher-7d5fb1e99be24a884a69f3cf521aee8e310e2a6e.tar.bz2
PrismLauncher-7d5fb1e99be24a884a69f3cf521aee8e310e2a6e.zip
Merge branch 'develop' of github.com:MultiMC/MultiMC5 into develop
Diffstat (limited to 'logic/updater/NotificationChecker.h')
-rw-r--r--logic/updater/NotificationChecker.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/logic/updater/NotificationChecker.h b/logic/updater/NotificationChecker.h
new file mode 100644
index 00000000..20541757
--- /dev/null
+++ b/logic/updater/NotificationChecker.h
@@ -0,0 +1,54 @@
+#pragma once
+
+#include <QObject>
+
+#include "logic/net/NetJob.h"
+#include "logic/net/CacheDownload.h"
+
+class NotificationChecker : public QObject
+{
+ Q_OBJECT
+
+public:
+ explicit NotificationChecker(QObject *parent = 0);
+
+ QUrl notificationsUrl() const;
+ void setNotificationsUrl(const QUrl &notificationsUrl);
+
+ struct NotificationEntry
+ {
+ int id;
+ QString message;
+ enum
+ {
+ Critical,
+ Warning,
+ Information
+ } type;
+ QString channel;
+ QString buildtype;
+ QString from;
+ QString to;
+ bool applies() const;
+ static bool versionLessThan(const QString &v1, const QString &v2);
+ };
+
+ QList<NotificationEntry> notificationEntries() const;
+
+public
+slots:
+ void checkForNotifications();
+
+private
+slots:
+ void downloadSucceeded(int);
+
+signals:
+ void notificationCheckFinished();
+
+private:
+ QList<NotificationEntry> m_entries;
+ QUrl m_notificationsUrl;
+ NetJobPtr m_checkJob;
+ CacheDownloadPtr m_download;
+};