diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-05-15 11:48:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-15 11:48:09 +0200 |
commit | 8e764fc8fb2adcc4c1e7fc9895133fc1a23b2fba (patch) | |
tree | 8f43ab1f58a6b0fe35bdc472aae0fa9342e69be0 /launcher/ui/pages/modplatform/modrinth/ModrinthPage.h | |
parent | 31988f0529f6c316d6a9ba3e66cf981a807ed710 (diff) | |
parent | 4745ed28186f46de60de155826c8f2bfb54f45cb (diff) | |
download | PrismLauncher-8e764fc8fb2adcc4c1e7fc9895133fc1a23b2fba.tar.gz PrismLauncher-8e764fc8fb2adcc4c1e7fc9895133fc1a23b2fba.tar.bz2 PrismLauncher-8e764fc8fb2adcc4c1e7fc9895133fc1a23b2fba.zip |
Merge pull request #4 from flowln/modrinth_pack
Diffstat (limited to 'launcher/ui/pages/modplatform/modrinth/ModrinthPage.h')
-rw-r--r-- | launcher/ui/pages/modplatform/modrinth/ModrinthPage.h | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.h b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.h index 562049b4..f72a5071 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.h +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.h @@ -39,48 +39,53 @@ #include "ui/dialogs/NewInstanceDialog.h" #include "ui/pages/BasePage.h" +#include "modplatform/modrinth/ModrinthPackManifest.h" + #include <QWidget> -namespace Ui -{ - class ModrinthPage; +namespace Ui { +class ModrinthPage; +} + +namespace Modrinth { +class ModpackListModel; } -class ModrinthPage : public QWidget, public BasePage -{ +class ModrinthPage : public QWidget, public BasePage { Q_OBJECT -public: - explicit ModrinthPage(NewInstanceDialog *dialog, QWidget *parent = nullptr); + public: + explicit ModrinthPage(NewInstanceDialog* dialog, QWidget* parent = nullptr); ~ModrinthPage() override; - QString displayName() const override - { - return tr("Modrinth"); - } - QIcon icon() const override - { - return APPLICATION->getThemedIcon("modrinth"); - } - QString id() const override - { - return "modrinth"; - } - - virtual QString helpPage() const override - { - return "Modrinth-platform"; - } - void retranslate() override; + QString displayName() const override { return tr("Modrinth"); } + QIcon icon() const override { return APPLICATION->getThemedIcon("modrinth"); } + QString id() const override { return "modrinth"; } + QString helpPage() const override { return "Modrinth-platform"; } - void openedImpl() override; + inline auto debugName() const -> QString { return "Modrinth"; } + inline auto metaEntryBase() const -> QString { return "ModrinthModpacks"; }; - bool eventFilter(QObject *watched, QEvent *event) override; + auto getCurrent() -> Modrinth::Modpack& { return current; } + void suggestCurrent(); -private slots: + void updateUI(); + void updateVersionsUI(); + + void retranslate() override; + void openedImpl() override; + bool eventFilter(QObject* watched, QEvent* event) override; + + private slots: + void onSelectionChanged(QModelIndex first, QModelIndex second); + void onVersionSelectionChanged(QString data); void triggerSearch(); -private: - Ui::ModrinthPage *ui; - NewInstanceDialog *dialog; + private: + Ui::ModrinthPage* ui; + NewInstanceDialog* dialog; + Modrinth::ModpackListModel* m_model; + + Modrinth::Modpack current; + QString selectedVersion; }; |