aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/modrinth/ModrinthPage.h
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-05-15 11:48:09 +0200
committerGitHub <noreply@github.com>2022-05-15 11:48:09 +0200
commit8e764fc8fb2adcc4c1e7fc9895133fc1a23b2fba (patch)
tree8f43ab1f58a6b0fe35bdc472aae0fa9342e69be0 /launcher/ui/pages/modplatform/modrinth/ModrinthPage.h
parent31988f0529f6c316d6a9ba3e66cf981a807ed710 (diff)
parent4745ed28186f46de60de155826c8f2bfb54f45cb (diff)
downloadPrismLauncher-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.h67
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;
};