From 20b9f2b42a3b58b6081af271774fbcc34025dccb Mon Sep 17 00:00:00 2001 From: Petr Mrázek Date: Sun, 25 Jul 2021 19:11:59 +0200 Subject: NOISSUE Flatten gui and logic libraries into MultiMC --- launcher/pages/BasePage.h | 58 ++ launcher/pages/BasePageContainer.h | 10 + launcher/pages/BasePageProvider.h | 68 ++ launcher/pages/global/AccountListPage.cpp | 217 ++++++ launcher/pages/global/AccountListPage.h | 84 +++ launcher/pages/global/AccountListPage.ui | 98 +++ launcher/pages/global/CustomCommandsPage.cpp | 51 ++ launcher/pages/global/CustomCommandsPage.h | 55 ++ launcher/pages/global/ExternalToolsPage.cpp | 233 +++++++ launcher/pages/global/ExternalToolsPage.h | 74 ++ launcher/pages/global/ExternalToolsPage.ui | 194 ++++++ launcher/pages/global/JavaPage.cpp | 153 ++++ launcher/pages/global/JavaPage.h | 72 ++ launcher/pages/global/JavaPage.ui | 260 +++++++ launcher/pages/global/LanguagePage.cpp | 51 ++ launcher/pages/global/LanguagePage.h | 60 ++ launcher/pages/global/MinecraftPage.cpp | 90 +++ launcher/pages/global/MinecraftPage.h | 70 ++ launcher/pages/global/MinecraftPage.ui | 189 +++++ launcher/pages/global/MultiMCPage.cpp | 467 +++++++++++++ launcher/pages/global/MultiMCPage.h | 103 +++ launcher/pages/global/MultiMCPage.ui | 584 ++++++++++++++++ launcher/pages/global/PasteEEPage.cpp | 81 +++ launcher/pages/global/PasteEEPage.h | 62 ++ launcher/pages/global/PasteEEPage.ui | 128 ++++ launcher/pages/global/ProxyPage.cpp | 101 +++ launcher/pages/global/ProxyPage.h | 66 ++ launcher/pages/global/ProxyPage.ui | 203 ++++++ launcher/pages/instance/GameOptionsPage.cpp | 37 + launcher/pages/instance/GameOptionsPage.h | 63 ++ launcher/pages/instance/GameOptionsPage.ui | 88 +++ launcher/pages/instance/InstanceSettingsPage.cpp | 338 +++++++++ launcher/pages/instance/InstanceSettingsPage.h | 76 ++ launcher/pages/instance/InstanceSettingsPage.ui | 548 +++++++++++++++ launcher/pages/instance/LegacyUpgradePage.cpp | 50 ++ launcher/pages/instance/LegacyUpgradePage.h | 64 ++ launcher/pages/instance/LegacyUpgradePage.ui | 47 ++ launcher/pages/instance/LogPage.cpp | 312 +++++++++ launcher/pages/instance/LogPage.h | 86 +++ launcher/pages/instance/LogPage.ui | 182 +++++ launcher/pages/instance/ModFolderPage.cpp | 363 ++++++++++ launcher/pages/instance/ModFolderPage.h | 119 ++++ launcher/pages/instance/ModFolderPage.ui | 164 +++++ launcher/pages/instance/NotesPage.cpp | 21 + launcher/pages/instance/NotesPage.h | 60 ++ launcher/pages/instance/NotesPage.ui | 49 ++ launcher/pages/instance/OtherLogsPage.cpp | 313 +++++++++ launcher/pages/instance/OtherLogsPage.h | 81 +++ launcher/pages/instance/OtherLogsPage.ui | 150 ++++ launcher/pages/instance/ResourcePackPage.h | 23 + launcher/pages/instance/ScreenshotsPage.cpp | 422 +++++++++++ launcher/pages/instance/ScreenshotsPage.h | 89 +++ launcher/pages/instance/ScreenshotsPage.ui | 87 +++ launcher/pages/instance/ServersPage.cpp | 768 +++++++++++++++++++++ launcher/pages/instance/ServersPage.h | 94 +++ launcher/pages/instance/ServersPage.ui | 194 ++++++ launcher/pages/instance/TexturePackPage.h | 22 + launcher/pages/instance/VersionPage.cpp | 642 +++++++++++++++++ launcher/pages/instance/VersionPage.h | 104 +++ launcher/pages/instance/VersionPage.ui | 285 ++++++++ launcher/pages/instance/WorldListPage.cpp | 408 +++++++++++ launcher/pages/instance/WorldListPage.h | 99 +++ launcher/pages/instance/WorldListPage.ui | 161 +++++ launcher/pages/modplatform/ImportPage.cpp | 130 ++++ launcher/pages/modplatform/ImportPage.h | 70 ++ launcher/pages/modplatform/ImportPage.ui | 52 ++ launcher/pages/modplatform/VanillaPage.cpp | 104 +++ launcher/pages/modplatform/VanillaPage.h | 75 ++ launcher/pages/modplatform/VanillaPage.ui | 169 +++++ .../modplatform/atlauncher/AtlFilterModel.cpp | 81 +++ .../pages/modplatform/atlauncher/AtlFilterModel.h | 34 + .../pages/modplatform/atlauncher/AtlListModel.cpp | 194 ++++++ .../pages/modplatform/atlauncher/AtlListModel.h | 52 ++ .../atlauncher/AtlOptionalModDialog.cpp | 209 ++++++ .../modplatform/atlauncher/AtlOptionalModDialog.h | 66 ++ .../modplatform/atlauncher/AtlOptionalModDialog.ui | 65 ++ launcher/pages/modplatform/atlauncher/AtlPage.cpp | 175 +++++ launcher/pages/modplatform/atlauncher/AtlPage.h | 87 +++ launcher/pages/modplatform/atlauncher/AtlPage.ui | 97 +++ launcher/pages/modplatform/flame/FlameModel.cpp | 259 +++++++ launcher/pages/modplatform/flame/FlameModel.h | 76 ++ launcher/pages/modplatform/flame/FlamePage.cpp | 185 +++++ launcher/pages/modplatform/flame/FlamePage.h | 80 +++ launcher/pages/modplatform/flame/FlamePage.ui | 90 +++ launcher/pages/modplatform/ftb/FtbFilterModel.cpp | 64 ++ launcher/pages/modplatform/ftb/FtbFilterModel.h | 33 + launcher/pages/modplatform/ftb/FtbListModel.cpp | 304 ++++++++ launcher/pages/modplatform/ftb/FtbListModel.h | 69 ++ launcher/pages/modplatform/ftb/FtbPage.cpp | 145 ++++ launcher/pages/modplatform/ftb/FtbPage.h | 80 +++ launcher/pages/modplatform/ftb/FtbPage.ui | 84 +++ .../pages/modplatform/legacy_ftb/ListModel.cpp | 260 +++++++ launcher/pages/modplatform/legacy_ftb/ListModel.h | 78 +++ launcher/pages/modplatform/legacy_ftb/Page.cpp | 369 ++++++++++ launcher/pages/modplatform/legacy_ftb/Page.h | 119 ++++ launcher/pages/modplatform/legacy_ftb/Page.ui | 135 ++++ launcher/pages/modplatform/technic/TechnicData.h | 42 ++ .../pages/modplatform/technic/TechnicModel.cpp | 238 +++++++ launcher/pages/modplatform/technic/TechnicModel.h | 70 ++ launcher/pages/modplatform/technic/TechnicPage.cpp | 198 ++++++ launcher/pages/modplatform/technic/TechnicPage.h | 78 +++ launcher/pages/modplatform/technic/TechnicPage.ui | 95 +++ 102 files changed, 15302 insertions(+) create mode 100644 launcher/pages/BasePage.h create mode 100644 launcher/pages/BasePageContainer.h create mode 100644 launcher/pages/BasePageProvider.h create mode 100644 launcher/pages/global/AccountListPage.cpp create mode 100644 launcher/pages/global/AccountListPage.h create mode 100644 launcher/pages/global/AccountListPage.ui create mode 100644 launcher/pages/global/CustomCommandsPage.cpp create mode 100644 launcher/pages/global/CustomCommandsPage.h create mode 100644 launcher/pages/global/ExternalToolsPage.cpp create mode 100644 launcher/pages/global/ExternalToolsPage.h create mode 100644 launcher/pages/global/ExternalToolsPage.ui create mode 100644 launcher/pages/global/JavaPage.cpp create mode 100644 launcher/pages/global/JavaPage.h create mode 100644 launcher/pages/global/JavaPage.ui create mode 100644 launcher/pages/global/LanguagePage.cpp create mode 100644 launcher/pages/global/LanguagePage.h create mode 100644 launcher/pages/global/MinecraftPage.cpp create mode 100644 launcher/pages/global/MinecraftPage.h create mode 100644 launcher/pages/global/MinecraftPage.ui create mode 100644 launcher/pages/global/MultiMCPage.cpp create mode 100644 launcher/pages/global/MultiMCPage.h create mode 100644 launcher/pages/global/MultiMCPage.ui create mode 100644 launcher/pages/global/PasteEEPage.cpp create mode 100644 launcher/pages/global/PasteEEPage.h create mode 100644 launcher/pages/global/PasteEEPage.ui create mode 100644 launcher/pages/global/ProxyPage.cpp create mode 100644 launcher/pages/global/ProxyPage.h create mode 100644 launcher/pages/global/ProxyPage.ui create mode 100644 launcher/pages/instance/GameOptionsPage.cpp create mode 100644 launcher/pages/instance/GameOptionsPage.h create mode 100644 launcher/pages/instance/GameOptionsPage.ui create mode 100644 launcher/pages/instance/InstanceSettingsPage.cpp create mode 100644 launcher/pages/instance/InstanceSettingsPage.h create mode 100644 launcher/pages/instance/InstanceSettingsPage.ui create mode 100644 launcher/pages/instance/LegacyUpgradePage.cpp create mode 100644 launcher/pages/instance/LegacyUpgradePage.h create mode 100644 launcher/pages/instance/LegacyUpgradePage.ui create mode 100644 launcher/pages/instance/LogPage.cpp create mode 100644 launcher/pages/instance/LogPage.h create mode 100644 launcher/pages/instance/LogPage.ui create mode 100644 launcher/pages/instance/ModFolderPage.cpp create mode 100644 launcher/pages/instance/ModFolderPage.h create mode 100644 launcher/pages/instance/ModFolderPage.ui create mode 100644 launcher/pages/instance/NotesPage.cpp create mode 100644 launcher/pages/instance/NotesPage.h create mode 100644 launcher/pages/instance/NotesPage.ui create mode 100644 launcher/pages/instance/OtherLogsPage.cpp create mode 100644 launcher/pages/instance/OtherLogsPage.h create mode 100644 launcher/pages/instance/OtherLogsPage.ui create mode 100644 launcher/pages/instance/ResourcePackPage.h create mode 100644 launcher/pages/instance/ScreenshotsPage.cpp create mode 100644 launcher/pages/instance/ScreenshotsPage.h create mode 100644 launcher/pages/instance/ScreenshotsPage.ui create mode 100644 launcher/pages/instance/ServersPage.cpp create mode 100644 launcher/pages/instance/ServersPage.h create mode 100644 launcher/pages/instance/ServersPage.ui create mode 100644 launcher/pages/instance/TexturePackPage.h create mode 100644 launcher/pages/instance/VersionPage.cpp create mode 100644 launcher/pages/instance/VersionPage.h create mode 100644 launcher/pages/instance/VersionPage.ui create mode 100644 launcher/pages/instance/WorldListPage.cpp create mode 100644 launcher/pages/instance/WorldListPage.h create mode 100644 launcher/pages/instance/WorldListPage.ui create mode 100644 launcher/pages/modplatform/ImportPage.cpp create mode 100644 launcher/pages/modplatform/ImportPage.h create mode 100644 launcher/pages/modplatform/ImportPage.ui create mode 100644 launcher/pages/modplatform/VanillaPage.cpp create mode 100644 launcher/pages/modplatform/VanillaPage.h create mode 100644 launcher/pages/modplatform/VanillaPage.ui create mode 100644 launcher/pages/modplatform/atlauncher/AtlFilterModel.cpp create mode 100644 launcher/pages/modplatform/atlauncher/AtlFilterModel.h create mode 100644 launcher/pages/modplatform/atlauncher/AtlListModel.cpp create mode 100644 launcher/pages/modplatform/atlauncher/AtlListModel.h create mode 100644 launcher/pages/modplatform/atlauncher/AtlOptionalModDialog.cpp create mode 100644 launcher/pages/modplatform/atlauncher/AtlOptionalModDialog.h create mode 100644 launcher/pages/modplatform/atlauncher/AtlOptionalModDialog.ui create mode 100644 launcher/pages/modplatform/atlauncher/AtlPage.cpp create mode 100644 launcher/pages/modplatform/atlauncher/AtlPage.h create mode 100644 launcher/pages/modplatform/atlauncher/AtlPage.ui create mode 100644 launcher/pages/modplatform/flame/FlameModel.cpp create mode 100644 launcher/pages/modplatform/flame/FlameModel.h create mode 100644 launcher/pages/modplatform/flame/FlamePage.cpp create mode 100644 launcher/pages/modplatform/flame/FlamePage.h create mode 100644 launcher/pages/modplatform/flame/FlamePage.ui create mode 100644 launcher/pages/modplatform/ftb/FtbFilterModel.cpp create mode 100644 launcher/pages/modplatform/ftb/FtbFilterModel.h create mode 100644 launcher/pages/modplatform/ftb/FtbListModel.cpp create mode 100644 launcher/pages/modplatform/ftb/FtbListModel.h create mode 100644 launcher/pages/modplatform/ftb/FtbPage.cpp create mode 100644 launcher/pages/modplatform/ftb/FtbPage.h create mode 100644 launcher/pages/modplatform/ftb/FtbPage.ui create mode 100644 launcher/pages/modplatform/legacy_ftb/ListModel.cpp create mode 100644 launcher/pages/modplatform/legacy_ftb/ListModel.h create mode 100644 launcher/pages/modplatform/legacy_ftb/Page.cpp create mode 100644 launcher/pages/modplatform/legacy_ftb/Page.h create mode 100644 launcher/pages/modplatform/legacy_ftb/Page.ui create mode 100644 launcher/pages/modplatform/technic/TechnicData.h create mode 100644 launcher/pages/modplatform/technic/TechnicModel.cpp create mode 100644 launcher/pages/modplatform/technic/TechnicModel.h create mode 100644 launcher/pages/modplatform/technic/TechnicPage.cpp create mode 100644 launcher/pages/modplatform/technic/TechnicPage.h create mode 100644 launcher/pages/modplatform/technic/TechnicPage.ui (limited to 'launcher/pages') diff --git a/launcher/pages/BasePage.h b/launcher/pages/BasePage.h new file mode 100644 index 00000000..408965d0 --- /dev/null +++ b/launcher/pages/BasePage.h @@ -0,0 +1,58 @@ +/* Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +#include "BasePageContainer.h" + +class BasePage +{ +public: + virtual ~BasePage() {} + virtual QString id() const = 0; + virtual QString displayName() const = 0; + virtual QIcon icon() const = 0; + virtual bool apply() { return true; } + virtual bool shouldDisplay() const { return true; } + virtual QString helpPage() const { return QString(); } + void opened() + { + isOpened = true; + openedImpl(); + } + void closed() + { + isOpened = false; + closedImpl(); + } + virtual void openedImpl() {} + virtual void closedImpl() {} + virtual void setParentContainer(BasePageContainer * container) + { + m_container = container; + }; +public: + int stackIndex = -1; + int listIndex = -1; +protected: + BasePageContainer * m_container = nullptr; + bool isOpened = false; +}; + +typedef std::shared_ptr BasePagePtr; diff --git a/launcher/pages/BasePageContainer.h b/launcher/pages/BasePageContainer.h new file mode 100644 index 00000000..f8c7adeb --- /dev/null +++ b/launcher/pages/BasePageContainer.h @@ -0,0 +1,10 @@ +#pragma once + +class BasePageContainer +{ +public: + virtual ~BasePageContainer(){}; + virtual bool selectPage(QString pageId) = 0; + virtual void refreshContainer() = 0; + virtual bool requestClose() = 0; +}; diff --git a/launcher/pages/BasePageProvider.h b/launcher/pages/BasePageProvider.h new file mode 100644 index 00000000..7bfaaf3b --- /dev/null +++ b/launcher/pages/BasePageProvider.h @@ -0,0 +1,68 @@ +/* Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "pages/BasePage.h" +#include +#include + +class BasePageProvider +{ +public: + virtual QList getPages() = 0; + virtual QString dialogTitle() = 0; +}; + +class GenericPageProvider : public BasePageProvider +{ + typedef std::function PageCreator; +public: + explicit GenericPageProvider(const QString &dialogTitle) + : m_dialogTitle(dialogTitle) + { + } + virtual ~GenericPageProvider() {} + + QList getPages() override + { + QList 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); + } + + template + void addPage() + { + addPageCreator([](){return new PageClass();}); + } + +private: + QList m_creators; + QString m_dialogTitle; +}; diff --git a/launcher/pages/global/AccountListPage.cpp b/launcher/pages/global/AccountListPage.cpp new file mode 100644 index 00000000..ff3736ed --- /dev/null +++ b/launcher/pages/global/AccountListPage.cpp @@ -0,0 +1,217 @@ +/* Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "AccountListPage.h" +#include "ui_AccountListPage.h" + +#include +#include + +#include + +#include "net/NetJob.h" +#include "Env.h" + +#include "dialogs/ProgressDialog.h" +#include "dialogs/LoginDialog.h" +#include "dialogs/CustomMessageBox.h" +#include "dialogs/SkinUploadDialog.h" +#include "tasks/Task.h" +#include "minecraft/auth/YggdrasilTask.h" +#include "minecraft/services/SkinDelete.h" + +#include "MultiMC.h" + +#include "BuildConfig.h" + +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->setEmptyMode(VersionListView::String); + ui->listView->setContextMenuPolicy(Qt::CustomContextMenu); + + m_accounts = MMC->accounts(); + + ui->listView->setModel(m_accounts.get()); + ui->listView->header()->setSectionResizeMode(QHeaderView::ResizeToContents); + ui->listView->setSelectionMode(QAbstractItemView::SingleSelection); + + // Expand the account column + ui->listView->header()->setSectionResizeMode(1, QHeaderView::Stretch); + + QItemSelectionModel *selectionModel = ui->listView->selectionModel(); + + connect(selectionModel, &QItemSelectionModel::selectionChanged, [this](const QItemSelection &sel, const QItemSelection &dsel) { + updateButtonStates(); + }); + connect(ui->listView, &VersionListView::customContextMenuRequested, this, &AccountListPage::ShowContextMenu); + + connect(m_accounts.get(), SIGNAL(listChanged()), SLOT(listChanged())); + connect(m_accounts.get(), SIGNAL(activeAccountChanged()), SLOT(listChanged())); + + updateButtonStates(); +} + +AccountListPage::~AccountListPage() +{ + delete ui; +} + +void AccountListPage::ShowContextMenu(const QPoint& pos) +{ + auto menu = ui->toolBar->createContextMenu(this, tr("Context menu")); + menu->exec(ui->listView->mapToGlobal(pos)); + delete menu; +} + +void AccountListPage::changeEvent(QEvent* event) +{ + if (event->type() == QEvent::LanguageChange) + { + ui->retranslateUi(this); + } + QMainWindow::changeEvent(event); +} + +QMenu * AccountListPage::createPopupMenu() +{ + QMenu* filteredMenu = QMainWindow::createPopupMenu(); + filteredMenu->removeAction(ui->toolBar->toggleViewAction() ); + return filteredMenu; +} + + +void AccountListPage::listChanged() +{ + updateButtonStates(); +} + +void AccountListPage::on_actionAdd_triggered() +{ + addAccount(tr("Please enter your Minecraft account email and password to add your account.")); +} + +void AccountListPage::on_actionRemove_triggered() +{ + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.size() > 0) + { + QModelIndex selected = selection.first(); + m_accounts->removeAccount(selected); + } +} + +void AccountListPage::on_actionSetDefault_triggered() +{ + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.size() > 0) + { + QModelIndex selected = selection.first(); + MojangAccountPtr account = + selected.data(MojangAccountList::PointerRole).value(); + m_accounts->setActiveAccount(account->username()); + } +} + +void AccountListPage::on_actionNoDefault_triggered() +{ + m_accounts->setActiveAccount(""); +} + +void AccountListPage::updateButtonStates() +{ + // If there is no selection, disable buttons that require something selected. + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + + ui->actionRemove->setEnabled(selection.size() > 0); + ui->actionSetDefault->setEnabled(selection.size() > 0); + ui->actionUploadSkin->setEnabled(selection.size() > 0); + ui->actionDeleteSkin->setEnabled(selection.size() > 0); + + if(m_accounts->activeAccount().get() == nullptr) { + ui->actionNoDefault->setEnabled(false); + ui->actionNoDefault->setChecked(true); + } + else { + ui->actionNoDefault->setEnabled(true); + ui->actionNoDefault->setChecked(false); + } + +} + +void AccountListPage::addAccount(const QString &errMsg) +{ + // TODO: The login dialog isn't quite done yet + MojangAccountPtr account = LoginDialog::newAccount(this, errMsg); + + if (account != nullptr) + { + m_accounts->addAccount(account); + if (m_accounts->count() == 1) + m_accounts->setActiveAccount(account->username()); + + // Grab associated player skins + auto job = new NetJob("Player skins: " + account->username()); + + for (AccountProfile profile : account->profiles()) + { + auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png"); + auto action = Net::Download::makeCached(QUrl(BuildConfig.SKINS_BASE + profile.id + ".png"), meta); + job->addNetAction(action); + meta->setStale(true); + } + + job->start(); + } +} + +void AccountListPage::on_actionUploadSkin_triggered() +{ + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.size() > 0) + { + QModelIndex selected = selection.first(); + MojangAccountPtr account = selected.data(MojangAccountList::PointerRole).value(); + SkinUploadDialog dialog(account, this); + dialog.exec(); + } +} + +void AccountListPage::on_actionDeleteSkin_triggered() +{ + QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); + if (selection.size() <= 0) + return; + + QModelIndex selected = selection.first(); + AuthSessionPtr session = std::make_shared(); + MojangAccountPtr account = selected.data(MojangAccountList::PointerRole).value(); + auto login = account->login(session); + ProgressDialog prog(this); + if (prog.execWithTask((Task*)login.get()) != QDialog::Accepted) { + CustomMessageBox::selectable(this, tr("Skin Delete"), tr("Failed to login!"), QMessageBox::Warning)->exec(); + return; + } + auto deleteSkinTask = std::make_shared(this, session); + if (prog.execWithTask((Task*)deleteSkinTask.get()) != QDialog::Accepted) { + CustomMessageBox::selectable(this, tr("Skin Delete"), tr("Failed to delete current skin!"), QMessageBox::Warning)->exec(); + return; + } +} diff --git a/launcher/pages/global/AccountListPage.h b/launcher/pages/global/AccountListPage.h new file mode 100644 index 00000000..fba1833f --- /dev/null +++ b/launcher/pages/global/AccountListPage.h @@ -0,0 +1,84 @@ +/* Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "pages/BasePage.h" + +#include "minecraft/auth/MojangAccountList.h" +#include "MultiMC.h" + +namespace Ui +{ +class AccountListPage; +} + +class AuthenticateTask; + +class AccountListPage : public QMainWindow, public BasePage +{ + Q_OBJECT +public: + explicit AccountListPage(QWidget *parent = 0); + ~AccountListPage(); + + QString displayName() const override + { + return tr("Accounts"); + } + QIcon icon() const override + { + auto icon = MMC->getThemedIcon("accounts"); + if(icon.isNull()) + { + icon = MMC->getThemedIcon("noaccount"); + } + return icon; + } + QString id() const override + { + return "accounts"; + } + QString helpPage() const override + { + return "Getting-Started#adding-an-account"; + } + +public slots: + void on_actionAdd_triggered(); + void on_actionRemove_triggered(); + void on_actionSetDefault_triggered(); + void on_actionNoDefault_triggered(); + void on_actionUploadSkin_triggered(); + void on_actionDeleteSkin_triggered(); + + void listChanged(); + + //! Updates the states of the dialog's buttons. + void updateButtonStates(); + +protected slots: + void ShowContextMenu(const QPoint &pos); + void addAccount(const QString& errMsg=""); + +private: + void changeEvent(QEvent * event) override; + QMenu * createPopupMenu() override; + std::shared_ptr m_accounts; + Ui::AccountListPage *ui; +}; diff --git a/launcher/pages/global/AccountListPage.ui b/launcher/pages/global/AccountListPage.ui new file mode 100644 index 00000000..71647db3 --- /dev/null +++ b/launcher/pages/global/AccountListPage.ui @@ -0,0 +1,98 @@ + + + AccountListPage + + + + 0 + 0 + 800 + 600 + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + RightToolBarArea + + + false + + + + + + + + + + + + Add + + + + + Remove + + + + + Set Default + + + + + true + + + No Default + + + + + Upload Skin + + + + + Delete Skin + + + Delete the currently active skin and go back to the default one + + + + + + VersionListView + QTreeView +
widgets/VersionListView.h
+
+ + WideBar + QToolBar +
widgets/WideBar.h
+
+
+ + +
diff --git a/launcher/pages/global/CustomCommandsPage.cpp b/launcher/pages/global/CustomCommandsPage.cpp new file mode 100644 index 00000000..3b182319 --- /dev/null +++ b/launcher/pages/global/CustomCommandsPage.cpp @@ -0,0 +1,51 @@ +#include "CustomCommandsPage.h" +#include +#include +#include + +CustomCommandsPage::CustomCommandsPage(QWidget* parent): QWidget(parent) +{ + + auto verticalLayout = new QVBoxLayout(this); + verticalLayout->setObjectName(QStringLiteral("verticalLayout")); + verticalLayout->setContentsMargins(0, 0, 0, 0); + + auto tabWidget = new QTabWidget(this); + tabWidget->setObjectName(QStringLiteral("tabWidget")); + commands = new CustomCommands(this); + commands->setContentsMargins(6, 6, 6, 6); + tabWidget->addTab(commands, "Foo"); + tabWidget->tabBar()->hide(); + verticalLayout->addWidget(tabWidget); + loadSettings(); +} + +CustomCommandsPage::~CustomCommandsPage() +{ +} + +bool CustomCommandsPage::apply() +{ + applySettings(); + return true; +} + +void CustomCommandsPage::applySettings() +{ + auto s = MMC->settings(); + s->set("PreLaunchCommand", commands->prelaunchCommand()); + s->set("WrapperCommand", commands->wrapperCommand()); + s->set("PostExitCommand", commands->postexitCommand()); +} + +void CustomCommandsPage::loadSettings() +{ + auto s = MMC->settings(); + commands->initialize( + false, + true, + s->get("PreLaunchCommand").toString(), + s->get("WrapperCommand").toString(), + s->get("PostExitCommand").toString() + ); +} diff --git a/launcher/pages/global/CustomCommandsPage.h b/launcher/pages/global/CustomCommandsPage.h new file mode 100644 index 00000000..414c3259 --- /dev/null +++ b/launcher/pages/global/CustomCommandsPage.h @@ -0,0 +1,55 @@ +/* Copyright 2018-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +#include "pages/BasePage.h" +#include +#include "widgets/CustomCommands.h" + +class CustomCommandsPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit CustomCommandsPage(QWidget *parent = 0); + ~CustomCommandsPage(); + + QString displayName() const override + { + return tr("Custom Commands"); + } + QIcon icon() const override + { + return MMC->getThemedIcon("custom-commands"); + } + QString id() const override + { + return "custom-commands"; + } + QString helpPage() const override + { + return "Custom-commands"; + } + bool apply() override; + +private: + void applySettings(); + void loadSettings(); + CustomCommands * commands; +}; diff --git a/launcher/pages/global/ExternalToolsPage.cpp b/launcher/pages/global/ExternalToolsPage.cpp new file mode 100644 index 00000000..6a0a38be --- /dev/null +++ b/launcher/pages/global/ExternalToolsPage.cpp @@ -0,0 +1,233 @@ +/* Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "ExternalToolsPage.h" +#include "ui_ExternalToolsPage.h" + +#include +#include +#include +#include + +#include "settings/SettingsObject.h" +#include "tools/BaseProfiler.h" +#include +#include "MultiMC.h" +#include + +ExternalToolsPage::ExternalToolsPage(QWidget *parent) : + QWidget(parent), + ui(new Ui::ExternalToolsPage) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + + #if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0) + ui->jsonEditorTextBox->setClearButtonEnabled(true); + #endif + + ui->mceditLink->setOpenExternalLinks(true); + ui->jvisualvmLink->setOpenExternalLinks(true); + ui->jprofilerLink->setOpenExternalLinks(true); + loadSettings(); +} + +ExternalToolsPage::~ExternalToolsPage() +{ + delete ui; +} + +void ExternalToolsPage::loadSettings() +{ + auto s = MMC->settings(); + ui->jprofilerPathEdit->setText(s->get("JProfilerPath").toString()); + ui->jvisualvmPathEdit->setText(s->get("JVisualVMPath").toString()); + ui->mceditPathEdit->setText(s->get("MCEditPath").toString()); + + // Editors + ui->jsonEditorTextBox->setText(s->get("JsonEditor").toString()); +} +void ExternalToolsPage::applySettings() +{ + auto s = MMC->settings(); + + s->set("JProfilerPath", ui->jprofilerPathEdit->text()); + s->set("JVisualVMPath", ui->jvisualvmPathEdit->text()); + s->set("MCEditPath", ui->mceditPathEdit->text()); + + // Editors + QString jsonEditor = ui->jsonEditorTextBox->text(); + if (!jsonEditor.isEmpty() && + (!QFileInfo(jsonEditor).exists() || !QFileInfo(jsonEditor).isExecutable())) + { + QString found = QStandardPaths::findExecutable(jsonEditor); + if (!found.isEmpty()) + { + jsonEditor = found; + } + } + s->set("JsonEditor", jsonEditor); +} + +void ExternalToolsPage::on_jprofilerPathBtn_clicked() +{ + QString raw_dir = ui->jprofilerPathEdit->text(); + QString error; + do + { + raw_dir = QFileDialog::getExistingDirectory(this, tr("JProfiler Folder"), raw_dir); + if (raw_dir.isEmpty()) + { + break; + } + QString cooked_dir = FS::NormalizePath(raw_dir); + if (!MMC->profilers()["jprofiler"]->check(cooked_dir, &error)) + { + QMessageBox::critical(this, tr("Error"), tr("Error while checking JProfiler install:\n%1").arg(error)); + continue; + } + else + { + ui->jprofilerPathEdit->setText(cooked_dir); + break; + } + } while (1); +} +void ExternalToolsPage::on_jprofilerCheckBtn_clicked() +{ + QString error; + if (!MMC->profilers()["jprofiler"]->check(ui->jprofilerPathEdit->text(), &error)) + { + QMessageBox::critical(this, tr("Error"), tr("Error while checking JProfiler install:\n%1").arg(error)); + } + else + { + QMessageBox::information(this, tr("OK"), tr("JProfiler setup seems to be OK")); + } +} + +void ExternalToolsPage::on_jvisualvmPathBtn_clicked() +{ + QString raw_dir = ui->jvisualvmPathEdit->text(); + QString error; + do + { + raw_dir = QFileDialog::getOpenFileName(this, tr("JVisualVM Executable"), raw_dir); + if (raw_dir.isEmpty()) + { + break; + } + QString cooked_dir = FS::NormalizePath(raw_dir); + if (!MMC->profilers()["jvisualvm"]->check(cooked_dir, &error)) + { + QMessageBox::critical(this, tr("Error"), tr("Error while checking JVisualVM install:\n%1").arg(error)); + continue; + } + else + { + ui->jvisualvmPathEdit->setText(cooked_dir); + break; + } + } while (1); +} +void ExternalToolsPage::on_jvisualvmCheckBtn_clicked() +{ + QString error; + if (!MMC->profilers()["jvisualvm"]->check(ui->jvisualvmPathEdit->text(), &error)) + { + QMessageBox::critical(this, tr("Error"), tr("Error while checking JVisualVM install:\n%1").arg(error)); + } + else + { + QMessageBox::information(this, tr("OK"), tr("JVisualVM setup seems to be OK")); + } +} + +void ExternalToolsPage::on_mceditPathBtn_clicked() +{ + QString raw_dir = ui->mceditPathEdit->text(); + QString error; + do + { +#ifdef Q_OS_OSX + raw_dir = QFileDialog::getOpenFileName(this, tr("MCEdit Application"), raw_dir); +#else + raw_dir = QFileDialog::getExistingDirectory(this, tr("MCEdit Folder"), raw_dir); +#endif + if (raw_dir.isEmpty()) + { + break; + } + QString cooked_dir = FS::NormalizePath(raw_dir); + if (!MMC->mcedit()->check(cooked_dir, error)) + { + QMessageBox::critical(this, tr("Error"), tr("Error while checking MCEdit install:\n%1").arg(error)); + continue; + } + else + { + ui->mceditPathEdit->setText(cooked_dir); + break; + } + } while (1); +} +void ExternalToolsPage::on_mceditCheckBtn_clicked() +{ + QString error; + if (!MMC->mcedit()->check(ui->mceditPathEdit->text(), error)) + { + QMessageBox::critical(this, tr("Error"), tr("Error while checking MCEdit install:\n%1").arg(error)); + } + else + { + QMessageBox::information(this, tr("OK"), tr("MCEdit setup seems to be OK")); + } +} + +void ExternalToolsPage::on_jsonEditorBrowseBtn_clicked() +{ + QString raw_file = QFileDialog::getOpenFileName( + this, tr("JSON Editor"), + ui->jsonEditorTextBox->text().isEmpty() +#if defined(Q_OS_LINUX) + ? QString("/usr/bin") +#else + ? QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation).first() +#endif + : ui->jsonEditorTextBox->text()); + + if (raw_file.isEmpty()) + { + return; + } + QString cooked_file = FS::NormalizePath(raw_file); + + // it has to exist and be an executable + if (QFileInfo(cooked_file).exists() && QFileInfo(cooked_file).isExecutable()) + { + ui->jsonEditorTextBox->setText(cooked_file); + } + else + { + QMessageBox::warning(this, tr("Invalid"), + tr("The file chosen does not seem to be an executable")); + } +} + +bool ExternalToolsPage::apply() +{ + applySettings(); + return true; +} diff --git a/launcher/pages/global/ExternalToolsPage.h b/launcher/pages/global/ExternalToolsPage.h new file mode 100644 index 00000000..0fc8ebe1 --- /dev/null +++ b/launcher/pages/global/ExternalToolsPage.h @@ -0,0 +1,74 @@ +/* Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +#include "pages/BasePage.h" +#include + +namespace Ui { +class ExternalToolsPage; +} + +class ExternalToolsPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit ExternalToolsPage(QWidget *parent = 0); + ~ExternalToolsPage(); + + QString displayName() const override + { + return tr("External Tools"); + } + QIcon icon() const override + { + auto icon = MMC->getThemedIcon("externaltools"); + if(icon.isNull()) + { + icon = MMC->getThemedIcon("loadermods"); + } + return icon; + } + QString id() const override + { + return "external-tools"; + } + QString helpPage() const override + { + return "Tools"; + } + virtual bool apply() override; + +private: + void loadSettings(); + void applySettings(); + +private: + Ui::ExternalToolsPage *ui; + +private +slots: + void on_jprofilerPathBtn_clicked(); + void on_jprofilerCheckBtn_clicked(); + void on_jvisualvmPathBtn_clicked(); + void on_jvisualvmCheckBtn_clicked(); + void on_mceditPathBtn_clicked(); + void on_mceditCheckBtn_clicked(); + void on_jsonEditorBrowseBtn_clicked(); +}; diff --git a/launcher/pages/global/ExternalToolsPage.ui b/launcher/pages/global/ExternalToolsPage.ui new file mode 100644 index 00000000..e79e9388 --- /dev/null +++ b/launcher/pages/global/ExternalToolsPage.ui @@ -0,0 +1,194 @@ + + + ExternalToolsPage + + + + 0 + 0 + 673 + 751 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + JProfiler + + + + + + + + + + + ... + + + + + + + + + Check + + + + + + + <html><head/><body><p><a href="https://www.ej-technologies.com/products/jprofiler/overview.html">https://www.ej-technologies.com/products/jprofiler/overview.html</a></p></body></html> + + + + + + + + + + JVisualVM + + + + + + + + + + + ... + + + + + + + + + Check + + + + + + + <html><head/><body><p><a href="https://visualvm.github.io/">https://visualvm.github.io/</a></p></body></html> + + + + + + + + + + MCEdit + + + + + + + + + + + ... + + + + + + + + + Check + + + + + + + <html><head/><body><p><a href="https://www.mcedit.net/">https://www.mcedit.net/</a></p></body></html> + + + + + + + + + + External Editors (leave empty for system default) + + + + + + + + + Text Editor: + + + + + + + ... + + + + + + + + + + Qt::Vertical + + + + 20 + 216 + + + + + + + + + + + + + diff --git a/launcher/pages/global/JavaPage.cpp b/launcher/pages/global/JavaPage.cpp new file mode 100644 index 00000000..cde0e035 --- /dev/null +++ b/launcher/pages/global/JavaPage.cpp @@ -0,0 +1,153 @@ +/* Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "JavaPage.h" +#include "JavaCommon.h" +#include "ui_JavaPage.h" + +#include +#include +#include +#include + +#include "dialogs/VersionSelectDialog.h" + +#include "java/JavaUtils.h" +#include "java/JavaInstallList.h" + +#include "settings/SettingsObject.h" +#include +#include "MultiMC.h" +#include + +JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage) +{ + ui->setupUi(this); + ui->tabWidget->tabBar()->hide(); + + auto sysMiB = Sys::getSystemRam() / Sys::mebibyte; + ui->maxMemSpinBox->setMaximum(sysMiB); + loadSettings(); +} + +JavaPage::~JavaPage() +{ + delete ui; +} + +bool JavaPage::apply() +{ + applySettings(); + return true; +} + +void JavaPage::applySettings() +{ + auto s = MMC->settings(); + + // Memory + int min = ui->minMemSpinBox->value(); + int max = ui->maxMemSpinBox->value(); + if(min < max) + { + s->set("MinMemAlloc", min); + s->set("MaxMemAlloc", max); + } + else + { + s->set("MinMemAlloc", max); + s->set("MaxMemAlloc", min); + } + s->set("PermGen", ui->permGenSpinBox->value()); + + // Java Settings + s->set("JavaPath", ui->javaPathTextBox->text()); + s->set("JvmArgs", ui->jvmArgsTextBox->text()); + JavaCommon::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget()); +} +void JavaPage::loadSettings() +{ + auto s = MMC->settings(); + // Memory + int min = s->get("MinMemAlloc").toInt(); + int max = s->get("MaxMemAlloc").toInt(); + if(min < max) + { + ui->minMemSpinBox->setValue(min); + ui->maxMemSpinBox->setValue(max); + } + else + { + ui->minMemSpinBox->setValue(max); + ui->maxMemSpinBox->setValue(min); + } + ui->permGenSpinBox->setValue(s->get("PermGen").toInt()); + + // Java Settings + ui->javaPathTextBox->setText(s->get("JavaPath").toString()); + ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString()); +} + +void JavaPage::on_javaDetectBtn_clicked() +{ + JavaInstallPtr java; + + VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true); + vselect.setResizeOn(2); + vselect.exec(); + + if (vselect.result() == QDialog::Accepted && vselect.selectedVersion()) + { + java = std::dynamic_pointer_cast(vselect.selectedVersion()); + ui->javaPathTextBox->setText(java->path); + } +} + +void JavaPage::on_javaBrowseBtn_clicked() +{ + QString raw_path = QFileDialog::getOpenFileName(this, tr("Find Java executable")); + + // do not allow current dir - it's dirty. Do not allow dirs that don't exist + if(raw_path.isEmpty()) + { + return; + } + + QString cooked_path = FS::NormalizePath(raw_path); + QFileInfo javaInfo(cooked_path);; + if(!javaInfo.exists() || !javaInfo.isExecutable()) + { + return; + } + ui->javaPathTextBox->setText(cooked_path); +} + +void JavaPage::on_javaTestBtn_clicked() +{ + if(checker) + { + return; + } + checker.reset(new JavaCommon::TestCheck( + this, ui->javaPathTextBox->text(), ui->jvmArgsTextBox->text(), + ui->minMemSpinBox->value(), ui->maxMemSpinBox->value(), ui->permGenSpinBox->value())); + connect(checker.get(), SIGNAL(finished()), SLOT(checkerFinished())); + checker->run(); +} + +void JavaPage::checkerFinished() +{ + checker.reset(); +} diff --git a/launcher/pages/global/JavaPage.h b/launcher/pages/global/JavaPage.h new file mode 100644 index 00000000..832f460b --- /dev/null +++ b/launcher/pages/global/JavaPage.h @@ -0,0 +1,72 @@ +/* Copyright 2013-2021 MultiMC Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include "pages/BasePage.h" +#include "JavaCommon.h" +#include +#include + +class SettingsObject; + +namespace Ui +{ +class JavaPage; +} + +class JavaPage : public QWidget, public BasePage +{ + Q_OBJECT + +public: + explicit JavaPage(QWidget *parent = 0); + ~JavaPage(); + + QString displayName() const override + { + return tr("Java"); + } + QIcon icon() const override + { + return MMC->getThemedIcon("java"); + } + QString id() const override + { + return "java-settings"; + } + QString helpPage() const override + { + return "Java-settings"; + } + bool apply() override; + +private: + void applySettings(); + void loadSettings(); + +private +slots: + void on_javaDetectBtn_clicked(); + void on_javaTestBtn_clicked(); + void on_javaBrowseBtn_clicked(); + void checkerFinished(); + +private: + Ui::JavaPage *ui; + unique_qobject_ptr checker; +}; diff --git a/launcher/pages/global/JavaPage.ui b/launcher/pages/global/JavaPage.ui new file mode 100644 index 00000000..b67e9994 --- /dev/null +++ b/launcher/pages/global/JavaPage.ui @@ -0,0 +1,260 @@ + + + JavaPage + + + + 0 + 0 + 545 + 580 + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 + + + + Tab 1 + + + + + + Memory + + + + + + The maximum amount of memory Minecraft is allowed to use. + + + MiB + + + 128 + + + 65536 + + + 128 + + + 1024 + + + + + + + Minimum memory allocation: + + + + + + + Maximum memory allocation: + + + + + + + The amount of memory Minecraft is started with. + + + MiB + + + 128 + + + 65536 + + + 128 + + + 256 + + + + + + + PermGen: + + + + + + + The amount of memory available to store loaded Java classes. + + + MiB + + + 64 + + + 999999999 + + + 8 + + + 64 + + + + + + + + + + Java Runtime + + + + + + + 0 + 0 + + + + Java path: + + + + + + + + + + + + + 0 + 0 + + + + + 28 + 16777215 + + + + ... + + + + + + + + + + + + + 0 + 0 + + + + JVM arguments: + + + + + + + + 0 + 0 + + + + Auto-detect... + + + + + + + + 0 + 0 + + + + Test + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + minMemSpinBox + maxMemSpinBox + permGenSpinBox + javaBrowseBtn + javaPathTextBox + jvmArgsTextBox + javaDetectBtn + javaTestBtn + tabWidget + + + + diff --git a/launcher/pages/global/LanguagePage.cpp b/launcher/pages/global/LanguagePage.cpp new file mode 100644 index 00000000..ae3168cc --- /dev/null +++ b/launcher/pages/global/LanguagePage.cpp @@ -0,0 +1,51 @@ +#include "LanguagePage.h" + +#include "widgets/LanguageSelectionWidget.h" +#include + +LanguagePage::LanguagePage(QWidget* parent) : + QWidget(parent) +{ + setObjectName(QStringLiteral("languagePage")); + auto layout = new QVBoxLayout(this); + mainWidget = new Languag