aboutsummaryrefslogtreecommitdiff
path: root/logic/status/StatusChecker.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2014-01-12 22:34:53 +0100
committerPetr Mrázek <peterix@gmail.com>2014-01-12 22:34:53 +0100
commitf552366e03cd6bd693850e24503bf3bf3559cfd0 (patch)
tree7ac1fc527254522d4f1d6308ccc64f3b5e85843b /logic/status/StatusChecker.h
parentb589a12d1765f8df616779c53e614adef2e4c48e (diff)
parent398167e8b01732badaa2c757b1547e879a369945 (diff)
downloadPrismLauncher-f552366e03cd6bd693850e24503bf3bf3559cfd0.tar.gz
PrismLauncher-f552366e03cd6bd693850e24503bf3bf3559cfd0.tar.bz2
PrismLauncher-f552366e03cd6bd693850e24503bf3bf3559cfd0.zip
Merge branch 'feature_mojang_status' into develop
Diffstat (limited to 'logic/status/StatusChecker.h')
-rw-r--r--logic/status/StatusChecker.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/logic/status/StatusChecker.h b/logic/status/StatusChecker.h
new file mode 100644
index 00000000..1cb01836
--- /dev/null
+++ b/logic/status/StatusChecker.h
@@ -0,0 +1,57 @@
+/* Copyright 2013 MultiMC Contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <QObject>
+#include <QString>
+#include <QList>
+
+#include <logic/net/NetJob.h>
+
+class StatusChecker : public QObject
+{
+ Q_OBJECT
+public:
+ StatusChecker();
+
+ QString getLastLoadErrorMsg() const;
+
+ bool isStatusLoaded() const;
+
+ bool isLoadingStatus() const;
+
+ QMap<QString, QString> getStatusEntries() const;
+
+ void Q_SLOT reloadStatus();
+
+signals:
+ void statusLoaded();
+ void statusLoadingFailed(QString errorMsg);
+
+protected slots:
+ void statusDownloadFinished();
+ void statusDownloadFailed();
+
+protected:
+ QMap<QString, QString> m_statusEntries;
+ NetJobPtr m_statusNetJob;
+ bool m_loadedStatus;
+ QString m_lastLoadError;
+
+ void Q_SLOT succeed();
+ void Q_SLOT fail(const QString& errorMsg);
+};
+