pollymc/launcher/ui/pages/modplatform/modrinth/ModrinthPage.h
flow 2d68308d49
refactor: move url creation for mods to modplatform/
Moves all things related to creating the URLs of the mod platforms
that go to network tasks to a single place, so that:

1. Maintaining and fixing eventual issues is more straightforward.
2. Makes it possible to factor out more common code between the
   different modplatform pages
2022-03-02 23:13:04 -03:00

31 lines
970 B
C++

#pragma once
#include "ui/pages/modplatform/ModPage.h"
#include "modplatform/modrinth/ModrinthAPI.h"
class ModrinthPage : public ModPage {
Q_OBJECT
public:
explicit ModrinthPage(ModDownloadDialog* dialog, BaseInstance* instance);
virtual ~ModrinthPage() = default;
inline QString displayName() const override { return tr("Modrinth"); }
inline QIcon icon() const override { return APPLICATION->getThemedIcon("modrinth"); }
inline QString id() const override { return "modrinth"; }
inline QString helpPage() const override { return "Modrinth-platform"; }
inline QString debugName() const override { return tr("Modrinth"); }
inline QString metaEntryBase() const override { return "ModrinthPacks"; };
bool shouldDisplay() const override;
const ModAPI* apiProvider() const override { return &api; };
private:
void onModVersionSucceed(ModPage*, QByteArray*, QString) override;
private:
ModrinthAPI api;
};