aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/modplatform/flame/FlameModPage.h
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/pages/modplatform/flame/FlameModPage.h')
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameModPage.h72
1 files changed, 14 insertions, 58 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlameModPage.h b/launcher/ui/pages/modplatform/flame/FlameModPage.h
index 24dfcbc7..2daa155f 100644
--- a/launcher/ui/pages/modplatform/flame/FlameModPage.h
+++ b/launcher/ui/pages/modplatform/flame/FlameModPage.h
@@ -1,68 +1,24 @@
#pragma once
-#include <QWidget>
+#include "ui/pages/modplatform/ModPage.h"
-#include "ui/pages/BasePage.h"
-#include <Application.h>
-#include "tasks/Task.h"
-#include "modplatform/flame/FlameModIndex.h"
-
-namespace Ui
-{
-class FlameModPage;
-}
-
-class ModDownloadDialog;
-
-namespace FlameMod {
- class ListModel;
-}
-
-class FlameModPage : public QWidget, public BasePage
-{
+class FlameModPage : public ModPage {
Q_OBJECT
-public:
- explicit FlameModPage(ModDownloadDialog *dialog, BaseInstance *instance);
- virtual ~FlameModPage();
- virtual QString displayName() const override
- {
- return tr("CurseForge");
- }
- virtual QIcon icon() const override
- {
- return APPLICATION->getThemedIcon("flame");
- }
- virtual QString id() const override
- {
- return "curseforge";
- }
- virtual QString helpPage() const override
- {
- return "Flame-platform";
- }
- virtual bool shouldDisplay() const override;
-
- void openedImpl() override;
-
- bool eventFilter(QObject * watched, QEvent * event) override;
-
- BaseInstance *m_instance;
+ public:
+ explicit FlameModPage(ModDownloadDialog* dialog, BaseInstance* instance);
+ virtual ~FlameModPage() = default;
-private:
- void updateSelectionButton();
+ inline QString displayName() const override { return tr("CurseForge"); }
+ inline QIcon icon() const override { return APPLICATION->getThemedIcon("flame"); }
+ inline QString id() const override { return "curseforge"; }
+ inline QString helpPage() const override { return "Flame-platform"; }
-private slots:
- void triggerSearch();
- void onSelectionChanged(QModelIndex first, QModelIndex second);
- void onVersionSelectionChanged(QString data);
- void onModSelected();
+ inline QString debugName() const override { return tr("Flame"); }
+ inline QString metaEntryBase() const override { return "FlameMods"; };
-private:
- Ui::FlameModPage *ui = nullptr;
- ModDownloadDialog* dialog = nullptr;
- FlameMod::ListModel* listModel = nullptr;
- ModPlatform::IndexedPack current;
+ bool shouldDisplay() const override;
- int selectedVersion = -1;
+ private:
+ void onModVersionSucceed(ModPage*, QByteArray*, QString) override;
};