ada5e88eb9
This extends the resource pack downloader, with the custom behavior of filtering the versions that shows up, to those <= 1.6. As always, Flame is funky and requires a bit more workarounds than average. This will also get a nice improvement when the Version parsing and comparison PR gets merged! :D Signed-off-by: flow <flowlnlnln@gmail.com>
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include "ui/pages/modplatform/ResourcePage.h"
|
|
#include "ui/pages/modplatform/ResourcePackModel.h"
|
|
|
|
namespace Ui {
|
|
class ResourcePage;
|
|
}
|
|
|
|
namespace ResourceDownload {
|
|
|
|
class ResourcePackDownloadDialog;
|
|
|
|
class ResourcePackResourcePage : public ResourcePage {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
template <typename T>
|
|
static T* create(ResourcePackDownloadDialog* dialog, BaseInstance& instance)
|
|
{
|
|
auto page = new T(dialog, instance);
|
|
auto model = static_cast<ResourcePackResourceModel*>(page->getModel());
|
|
|
|
connect(model, &ResourceModel::versionListUpdated, page, &ResourcePage::updateVersionList);
|
|
connect(model, &ResourceModel::projectInfoUpdated, page, &ResourcePage::updateUi);
|
|
|
|
return page;
|
|
}
|
|
|
|
~ResourcePackResourcePage() override = default;
|
|
|
|
//: The plural version of 'resource pack'
|
|
[[nodiscard]] inline QString resourcesString() const override { return tr("resource packs"); }
|
|
//: The singular version of 'resource packs'
|
|
[[nodiscard]] inline QString resourceString() const override { return tr("resource pack"); }
|
|
|
|
[[nodiscard]] bool supportsFiltering() const override { return false; };
|
|
|
|
[[nodiscard]] QMap<QString, QString> urlHandlers() const override;
|
|
|
|
protected:
|
|
ResourcePackResourcePage(ResourceDownloadDialog* dialog, BaseInstance& instance);
|
|
|
|
protected slots:
|
|
void triggerSearch() override;
|
|
};
|
|
|
|
} // namespace ResourceDownload
|