summaryrefslogtreecommitdiffstats
path: root/api/logic/modplatform/FtbPackInstallTask.h
diff options
context:
space:
mode:
authorJanrupf <werbung.janrupf@t-online.de>2018-02-28 19:42:30 +0100
committerJanrupf <werbung.janrupf@t-online.de>2018-02-28 19:43:56 +0100
commitab3fe74c97158fd0f979c15a0d1b0f7eb9976e7d (patch)
treef37e1c28160f882dd8f224788a985370832d6814 /api/logic/modplatform/FtbPackInstallTask.h
parent1a43f2829743cb88ace3f650d3e060725990c1f1 (diff)
downloadMultiMC-ab3fe74c97158fd0f979c15a0d1b0f7eb9976e7d.tar
MultiMC-ab3fe74c97158fd0f979c15a0d1b0f7eb9976e7d.tar.gz
MultiMC-ab3fe74c97158fd0f979c15a0d1b0f7eb9976e7d.tar.lz
MultiMC-ab3fe74c97158fd0f979c15a0d1b0f7eb9976e7d.tar.xz
MultiMC-ab3fe74c97158fd0f979c15a0d1b0f7eb9976e7d.zip
Added FTB pack selection ad download, WIP
Diffstat (limited to 'api/logic/modplatform/FtbPackInstallTask.h')
-rw-r--r--api/logic/modplatform/FtbPackInstallTask.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/api/logic/modplatform/FtbPackInstallTask.h b/api/logic/modplatform/FtbPackInstallTask.h
new file mode 100644
index 00000000..23ef0811
--- /dev/null
+++ b/api/logic/modplatform/FtbPackInstallTask.h
@@ -0,0 +1,45 @@
+#pragma once
+#include "tasks/Task.h"
+#include "modplatform/FtbPackDownloader.h"
+#include "BaseInstanceProvider.h"
+#include "net/NetJob.h"
+#include "quazip.h"
+#include "quazipdir.h"
+
+class MULTIMC_LOGIC_EXPORT FtbPackInstallTask : public Task {
+
+ Q_OBJECT
+
+public:
+ explicit FtbPackInstallTask(FtbPackDownloader *downloader, SettingsObjectPtr settings, const QString & stagingPath, const QString &instName,
+ const QString &instIcon, const QString &instGroup);
+
+protected:
+ //! Entry point for tasks.
+ virtual void executeTask() override;
+
+private: /* data */
+ SettingsObjectPtr m_globalSettings;
+ QString m_stagingPath;
+ QString m_instName;
+ QString m_instIcon;
+ QString m_instGroup;
+ NetJobPtr m_netJobPtr;
+ FtbPackDownloader *m_downloader = nullptr;
+
+ std::unique_ptr<QuaZip> m_packZip;
+ QFuture<QStringList> m_extractFuture;
+ QFutureWatcher<QStringList> m_extractFutureWatcher;
+
+ void downloadPack();
+ void unzip(QString archivePath);
+ void install();
+
+private slots:
+ void onDownloadSucceeded(QString archivePath);
+ void onDownloadFailed(QString reason);
+ void onDownloadProgress(qint64 current, qint64 total);
+
+ void onUnzipFinished();
+ void onUnzipCanceled();
+};