aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/dialogs/ResourceDownloadDialog.h
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-03-02 10:08:45 +0000
committerGitHub <noreply@github.com>2023-03-02 10:08:45 +0000
commit9265c319a96b3dd5681767c196a397fbbae9164a (patch)
tree2f2602a604d64201f1d626dc8655d6edfa0b3e0d /launcher/ui/dialogs/ResourceDownloadDialog.h
parent9f202caf9356ebaf5fd845210adea5e935d4350f (diff)
parent89255e34bd0651ab226518090667bef92066d80c (diff)
downloadPrismLauncher-9265c319a96b3dd5681767c196a397fbbae9164a.tar.gz
PrismLauncher-9265c319a96b3dd5681767c196a397fbbae9164a.tar.bz2
PrismLauncher-9265c319a96b3dd5681767c196a397fbbae9164a.zip
Merge pull request #788 from flowln/other_resource_downloaders_two
Add resource pack, texture pack and shader pack downloaders
Diffstat (limited to 'launcher/ui/dialogs/ResourceDownloadDialog.h')
-rw-r--r--launcher/ui/dialogs/ResourceDownloadDialog.h60
1 files changed, 60 insertions, 0 deletions
diff --git a/launcher/ui/dialogs/ResourceDownloadDialog.h b/launcher/ui/dialogs/ResourceDownloadDialog.h
index 19843532..5678dc8b 100644
--- a/launcher/ui/dialogs/ResourceDownloadDialog.h
+++ b/launcher/ui/dialogs/ResourceDownloadDialog.h
@@ -35,6 +35,9 @@ class QVBoxLayout;
class QDialogButtonBox;
class ResourceDownloadTask;
class ResourceFolderModel;
+class ResourcePackFolderModel;
+class TexturePackFolderModel;
+class ShaderPackFolderModel;
namespace ResourceDownload {
@@ -108,4 +111,61 @@ class ModDownloadDialog final : public ResourceDownloadDialog {
BaseInstance* m_instance;
};
+class ResourcePackDownloadDialog final : public ResourceDownloadDialog {
+ Q_OBJECT
+
+ public:
+ explicit ResourcePackDownloadDialog(QWidget* parent,
+ const std::shared_ptr<ResourcePackFolderModel>& resource_packs,
+ BaseInstance* instance);
+ ~ResourcePackDownloadDialog() override = default;
+
+ //: String that gets appended to the resource pack download dialog title ("Download " + resourcesString())
+ [[nodiscard]] QString resourcesString() const override { return tr("resource packs"); }
+ [[nodiscard]] QString geometrySaveKey() const override { return "RPDownloadGeometry"; }
+
+ QList<BasePage*> getPages() override;
+
+ private:
+ BaseInstance* m_instance;
+};
+
+class TexturePackDownloadDialog final : public ResourceDownloadDialog {
+ Q_OBJECT
+
+ public:
+ explicit TexturePackDownloadDialog(QWidget* parent,
+ 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())
+ [[nodiscard]] QString resourcesString() const override { return tr("texture packs"); }
+ [[nodiscard]] QString geometrySaveKey() const override { return "TPDownloadGeometry"; }
+
+ QList<BasePage*> getPages() override;
+
+ private:
+ BaseInstance* m_instance;
+};
+
+class ShaderPackDownloadDialog final : public ResourceDownloadDialog {
+ Q_OBJECT
+
+ public:
+ 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())
+ [[nodiscard]] QString resourcesString() const override { return tr("shader packs"); }
+ [[nodiscard]] QString geometrySaveKey() const override { return "ShaderDownloadGeometry"; }
+
+ QList<BasePage*> getPages() override;
+
+ private:
+ BaseInstance* m_instance;
+};
+
} // namespace ResourceDownload