diff options
author | Petr Mrázek <peterix@gmail.com> | 2019-11-03 23:48:12 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2019-11-03 23:48:12 +0100 |
commit | 47ed2f48d4a118876263f37b9fe2ab8911c2a8fe (patch) | |
tree | 3caa2000d3fe9f57a82757dec2ae138e7474c499 /api/logic/modplatform/legacy_ftb/PackInstallTask.h | |
parent | 0c9340a3d2e32223a9097f95b92b11045aaec845 (diff) | |
download | PrismLauncher-47ed2f48d4a118876263f37b9fe2ab8911c2a8fe.tar.gz PrismLauncher-47ed2f48d4a118876263f37b9fe2ab8911c2a8fe.tar.bz2 PrismLauncher-47ed2f48d4a118876263f37b9fe2ab8911c2a8fe.zip |
NOISSUE put legacy FTB support in a namespace, fix its base URL
Diffstat (limited to 'api/logic/modplatform/legacy_ftb/PackInstallTask.h')
-rw-r--r-- | api/logic/modplatform/legacy_ftb/PackInstallTask.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/api/logic/modplatform/legacy_ftb/PackInstallTask.h b/api/logic/modplatform/legacy_ftb/PackInstallTask.h new file mode 100644 index 00000000..1eec1880 --- /dev/null +++ b/api/logic/modplatform/legacy_ftb/PackInstallTask.h @@ -0,0 +1,52 @@ +#pragma once +#include "InstanceTask.h" +#include "net/NetJob.h" +#include "quazip.h" +#include "quazipdir.h" +#include "meta/Index.h" +#include "meta/Version.h" +#include "meta/VersionList.h" +#include "PackHelpers.h" + +namespace LegacyFTB { + +class MULTIMC_LOGIC_EXPORT PackInstallTask : public InstanceTask +{ + Q_OBJECT + +public: + explicit PackInstallTask(Modpack pack, QString version); + virtual ~PackInstallTask(){} + + bool abort() override; + +protected: + //! Entry point for tasks. + virtual void executeTask() override; + +private: + void downloadPack(); + void unzip(); + void install(); + +private slots: + void onDownloadSucceeded(); + void onDownloadFailed(QString reason); + void onDownloadProgress(qint64 current, qint64 total); + + void onUnzipFinished(); + void onUnzipCanceled(); + +private: /* data */ + bool abortable = false; + std::unique_ptr<QuaZip> m_packZip; + QFuture<QStringList> m_extractFuture; + QFutureWatcher<QStringList> m_extractFutureWatcher; + NetJobPtr netJobContainer; + QString archivePath; + + Modpack m_pack; + QString m_version; +}; + +} |