refactor: rename Modrinth classes to ModrinthMod
This commit is contained in:
parent
123ed5bd2e
commit
c6b3eccbdf
@ -782,10 +782,10 @@ SET(LAUNCHER_SOURCES
|
|||||||
ui/pages/modplatform/ImportPage.cpp
|
ui/pages/modplatform/ImportPage.cpp
|
||||||
ui/pages/modplatform/ImportPage.h
|
ui/pages/modplatform/ImportPage.h
|
||||||
|
|
||||||
ui/pages/modplatform/modrinth/ModrinthModel.cpp
|
ui/pages/modplatform/modrinth/ModrinthModModel.cpp
|
||||||
ui/pages/modplatform/modrinth/ModrinthModel.h
|
ui/pages/modplatform/modrinth/ModrinthModModel.h
|
||||||
ui/pages/modplatform/modrinth/ModrinthPage.cpp
|
ui/pages/modplatform/modrinth/ModrinthModPage.cpp
|
||||||
ui/pages/modplatform/modrinth/ModrinthPage.h
|
ui/pages/modplatform/modrinth/ModrinthModPage.h
|
||||||
|
|
||||||
# GUI - dialogs
|
# GUI - dialogs
|
||||||
ui/dialogs/AboutDialog.cpp
|
ui/dialogs/AboutDialog.cpp
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
|
|
||||||
#include "ui/widgets/PageContainer.h"
|
#include "ui/widgets/PageContainer.h"
|
||||||
#include "ui/pages/modplatform/modrinth/ModrinthPage.h"
|
#include "ui/pages/modplatform/modrinth/ModrinthModPage.h"
|
||||||
#include "ModDownloadTask.h"
|
#include "ModDownloadTask.h"
|
||||||
|
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ void ModDownloadDialog::accept()
|
|||||||
|
|
||||||
QList<BasePage *> ModDownloadDialog::getPages()
|
QList<BasePage *> ModDownloadDialog::getPages()
|
||||||
{
|
{
|
||||||
modrinthPage = new ModrinthPage(this, m_instance);
|
modrinthPage = new ModrinthModPage(this, m_instance);
|
||||||
flameModPage = new FlameModPage(this, m_instance);
|
flameModPage = new FlameModPage(this, m_instance);
|
||||||
return
|
return
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ class ModDownloadDialog;
|
|||||||
|
|
||||||
class PageContainer;
|
class PageContainer;
|
||||||
class QDialogButtonBox;
|
class QDialogButtonBox;
|
||||||
class ModrinthPage;
|
class ModrinthModPage;
|
||||||
|
|
||||||
class ModDownloadDialog : public QDialog, public BasePageProvider
|
class ModDownloadDialog : public QDialog, public BasePageProvider
|
||||||
{
|
{
|
||||||
@ -50,7 +50,7 @@ private:
|
|||||||
QVBoxLayout *m_verticalLayout = nullptr;
|
QVBoxLayout *m_verticalLayout = nullptr;
|
||||||
|
|
||||||
|
|
||||||
ModrinthPage *modrinthPage = nullptr;
|
ModrinthModPage *modrinthPage = nullptr;
|
||||||
FlameModPage *flameModPage = nullptr;
|
FlameModPage *flameModPage = nullptr;
|
||||||
QHash<QString, ModDownloadTask*> modTask;
|
QHash<QString, ModDownloadTask*> modTask;
|
||||||
BaseInstance *m_instance;
|
BaseInstance *m_instance;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ModrinthModel.h"
|
#include "ModrinthModModel.h"
|
||||||
|
|
||||||
#include "modplatform/modrinth/ModrinthPackIndex.h"
|
#include "modplatform/modrinth/ModrinthPackIndex.h"
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ModrinthPage.h"
|
#include "ModrinthModPage.h"
|
||||||
|
|
||||||
namespace Modrinth {
|
namespace Modrinth {
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ class ListModel : public ModPlatform::ListModel {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ListModel(ModrinthPage* parent) : ModPlatform::ListModel(parent){};
|
ListModel(ModrinthModPage* parent) : ModPlatform::ListModel(parent){};
|
||||||
~ListModel() override = default;
|
~ListModel() override = default;
|
||||||
|
|
||||||
private:
|
private:
|
@ -33,14 +33,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ModrinthPage.h"
|
#include "ModrinthModPage.h"
|
||||||
#include "modplatform/modrinth/ModrinthAPI.h"
|
#include "modplatform/modrinth/ModrinthAPI.h"
|
||||||
#include "ui_ModPage.h"
|
#include "ui_ModPage.h"
|
||||||
|
|
||||||
#include "ModrinthModel.h"
|
#include "ModrinthModModel.h"
|
||||||
#include "ui/dialogs/ModDownloadDialog.h"
|
#include "ui/dialogs/ModDownloadDialog.h"
|
||||||
|
|
||||||
ModrinthPage::ModrinthPage(ModDownloadDialog* dialog, BaseInstance* instance)
|
ModrinthModPage::ModrinthModPage(ModDownloadDialog* dialog, BaseInstance* instance)
|
||||||
: ModPage(dialog, instance, new ModrinthAPI())
|
: ModPage(dialog, instance, new ModrinthAPI())
|
||||||
{
|
{
|
||||||
listModel = new Modrinth::ListModel(this);
|
listModel = new Modrinth::ListModel(this);
|
||||||
@ -56,12 +56,12 @@ ModrinthPage::ModrinthPage(ModDownloadDialog* dialog, BaseInstance* instance)
|
|||||||
// sometimes Qt just ignores virtual slots and doesn't work as intended it seems,
|
// sometimes Qt just ignores virtual slots and doesn't work as intended it seems,
|
||||||
// so it's best not to connect them in the parent's constructor...
|
// so it's best not to connect them in the parent's constructor...
|
||||||
connect(ui->sortByBox, SIGNAL(currentIndexChanged(int)), this, SLOT(triggerSearch()));
|
connect(ui->sortByBox, SIGNAL(currentIndexChanged(int)), this, SLOT(triggerSearch()));
|
||||||
connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &ModrinthPage::onSelectionChanged);
|
connect(ui->packView->selectionModel(), &QItemSelectionModel::currentChanged, this, &ModrinthModPage::onSelectionChanged);
|
||||||
connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &ModrinthPage::onVersionSelectionChanged);
|
connect(ui->versionSelectionBox, &QComboBox::currentTextChanged, this, &ModrinthModPage::onVersionSelectionChanged);
|
||||||
connect(ui->modSelectionButton, &QPushButton::clicked, this, &ModrinthPage::onModSelected);
|
connect(ui->modSelectionButton, &QPushButton::clicked, this, &ModrinthModPage::onModSelected);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ModrinthPage::validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, ModAPI::ModLoaderType loader) const -> bool
|
auto ModrinthModPage::validateVersion(ModPlatform::IndexedVersion& ver, QString mineVer, ModAPI::ModLoaderType loader) const -> bool
|
||||||
{
|
{
|
||||||
auto loaderStrings = ModrinthAPI::getModLoaderStrings(loader);
|
auto loaderStrings = ModrinthAPI::getModLoaderStrings(loader);
|
||||||
|
|
||||||
@ -79,4 +79,4 @@ auto ModrinthPage::validateVersion(ModPlatform::IndexedVersion& ver, QString min
|
|||||||
// I don't know why, but doing this on the parent class makes it so that
|
// I don't know why, but doing this on the parent class makes it so that
|
||||||
// other mod providers start loading before being selected, at least with
|
// other mod providers start loading before being selected, at least with
|
||||||
// my Qt, so we need to implement this in every derived class...
|
// my Qt, so we need to implement this in every derived class...
|
||||||
auto ModrinthPage::shouldDisplay() const -> bool { return true; }
|
auto ModrinthModPage::shouldDisplay() const -> bool { return true; }
|
@ -40,12 +40,12 @@
|
|||||||
|
|
||||||
#include "modplatform/modrinth/ModrinthAPI.h"
|
#include "modplatform/modrinth/ModrinthAPI.h"
|
||||||
|
|
||||||
class ModrinthPage : public ModPage {
|
class ModrinthModPage : public ModPage {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ModrinthPage(ModDownloadDialog* dialog, BaseInstance* instance);
|
explicit ModrinthModPage(ModDownloadDialog* dialog, BaseInstance* instance);
|
||||||
~ModrinthPage() override = default;
|
~ModrinthModPage() override = default;
|
||||||
|
|
||||||
inline auto displayName() const -> QString override { return "Modrinth"; }
|
inline auto displayName() const -> QString override { return "Modrinth"; }
|
||||||
inline auto icon() const -> QIcon override { return APPLICATION->getThemedIcon("modrinth"); }
|
inline auto icon() const -> QIcon override { return APPLICATION->getThemedIcon("modrinth"); }
|
Loading…
x
Reference in New Issue
Block a user