aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/ui/pages')
-rw-r--r--launcher/ui/pages/BasePageContainer.h5
-rw-r--r--launcher/ui/pages/BasePageProvider.h47
-rw-r--r--launcher/ui/pages/global/APIPage.cpp45
-rw-r--r--launcher/ui/pages/global/APIPage.h36
-rw-r--r--launcher/ui/pages/global/AccountListPage.cpp94
-rw-r--r--launcher/ui/pages/global/AccountListPage.h44
-rw-r--r--launcher/ui/pages/global/CustomCommandsPage.cpp20
-rw-r--r--launcher/ui/pages/global/CustomCommandsPage.h35
-rw-r--r--launcher/ui/pages/global/ExternalToolsPage.cpp103
-rw-r--r--launcher/ui/pages/global/ExternalToolsPage.h36
-rw-r--r--launcher/ui/pages/global/JavaPage.cpp44
-rw-r--r--launcher/ui/pages/global/JavaPage.h47
-rw-r--r--launcher/ui/pages/global/LanguagePage.cpp11
-rw-r--r--launcher/ui/pages/global/LanguagePage.h37
-rw-r--r--launcher/ui/pages/global/LauncherPage.cpp97
-rw-r--r--launcher/ui/pages/global/LauncherPage.h49
-rw-r--r--launcher/ui/pages/global/MinecraftPage.cpp6
-rw-r--r--launcher/ui/pages/global/MinecraftPage.h44
-rw-r--r--launcher/ui/pages/global/ProxyPage.cpp21
-rw-r--r--launcher/ui/pages/global/ProxyPage.h44
-rw-r--r--launcher/ui/pages/instance/ExternalResourcesPage.h4
-rw-r--r--launcher/ui/pages/instance/GameOptionsPage.cpp11
-rw-r--r--launcher/ui/pages/instance/GameOptionsPage.h38
-rw-r--r--launcher/ui/pages/instance/InstanceSettingsPage.cpp127
-rw-r--r--launcher/ui/pages/instance/InstanceSettingsPage.h36
-rw-r--r--launcher/ui/pages/instance/LogPage.cpp146
-rw-r--r--launcher/ui/pages/instance/LogPage.h44
-rw-r--r--launcher/ui/pages/instance/NotesPage.cpp5
-rw-r--r--launcher/ui/pages/instance/NotesPage.h35
-rw-r--r--launcher/ui/pages/instance/OtherLogsPage.cpp140
-rw-r--r--launcher/ui/pages/instance/OtherLogsPage.h42
-rw-r--r--launcher/ui/pages/instance/ResourcePackPage.h11
-rw-r--r--launcher/ui/pages/instance/ScreenshotsPage.cpp244
-rw-r--r--launcher/ui/pages/instance/ScreenshotsPage.h58
-rw-r--r--launcher/ui/pages/instance/ServersPage.cpp382
-rw-r--r--launcher/ui/pages/instance/ServersPage.h59
-rw-r--r--launcher/ui/pages/instance/ShaderPackPage.h7
-rw-r--r--launcher/ui/pages/instance/TexturePackPage.h12
-rw-r--r--launcher/ui/pages/instance/WorldListPage.cpp177
-rw-r--r--launcher/ui/pages/instance/WorldListPage.h64
-rw-r--r--launcher/ui/pages/modplatform/CustomPage.cpp83
-rw-r--r--launcher/ui/pages/modplatform/CustomPage.h44
-rw-r--r--launcher/ui/pages/modplatform/ImportPage.cpp66
-rw-r--r--launcher/ui/pages/modplatform/ImportPage.h43
-rw-r--r--launcher/ui/pages/modplatform/ResourcePackPage.cpp6
-rw-r--r--launcher/ui/pages/modplatform/ResourcePackPage.h2
-rw-r--r--launcher/ui/pages/modplatform/TexturePackPage.h5
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlFilterModel.cpp16
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlFilterModel.h16
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp132
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlOptionalModDialog.h37
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlPage.cpp34
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlPage.h46
-rw-r--r--launcher/ui/pages/modplatform/atlauncher/AtlUserInteractionSupportImpl.cpp16
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameModel.cpp8
-rw-r--r--launcher/ui/pages/modplatform/flame/FlamePage.cpp9
-rw-r--r--launcher/ui/pages/modplatform/flame/FlamePage.h46
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameResourcePages.cpp28
-rw-r--r--launcher/ui/pages/modplatform/flame/FlameResourcePages.h29
-rw-r--r--launcher/ui/pages/modplatform/legacy_ftb/ListModel.h49
-rw-r--r--launcher/ui/pages/modplatform/legacy_ftb/Page.cpp147
-rw-r--r--launcher/ui/pages/modplatform/legacy_ftb/Page.h62
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.cpp28
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthModel.h9
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.cpp30
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthResourcePages.h30
-rw-r--r--launcher/ui/pages/modplatform/technic/TechnicData.h2
-rw-r--r--launcher/ui/pages/modplatform/technic/TechnicPage.cpp98
-rw-r--r--launcher/ui/pages/modplatform/technic/TechnicPage.h44
69 files changed, 1393 insertions, 2279 deletions
diff --git a/launcher/ui/pages/BasePageContainer.h b/launcher/ui/pages/BasePageContainer.h
index b41fe12a..b750e827 100644
--- a/launcher/ui/pages/BasePageContainer.h
+++ b/launcher/ui/pages/BasePageContainer.h
@@ -2,9 +2,8 @@
class BasePage;
-class BasePageContainer
-{
-public:
+class BasePageContainer {
+ public:
virtual ~BasePageContainer(){};
virtual bool selectPage(QString pageId) = 0;
virtual BasePage* getPage(QString pageId) { return nullptr; };
diff --git a/launcher/ui/pages/BasePageProvider.h b/launcher/ui/pages/BasePageProvider.h
index 873e8dce..4c3ecd6c 100644
--- a/launcher/ui/pages/BasePageProvider.h
+++ b/launcher/ui/pages/BasePageProvider.h
@@ -15,54 +15,43 @@
#pragma once
-#include "ui/pages/BasePage.h"
-#include <memory>
#include <functional>
+#include <memory>
+#include "ui/pages/BasePage.h"
-class BasePageProvider
-{
-public:
- virtual QList<BasePage *> getPages() = 0;
+class BasePageProvider {
+ public:
+ virtual QList<BasePage*> getPages() = 0;
virtual QString dialogTitle() = 0;
};
-class GenericPageProvider : public BasePageProvider
-{
- typedef std::function<BasePage *()> PageCreator;
-public:
- explicit GenericPageProvider(const QString &dialogTitle)
- : m_dialogTitle(dialogTitle)
- {
- }
+class GenericPageProvider : public BasePageProvider {
+ typedef std::function<BasePage*()> PageCreator;
+
+ public:
+ explicit GenericPageProvider(const QString& dialogTitle) : m_dialogTitle(dialogTitle) {}
virtual ~GenericPageProvider() {}
- QList<BasePage *> getPages() override
+ QList<BasePage*> getPages() override
{
- QList<BasePage *> pages;
- for (PageCreator creator : m_creators)
- {
+ QList<BasePage*> pages;
+ for (PageCreator creator : m_creators) {
pages.append(creator());
}
return pages;
}
QString dialogTitle() override { return m_dialogTitle; }
- void setDialogTitle(const QString &title)
- {
- m_dialogTitle = title;
- }
- void addPageCreator(PageCreator page)
- {
- m_creators.append(page);
- }
+ void setDialogTitle(const QString& title) { m_dialogTitle = title; }
+ void addPageCreator(PageCreator page) { m_creators.append(page); }
- template<typename PageClass>
+ template <typename PageClass>
void addPage()
{
- addPageCreator([](){return new PageClass();});
+ addPageCreator([]() { return new PageClass(); });
}
-private:
+ private:
QList<PageCreator> m_creators;
QString m_dialogTitle;
};
diff --git a/launcher/ui/pages/global/APIPage.cpp b/launcher/ui/pages/global/APIPage.cpp
index 668aa007..82aa76a4 100644
--- a/launcher/ui/pages/global/APIPage.cpp
+++ b/launcher/ui/pages/global/APIPage.cpp
@@ -39,37 +39,30 @@
#include "APIPage.h"
#include "ui_APIPage.h"
-#include <QMessageBox>
#include <QFileDialog>
+#include <QMessageBox>
#include <QRegularExpression>
#include <QStandardPaths>
#include <QTabBar>
#include <QValidator>
#include <QVariant>
-#include "settings/SettingsObject.h"
-#include "tools/BaseProfiler.h"
#include "Application.h"
-#include "net/PasteUpload.h"
#include "BuildConfig.h"
+#include "net/PasteUpload.h"
+#include "settings/SettingsObject.h"
+#include "tools/BaseProfiler.h"
-APIPage::APIPage(QWidget *parent) :
- QWidget(parent),
- ui(new Ui::APIPage)
+APIPage::APIPage(QWidget* parent) : QWidget(parent), ui(new Ui::APIPage)
{
// This is here so you can reorder the entries in the combobox without messing stuff up
- int comboBoxEntries[] = {
- PasteUpload::PasteType::Mclogs,
- PasteUpload::PasteType::NullPointer,
- PasteUpload::PasteType::PasteGG,
- PasteUpload::PasteType::Hastebin
- };
+ int comboBoxEntries[] = { PasteUpload::PasteType::Mclogs, PasteUpload::PasteType::NullPointer, PasteUpload::PasteType::PasteGG,
+ PasteUpload::PasteType::Hastebin };
static QRegularExpression validUrlRegExp("https?://.+");
- static QRegularExpression validMSAClientID(QRegularExpression::anchoredPattern(
- "[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}"));
- static QRegularExpression validFlameKey(QRegularExpression::anchoredPattern(
- "\\$2[ayb]\\$.{56}"));
+ static QRegularExpression validMSAClientID(
+ QRegularExpression::anchoredPattern("[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}"));
+ static QRegularExpression validFlameKey(QRegularExpression::anchoredPattern("\\$2[ayb]\\$.{56}"));
ui->setupUi(this);
@@ -77,7 +70,7 @@ APIPage::APIPage(QWidget *parent) :
ui->pasteTypeComboBox->addItem(PasteUpload::PasteTypes.at(pasteType).name, pasteType);
}
- void (QComboBox::*currentIndexChangedSignal)(int) (&QComboBox::currentIndexChanged);
+ void (QComboBox::*currentIndexChangedSignal)(int)(&QComboBox::currentIndexChanged);
connect(ui->pasteTypeComboBox, currentIndexChangedSignal, this, &APIPage::updateBaseURLPlaceholder);
// This function needs to be called even when the ComboBox's index is still in its default state.
updateBaseURLPlaceholder(ui->pasteTypeComboBox->currentIndex());
@@ -110,12 +103,9 @@ void APIPage::resetBaseURLNote()
void APIPage::updateBaseURLNote(int index)
{
- if (baseURLPasteType == index)
- {
+ if (baseURLPasteType == index) {
ui->baseURLNote->hide();
- }
- else if (!ui->baseURLEntry->text().isEmpty())
- {
+ } else if (!ui->baseURLEntry->text().isEmpty()) {
ui->baseURLNote->show();
}
}
@@ -136,8 +126,7 @@ void APIPage::loadSettings()
ui->baseURLEntry->setText(pastebinURL);
int pasteTypeIndex = ui->pasteTypeComboBox->findData(pasteType);
- if (pasteTypeIndex == -1)
- {
+ if (pasteTypeIndex == -1) {
pasteTypeIndex = ui->pasteTypeComboBox->findData(PasteUpload::PasteType::Mclogs);
ui->baseURLEntry->clear();
}
@@ -167,15 +156,13 @@ void APIPage::applySettings()
s->set("MSAClientIDOverride", msaClientID);
QUrl metaURL(ui->metaURL->text());
// Add required trailing slash
- if (!metaURL.isEmpty() && !metaURL.path().endsWith('/'))
- {
+ if (!metaURL.isEmpty() && !metaURL.path().endsWith('/')) {
QString path = metaURL.path();
path.append('/');
metaURL.setPath(path);
}
// Don't allow HTTP, since meta is basically RCE with all the jar files.
- if(!metaURL.isEmpty() && metaURL.scheme() == "http")
- {
+ if (!metaURL.isEmpty() && metaURL.scheme() == "http") {
metaURL.setScheme("https");
}
diff --git a/launcher/ui/pages/global/APIPage.h b/launcher/ui/pages/global/APIPage.h
index 17e62ae7..8d8f0645 100644
--- a/launcher/ui/pages/global/APIPage.h
+++ b/launcher/ui/pages/global/APIPage.h
@@ -39,41 +39,28 @@
#include <QWidget>
-#include "ui/pages/BasePage.h"
#include <Application.h>
+#include "ui/pages/BasePage.h"
namespace Ui {
class APIPage;
}
-class APIPage : public QWidget, public BasePage
-{
+class APIPage : public QWidget, public BasePage {
Q_OBJECT
-public:
- explicit APIPage(QWidget *parent = 0);
+ public:
+ explicit APIPage(QWidget* parent = 0);
~APIPage();
- QString displayName() const override
- {
- return tr("APIs");
- }
- QIcon icon() const override
- {
- return APPLICATION->getThemedIcon("worlds");
- }
- QString id() const override
- {
- return "apis";
- }
- QString helpPage() const override
- {
- return "APIs";
- }
+ QString displayName() const override { return tr("APIs"); }
+ QIcon icon() const override { return APPLICATION->getThemedIcon("worlds"); }
+ QString id() const override { return "apis"; }
+ QString helpPage() const override { return "APIs"; }
virtual bool apply() override;
void retranslate() override;
-private:
+ private:
int baseURLPasteType;
void resetBaseURLNote();
void updateBaseURLNote(int index);
@@ -81,7 +68,6 @@ private:
void loadSettings();
void applySettings();
-private:
- Ui::APIPage *ui;
+ private:
+ Ui::APIPage* ui;
};
-
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp
index fced5ff4..41e78bf4 100644
--- a/launcher/ui/pages/global/AccountListPage.cpp
+++ b/launcher/ui/pages/global/AccountListPage.cpp
@@ -44,29 +44,27 @@
#include "net/NetJob.h"
-#include "ui/dialogs/ProgressDialog.h"
-#include "ui/dialogs/OfflineLoginDialog.h"
+#include "ui/dialogs/CustomMessageBox.h"
#include "ui/dialogs/LoginDialog.h"
#include "ui/dialogs/MSALoginDialog.h"
-#include "ui/dialogs/CustomMessageBox.h"
+#include "ui/dialogs/OfflineLoginDialog.h"
+#include "ui/dialogs/ProgressDialog.h"
#include "ui/dialogs/SkinUploadDialog.h"
-#include "tasks/Task.h"
#include "minecraft/auth/AccountTask.h"
#include "minecraft/services/SkinDelete.h"
+#include "tasks/Task.h"
#include "Application.h"
#include "BuildConfig.h"
-AccountListPage::AccountListPage(QWidget *parent)
- : QMainWindow(parent), ui(new Ui::AccountListPage)
+AccountListPage::AccountListPage(QWidget* parent) : QMainWindow(parent), ui(new Ui::AccountListPage)
{
ui->setupUi(this);
- ui->listView->setEmptyString(tr(
- "Welcome!\n"
- "If you're new here, you can click the \"Add\" button to add your Mojang or Minecraft account."
- ));
+ ui->listView->setEmptyString(
+ tr("Welcome!\n"
+ "If you're new here, you can click the \"Add\" button to add your Mojang or Minecraft account."));
ui->listView->setEmptyMode(VersionListView::String);
ui->listView->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -82,11 +80,10 @@ AccountListPage::AccountListPage(QWidget *parent)
// Expand the account column
- QItemSelectionModel *selectionModel = ui->listView->selectionModel();
+ QItemSelectionModel* selectionModel = ui->listView->selectionModel();
- connect(selectionModel, &QItemSelectionModel::selectionChanged, [this](const QItemSelection &sel, const QItemSelection &dsel) {
- updateButtonStates();
- });
+ connect(selectionModel, &QItemSelectionModel::selectionChanged,
+ [this](const QItemSelection& sel, const QItemSelection& dsel) { updateButtonStates(); });
connect(ui->listView, &VersionListView::customContextMenuRequested, this, &AccountListPage::ShowContextMenu);
connect(m_accounts.get(), &AccountList::listChanged, this, &AccountListPage::listChanged);
@@ -121,21 +118,19 @@ void AccountListPage::ShowContextMenu(const QPoint& pos)
void AccountListPage::changeEvent(QEvent* event)
{
- if (event->type() == QEvent::LanguageChange)
- {
+ if (event->type() == QEvent::LanguageChange) {
ui->retranslateUi(this);
}
QMainWindow::changeEvent(event);
}
-QMenu * AccountListPage::createPopupMenu()
+QMenu* AccountListPage::createPopupMenu()
{
QMenu* filteredMenu = QMainWindow::createPopupMenu();
- filteredMenu->removeAction(ui->toolBar->toggleViewAction() );
+ filteredMenu->removeAction(ui->toolBar->toggleViewAction());
return filteredMenu;
}
-
void AccountListPage::listChanged()
{
updateButtonStates();
@@ -143,13 +138,10 @@ void AccountListPage::listChanged()
void AccountListPage::on_actionAddMojang_triggered()
{
- MinecraftAccountPtr account = LoginDialog::newAccount(
- this,
- tr("Please enter your Mojang account email and password to add your account.")
- );
+ MinecraftAccountPtr account =
+ LoginDialog::newAccount(this, tr("Please enter your Mojang account email and password to add your account."));
- if (account)
- {
+ if (account) {
m_accounts->addAccount(account);
if (m_accounts->count() == 1) {
m_accounts->setDefaultAccount(account);
@@ -159,13 +151,10 @@ void AccountListPage::on_actionAddMojang_triggered()
void AccountListPage::on_actionAddMicrosoft_triggered()
{
- MinecraftAccountPtr account = MSALoginDialog::newAccount(
- this,
- tr("Please enter your Mojang account email and password to add your account.")
- );
+ MinecraftAccountPtr account =
+ MSALoginDialog::newAccount(this, tr("Please enter your Mojang account email and password to add your account."));
- if (account)
- {
+ if (account) {
m_accounts->addAccount(account);
if (m_accounts->count() == 1) {
m_accounts->setDefaultAccount(account);
@@ -176,25 +165,17 @@ void AccountListPage::on_actionAddMicrosoft_triggered()
void AccountListPage::on_actionAddOffline_triggered()
{
if (!m_accounts->anyAccountIsValid()) {
- QMessageBox::warning(
- this,
- tr("Error"),
- tr(
- "You must add a Microsoft or Mojang account that owns Minecraft before you can add an offline account."
- "<br><br>"
- "If you have lost your account you can contact Microsoft for support."
- )
- );
+ QMessageBox::warning(this, tr("Error"),
+ tr("You must add a Microsoft or Mojang account that owns Minecraft before you can add an offline account."
+ "<br><br>"
+ "If you have lost your account you can contact Microsoft for support."));
return;
}
- MinecraftAccountPtr account = OfflineLoginDialog::newAccount(
- this,
- tr("Please enter your desired username to add your offline account.")
- );
+ MinecraftAccountPtr account =
+ OfflineLoginDialog::newAccount(this, tr("Please enter your desired username to add your offline account."));
- if (account)
- {
+ if (account) {
m_accounts->addAccount(account);
if (m_accounts->count() == 1) {
m_accounts->setDefaultAccount(account);
@@ -205,14 +186,14 @@ void AccountListPage::on_actionAddOffline_triggered()
void AccountListPage::on_actionRemove_triggered()
{
QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes();
- if (selection.size() > 0)
- {
+ if (selection.size() > 0) {
QModelIndex selected = selection.first();
m_accounts->removeAccount(selected);
}
}
-void AccountListPage::on_actionRefresh_triggered() {
+void AccountListPage::on_actionRefresh_triggered()
+{
QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes();
if (selection.size() > 0) {
QModelIndex selected = selection.first();
@@ -221,12 +202,10 @@ void AccountListPage::on_actionRefresh_triggered() {
}
}
-
void AccountListPage::on_actionSetDefault_triggered()
{
QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes();
- if (selection.size() > 0)
- {
+ if (selection.size() > 0) {
QModelIndex selected = selection.first();
MinecraftAccountPtr account = selected.data(AccountList::PointerRole).value<MinecraftAccountPtr>();
m_accounts->setDefaultAccount(account);
@@ -245,8 +224,7 @@ void AccountListPage::updateButtonStates()
bool hasSelection = !selection.empty();
bool accountIsReady = false;
bool accountIsOnline = false;
- if (hasSelection)
- {
+ if (hasSelection) {
QModelIndex selected = selection.first();
MinecraftAccountPtr account = selected.data(AccountList::PointerRole).value<MinecraftAccountPtr>();
accountIsReady = !account->isActive();
@@ -258,11 +236,10 @@ void AccountListPage::updateButtonStates()
ui->actionDeleteSkin->setEnabled(accountIsReady && accountIsOnline);
ui->actionRefresh->setEnabled(accountIsReady && accountIsOnline);
- if(m_accounts->defaultAccount().get() == nullptr) {
+ if (m_accounts->defaultAccount().get() == nullptr) {
ui->actionNoDefault->setEnabled(false);
ui->actionNoDefault->setChecked(true);
- }
- else {
+ } else {
ui->actionNoDefault->setEnabled(true);
ui->actionNoDefault->setChecked(false);
}
@@ -271,8 +248,7 @@ void AccountListPage::updateButtonStates()
void AccountListPage::on_actionUploadSkin_triggered()