2023-01-29 23:40:55 +00:00
|
|
|
// SPDX-FileCopyrightText: 2023 flowln <flowlnlnln@gmail.com>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
|
2022-12-16 23:26:10 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "ui/pages/modplatform/ResourcePackModel.h"
|
2023-08-02 17:35:35 +01:00
|
|
|
#include "ui/pages/modplatform/ResourcePage.h"
|
2022-12-16 23:26:10 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
//: 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:
|
2023-01-29 21:07:49 +00:00
|
|
|
ResourcePackResourcePage(ResourceDownloadDialog* dialog, BaseInstance& instance);
|
2022-12-16 23:26:10 +00:00
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void triggerSearch() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace ResourceDownload
|