diff options
author | timoreo <timo.oreo34@gmail.com> | 2022-01-16 11:20:21 +0100 |
---|---|---|
committer | timoreo <timo.oreo34@gmail.com> | 2022-01-16 11:20:21 +0100 |
commit | 975f77756d7ffeb94fb14355b622ee850e04bd8b (patch) | |
tree | 62816cb1f4250852040d82924c006d6645862207 /launcher/ui/pages/modplatform/flame/FlameModPage.h | |
parent | 621e0ba4a887ab4dfdde6a6bba2e1c7b209fb6bc (diff) | |
download | PrismLauncher-975f77756d7ffeb94fb14355b622ee850e04bd8b.tar.gz PrismLauncher-975f77756d7ffeb94fb14355b622ee850e04bd8b.tar.bz2 PrismLauncher-975f77756d7ffeb94fb14355b622ee850e04bd8b.zip |
Added curseforge selection
Diffstat (limited to 'launcher/ui/pages/modplatform/flame/FlameModPage.h')
-rw-r--r-- | launcher/ui/pages/modplatform/flame/FlameModPage.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/launcher/ui/pages/modplatform/flame/FlameModPage.h b/launcher/ui/pages/modplatform/flame/FlameModPage.h new file mode 100644 index 00000000..85c68620 --- /dev/null +++ b/launcher/ui/pages/modplatform/flame/FlameModPage.h @@ -0,0 +1,67 @@ +#pragma once + +#include <QWidget> + +#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 +{ + 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; + +private: + void suggestCurrent(); + +private slots: + void triggerSearch(); + void onSelectionChanged(QModelIndex first, QModelIndex second); + void onVersionSelectionChanged(QString data); + +private: + Ui::FlameModPage *ui = nullptr; + ModDownloadDialog* dialog = nullptr; + FlameMod::ListModel* listModel = nullptr; + FlameMod::IndexedPack current; + + QString selectedVersion; +}; |