Refator task to work with multiple providers
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
		| @@ -25,7 +25,9 @@ | ||||
| #include <QLayout> | ||||
|  | ||||
| #include "QObjectPtr.h" | ||||
| #include "minecraft/mod/tasks/GetModDependenciesTask.h" | ||||
| #include "modplatform/ModIndex.h" | ||||
| #include "tasks/Task.h" | ||||
| #include "ui/pages/BasePageProvider.h" | ||||
|  | ||||
| class BaseInstance; | ||||
| @@ -80,6 +82,8 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider { | ||||
|    protected: | ||||
|     [[nodiscard]] virtual QString geometrySaveKey() const { return ""; } | ||||
|  | ||||
|     [[nodiscard]] virtual GetModDependenciesTask::Ptr getModDependenciesTask() { return nullptr; } | ||||
|  | ||||
|    protected: | ||||
|     const std::shared_ptr<ResourceFolderModel> m_base_model; | ||||
|  | ||||
| @@ -92,8 +96,6 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider { | ||||
|     QHash<QString, DownloadTaskPtr> m_selected; | ||||
| }; | ||||
|  | ||||
|  | ||||
|  | ||||
| class ModDownloadDialog final : public ResourceDownloadDialog { | ||||
|     Q_OBJECT | ||||
|  | ||||
| @@ -106,6 +108,7 @@ class ModDownloadDialog final : public ResourceDownloadDialog { | ||||
|     [[nodiscard]] QString geometrySaveKey() const override { return "ModDownloadGeometry"; } | ||||
|  | ||||
|     QList<BasePage*> getPages() override; | ||||
|     GetModDependenciesTask::Ptr getModDependenciesTask() override; | ||||
|  | ||||
|    private: | ||||
|     BaseInstance* m_instance; | ||||
| @@ -135,8 +138,8 @@ class TexturePackDownloadDialog final : public ResourceDownloadDialog { | ||||
|  | ||||
|    public: | ||||
|     explicit TexturePackDownloadDialog(QWidget* parent, | ||||
|                                         const std::shared_ptr<TexturePackFolderModel>& resource_packs, | ||||
|                                         BaseInstance* instance); | ||||
|                                        const std::shared_ptr<TexturePackFolderModel>& resource_packs, | ||||
|                                        BaseInstance* instance); | ||||
|     ~TexturePackDownloadDialog() override = default; | ||||
|  | ||||
|     //: String that gets appended to the texture pack download dialog title ("Download " + resourcesString()) | ||||
| @@ -153,9 +156,7 @@ class ShaderPackDownloadDialog final : public ResourceDownloadDialog { | ||||
|     Q_OBJECT | ||||
|  | ||||
|    public: | ||||
|     explicit ShaderPackDownloadDialog(QWidget* parent, | ||||
|                                       const std::shared_ptr<ShaderPackFolderModel>& shader_packs, | ||||
|                                       BaseInstance* instance); | ||||
|     explicit ShaderPackDownloadDialog(QWidget* parent, const std::shared_ptr<ShaderPackFolderModel>& shader_packs, BaseInstance* instance); | ||||
|     ~ShaderPackDownloadDialog() override = default; | ||||
|  | ||||
|     //: String that gets appended to the shader pack download dialog title ("Download " + resourcesString()) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Trial97
					Trial97