NOISSUE debranding for real, initial work

This is probably very broken on macOS and Windows and will need a lot of work to complete fully.
This commit is contained in:
Petr Mrázek
2021-10-13 01:59:25 +02:00
parent 6a4130c914
commit 441ab7eedc
112 changed files with 944 additions and 663 deletions

View File

@ -32,7 +32,7 @@
#include "minecraft/auth/AccountTask.h"
#include "minecraft/services/SkinDelete.h"
#include "MultiMC.h"
#include "Launcher.h"
#include "BuildConfig.h"
#include <dialogs/MSALoginDialog.h>
@ -50,7 +50,7 @@ AccountListPage::AccountListPage(QWidget *parent)
ui->listView->setEmptyMode(VersionListView::String);
ui->listView->setContextMenuPolicy(Qt::CustomContextMenu);
m_accounts = MMC->accounts();
m_accounts = LAUNCHER->accounts();
ui->listView->setModel(m_accounts.get());
ui->listView->header()->setSectionResizeMode(0, QHeaderView::Stretch);

View File

@ -21,7 +21,7 @@
#include "pages/BasePage.h"
#include "minecraft/auth/AccountList.h"
#include "MultiMC.h"
#include "Launcher.h"
namespace Ui
{
@ -43,10 +43,10 @@ public:
}
QIcon icon() const override
{
auto icon = MMC->getThemedIcon("accounts");
auto icon = LAUNCHER->getThemedIcon("accounts");
if(icon.isNull())
{
icon = MMC->getThemedIcon("noaccount");
icon = LAUNCHER->getThemedIcon("noaccount");
}
return icon;
}

View File

@ -32,7 +32,7 @@ bool CustomCommandsPage::apply()
void CustomCommandsPage::applySettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
s->set("PreLaunchCommand", commands->prelaunchCommand());
s->set("WrapperCommand", commands->wrapperCommand());
s->set("PostExitCommand", commands->postexitCommand());
@ -40,7 +40,7 @@ void CustomCommandsPage::applySettings()
void CustomCommandsPage::loadSettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
commands->initialize(
false,
true,

View File

@ -19,7 +19,7 @@
#include <QDialog>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include "widgets/CustomCommands.h"
class CustomCommandsPage : public QWidget, public BasePage
@ -36,7 +36,7 @@ public:
}
QIcon icon() const override
{
return MMC->getThemedIcon("custom-commands");
return LAUNCHER->getThemedIcon("custom-commands");
}
QString id() const override
{

View File

@ -24,7 +24,7 @@
#include "settings/SettingsObject.h"
#include "tools/BaseProfiler.h"
#include <FileSystem.h>
#include "MultiMC.h"
#include "Launcher.h"
#include <tools/MCEditTool.h>
ExternalToolsPage::ExternalToolsPage(QWidget *parent) :
@ -51,7 +51,7 @@ ExternalToolsPage::~ExternalToolsPage()
void ExternalToolsPage::loadSettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
ui->jprofilerPathEdit->setText(s->get("JProfilerPath").toString());
ui->jvisualvmPathEdit->setText(s->get("JVisualVMPath").toString());
ui->mceditPathEdit->setText(s->get("MCEditPath").toString());
@ -61,7 +61,7 @@ void ExternalToolsPage::loadSettings()
}
void ExternalToolsPage::applySettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
s->set("JProfilerPath", ui->jprofilerPathEdit->text());
s->set("JVisualVMPath", ui->jvisualvmPathEdit->text());
@ -93,7 +93,7 @@ void ExternalToolsPage::on_jprofilerPathBtn_clicked()
break;
}
QString cooked_dir = FS::NormalizePath(raw_dir);
if (!MMC->profilers()["jprofiler"]->check(cooked_dir, &error))
if (!LAUNCHER->profilers()["jprofiler"]->check(cooked_dir, &error))
{
QMessageBox::critical(this, tr("Error"), tr("Error while checking JProfiler install:\n%1").arg(error));
continue;
@ -108,7 +108,7 @@ void ExternalToolsPage::on_jprofilerPathBtn_clicked()
void ExternalToolsPage::on_jprofilerCheckBtn_clicked()
{
QString error;
if (!MMC->profilers()["jprofiler"]->check(ui->jprofilerPathEdit->text(), &error))
if (!LAUNCHER->profilers()["jprofiler"]->check(ui->jprofilerPathEdit->text(), &error))
{
QMessageBox::critical(this, tr("Error"), tr("Error while checking JProfiler install:\n%1").arg(error));
}
@ -130,7 +130,7 @@ void ExternalToolsPage::on_jvisualvmPathBtn_clicked()
break;
}
QString cooked_dir = FS::NormalizePath(raw_dir);
if (!MMC->profilers()["jvisualvm"]->check(cooked_dir, &error))
if (!LAUNCHER->profilers()["jvisualvm"]->check(cooked_dir, &error))
{
QMessageBox::critical(this, tr("Error"), tr("Error while checking JVisualVM install:\n%1").arg(error));
continue;
@ -145,7 +145,7 @@ void ExternalToolsPage::on_jvisualvmPathBtn_clicked()
void ExternalToolsPage::on_jvisualvmCheckBtn_clicked()
{
QString error;
if (!MMC->profilers()["jvisualvm"]->check(ui->jvisualvmPathEdit->text(), &error))
if (!LAUNCHER->profilers()["jvisualvm"]->check(ui->jvisualvmPathEdit->text(), &error))
{
QMessageBox::critical(this, tr("Error"), tr("Error while checking JVisualVM install:\n%1").arg(error));
}
@ -171,7 +171,7 @@ void ExternalToolsPage::on_mceditPathBtn_clicked()
break;
}
QString cooked_dir = FS::NormalizePath(raw_dir);
if (!MMC->mcedit()->check(cooked_dir, error))
if (!LAUNCHER->mcedit()->check(cooked_dir, error))
{
QMessageBox::critical(this, tr("Error"), tr("Error while checking MCEdit install:\n%1").arg(error));
continue;
@ -186,7 +186,7 @@ void ExternalToolsPage::on_mceditPathBtn_clicked()
void ExternalToolsPage::on_mceditCheckBtn_clicked()
{
QString error;
if (!MMC->mcedit()->check(ui->mceditPathEdit->text(), error))
if (!LAUNCHER->mcedit()->check(ui->mceditPathEdit->text(), error))
{
QMessageBox::critical(this, tr("Error"), tr("Error while checking MCEdit install:\n%1").arg(error));
}

View File

@ -18,7 +18,7 @@
#include <QWidget>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
namespace Ui {
class ExternalToolsPage;
@ -38,10 +38,10 @@ public:
}
QIcon icon() const override
{
auto icon = MMC->getThemedIcon("externaltools");
auto icon = LAUNCHER->getThemedIcon("externaltools");
if(icon.isNull())
{
icon = MMC->getThemedIcon("loadermods");
icon = LAUNCHER->getThemedIcon("loadermods");
}
return icon;
}

View File

@ -29,7 +29,7 @@
#include "settings/SettingsObject.h"
#include <FileSystem.h>
#include "MultiMC.h"
#include "Launcher.h"
#include <sys.h>
JavaPage::JavaPage(QWidget *parent) : QWidget(parent), ui(new Ui::JavaPage)
@ -55,7 +55,7 @@ bool JavaPage::apply()
void JavaPage::applySettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
// Memory
int min = ui->minMemSpinBox->value();
@ -79,7 +79,7 @@ void JavaPage::applySettings()
}
void JavaPage::loadSettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
// Memory
int min = s->get("MinMemAlloc").toInt();
int max = s->get("MaxMemAlloc").toInt();
@ -104,7 +104,7 @@ void JavaPage::on_javaDetectBtn_clicked()
{
JavaInstallPtr java;
VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true);
VersionSelectDialog vselect(LAUNCHER->javalist().get(), tr("Select a Java version"), this, true);
vselect.setResizeOn(2);
vselect.exec();

View File

@ -19,7 +19,7 @@
#include <QDialog>
#include "pages/BasePage.h"
#include "JavaCommon.h"
#include <MultiMC.h>
#include <Launcher.h>
#include <QObjectPtr.h>
class SettingsObject;
@ -43,7 +43,7 @@ public:
}
QIcon icon() const override
{
return MMC->getThemedIcon("java");
return LAUNCHER->getThemedIcon("java");
}
QString id() const override
{

View File

@ -26,7 +26,7 @@ bool LanguagePage::apply()
void LanguagePage::applySettings()
{
auto settings = MMC->settings();
auto settings = LAUNCHER->settings();
QString key = mainWidget->getSelectedLanguageKey();
settings->set("Language", key);
}

View File

@ -17,7 +17,7 @@
#include <memory>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include <QWidget>
class LanguageSelectionWidget;
@ -36,7 +36,7 @@ public:
}
QIcon icon() const override
{
return MMC->getThemedIcon("language");
return LAUNCHER->getThemedIcon("language");
}
QString id() const override
{

View File

@ -13,8 +13,8 @@
* limitations under the License.
*/
#include "MultiMCPage.h"
#include "ui_MultiMCPage.h"
#include "LauncherPage.h"
#include "ui_LauncherPage.h"
#include <QFileDialog>
#include <QMessageBox>
@ -25,7 +25,7 @@
#include "settings/SettingsObject.h"
#include <FileSystem.h>
#include "MultiMC.h"
#include "Launcher.h"
#include "BuildConfig.h"
#include "themes/ITheme.h"
@ -41,7 +41,7 @@ enum InstSortMode
Sort_LastLaunch
};
MultiMCPage::MultiMCPage(QWidget *parent) : QWidget(parent), ui(new Ui::MultiMCPage)
LauncherPage::LauncherPage(QWidget *parent) : QWidget(parent), ui(new Ui::LauncherPage)
{
ui->setupUi(this);
auto origForeground = ui->fontPreview->palette().color(ui->fontPreview->foregroundRole());
@ -53,20 +53,20 @@ MultiMCPage::MultiMCPage(QWidget *parent) : QWidget(parent), ui(new Ui::MultiMCP
defaultFormat = new QTextCharFormat(ui->fontPreview->currentCharFormat());
m_languageModel = MMC->translations();
m_languageModel = LAUNCHER->translations();
loadSettings();
if(BuildConfig.UPDATER_ENABLED)
{
QObject::connect(MMC->updateChecker().get(), &UpdateChecker::channelListLoaded, this, &MultiMCPage::refreshUpdateChannelList);
QObject::connect(LAUNCHER->updateChecker().get(), &UpdateChecker::channelListLoaded, this, &LauncherPage::refreshUpdateChannelList);
if (MMC->updateChecker()->hasChannels())
if (LAUNCHER->updateChecker()->hasChannels())
{
refreshUpdateChannelList();
}
else
{
MMC->updateChecker()->updateChanList(false);
LAUNCHER->updateChecker()->updateChanList(false);
}
}
else
@ -89,19 +89,19 @@ MultiMCPage::MultiMCPage(QWidget *parent) : QWidget(parent), ui(new Ui::MultiMCP
}
}
MultiMCPage::~MultiMCPage()
LauncherPage::~LauncherPage()
{
delete ui;
delete defaultFormat;
}
bool MultiMCPage::apply()
bool LauncherPage::apply()
{
applySettings();
return true;
}
void MultiMCPage::on_instDirBrowseBtn_clicked()
void LauncherPage::on_instDirBrowseBtn_clicked()
{
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Instance Folder"), ui->instDirTextBox->text());
@ -133,7 +133,7 @@ void MultiMCPage::on_instDirBrowseBtn_clicked()
}
}
void MultiMCPage::on_iconsDirBrowseBtn_clicked()
void LauncherPage::on_iconsDirBrowseBtn_clicked()
{
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Icons Folder"), ui->iconsDirTextBox->text());
@ -144,7 +144,7 @@ void MultiMCPage::on_iconsDirBrowseBtn_clicked()
ui->iconsDirTextBox->setText(cooked_dir);
}
}
void MultiMCPage::on_modsDirBrowseBtn_clicked()
void LauncherPage::on_modsDirBrowseBtn_clicked()
{
QString raw_dir = QFileDialog::getExistingDirectory(this, tr("Mods Folder"), ui->modsDirTextBox->text());
@ -155,7 +155,7 @@ void MultiMCPage::on_modsDirBrowseBtn_clicked()
ui->modsDirTextBox->setText(cooked_dir);
}
}
void MultiMCPage::on_migrateDataFolderMacBtn_clicked()
void LauncherPage::on_migrateDataFolderMacBtn_clicked()
{
QFile file(QDir::current().absolutePath() + "/dontmovemacdata");
file.remove();
@ -163,7 +163,7 @@ void MultiMCPage::on_migrateDataFolderMacBtn_clicked()
qApp->quit();
}
void MultiMCPage::refreshUpdateChannelList()
void LauncherPage::refreshUpdateChannelList()
{
// Stop listening for selection changes. It's going to change a lot while we update it and
// we don't need to update the
@ -171,7 +171,7 @@ void MultiMCPage::refreshUpdateChannelList()
QObject::disconnect(ui->updateChannelComboBox, SIGNAL(currentIndexChanged(int)), this,
SLOT(updateChannelSelectionChanged(int)));
QList<UpdateChecker::ChannelListEntry> channelList = MMC->updateChecker()->getChannelList();
QList<UpdateChecker::ChannelListEntry> channelList = LAUNCHER->updateChecker()->getChannelList();
ui->updateChannelComboBox->clear();
int selection = -1;
for (int i = 0; i < channelList.count(); i++)
@ -208,15 +208,15 @@ void MultiMCPage::refreshUpdateChannelList()
ui->updateChannelComboBox->setEnabled(true);
}
void MultiMCPage::updateChannelSelectionChanged(int index)
void LauncherPage::updateChannelSelectionChanged(int index)
{
refreshUpdateChannelDesc();
}
void MultiMCPage::refreshUpdateChannelDesc()
void LauncherPage::refreshUpdateChannelDesc()
{
// Get the channel list.
QList<UpdateChecker::ChannelListEntry> channelList = MMC->updateChecker()->getChannelList();
QList<UpdateChecker::ChannelListEntry> channelList = LAUNCHER->updateChecker()->getChannelList();
int selectedIndex = ui->updateChannelComboBox->currentIndex();
if (selectedIndex < 0)
{
@ -235,9 +235,9 @@ void MultiMCPage::refreshUpdateChannelDesc()
}
}
void MultiMCPage::applySettings()
void LauncherPage::applySettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
if (ui->resetNotificationsBtn->isChecked())
{
@ -283,7 +283,7 @@ void MultiMCPage::applySettings()
if(original != s->get("IconTheme"))
{
MMC->setIconTheme(s->get("IconTheme").toString());
LAUNCHER->setIconTheme(s->get("IconTheme").toString());
}
auto originalAppTheme = s->get("ApplicationTheme").toString();
@ -291,7 +291,7 @@ void MultiMCPage::applySettings()
if(originalAppTheme != newAppTheme)
{
s->set("ApplicationTheme", newAppTheme);
MMC->setApplicationTheme(newAppTheme, false);
LAUNCHER->setApplicationTheme(newAppTheme, false);
}
// Console settings
@ -328,9 +328,9 @@ void MultiMCPage::applySettings()
s->set("Analytics", ui->analyticsCheck->isChecked());
}
}
void MultiMCPage::loadSettings()
void LauncherPage::loadSettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
// Updates
ui->autoUpdateCheckBox->setChecked(s->get("AutoUpdate").toBool());
m_currentUpdateChannel = s->get("UpdateChannel").toString();
@ -375,7 +375,7 @@ void MultiMCPage::loadSettings()
{
auto currentTheme = s->get("ApplicationTheme").toString();
auto themes = MMC->getValidApplicationThemes();
auto themes = LAUNCHER->getValidApplicationThemes();
int idx = 0;
for(auto &theme: themes)
{
@ -392,12 +392,12 @@ void MultiMCPage::loadSettings()
ui->showConsoleCheck->setChecked(s->get("ShowConsole").toBool());
ui->autoCloseConsoleCheck->setChecked(s->get("AutoCloseConsole").toBool());
ui->showConsoleErrorCheck->setChecked(s->get("ShowConsoleOnError").toBool());
QString fontFamily = MMC->settings()->get("ConsoleFont").toString();
QString fontFamily = LAUNCHER->settings()->get("ConsoleFont").toString();
QFont consoleFont(fontFamily);
ui->consoleFont->setCurrentFont(consoleFont);
bool conversionOk = true;
int fontSize = MMC->settings()->get("ConsoleFontSize").toInt(&conversionOk);
int fontSize = LAUNCHER->settings()->get("ConsoleFontSize").toInt(&conversionOk);
if(!conversionOk)
{
fontSize = 11;
@ -430,7 +430,7 @@ void MultiMCPage::loadSettings()
}
}
void MultiMCPage::refreshFontPreview()
void LauncherPage::refreshFontPreview()
{
int fontSize = ui->fontSizeBox->value();
QString fontFamily = ui->consoleFont->currentFont().family();

View File

@ -20,7 +20,7 @@
#include "java/JavaChecker.h"
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include "ColorCache.h"
#include <translations/TranslationsModel.h>
@ -29,16 +29,16 @@ class SettingsObject;
namespace Ui
{
class MultiMCPage;
class LauncherPage;
}
class MultiMCPage : public QWidget, public BasePage
class LauncherPage : public QWidget, public BasePage
{
Q_OBJECT
public:
explicit MultiMCPage(QWidget *parent = 0);
~MultiMCPage();
explicit LauncherPage(QWidget *parent = 0);
~LauncherPage();
QString displayName() const override
{
@ -46,7 +46,7 @@ public:
}
QIcon icon() const override
{
return MMC->getThemedIcon("multimc");
return LAUNCHER->getThemedIcon("multimc");
}
QString id() const override
{
@ -87,7 +87,7 @@ slots:
void updateChannelSelectionChanged(int index);
private:
Ui::MultiMCPage *ui;
Ui::LauncherPage *ui;
/*!
* Stores the currently selected update channel.

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MultiMCPage</class>
<widget class="QWidget" name="MultiMCPage">
<class>LauncherPage</class>
<widget class="QWidget" name="LauncherPage">
<property name="geometry">
<rect>
<x>0</x>

View File

@ -21,7 +21,7 @@
#include <QTabBar>
#include "settings/SettingsObject.h"
#include "MultiMC.h"
#include "Launcher.h"
MinecraftPage::MinecraftPage(QWidget *parent) : QWidget(parent), ui(new Ui::MinecraftPage)
{
@ -57,7 +57,7 @@ void MinecraftPage::on_maximizedCheckBox_clicked(bool checked)
void MinecraftPage::applySettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
// Window Size
s->set("LaunchMaximized", ui->maximizedCheckBox->isChecked());
@ -75,7 +75,7 @@ void MinecraftPage::applySettings()
void MinecraftPage::loadSettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
// Window Size
ui->maximizedCheckBox->setChecked(s->get("LaunchMaximized").toBool());

View File

@ -20,7 +20,7 @@
#include "java/JavaChecker.h"
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
class SettingsObject;
@ -43,7 +43,7 @@ public:
}
QIcon icon() const override
{
return MMC->getThemedIcon("minecraft");
return LAUNCHER->getThemedIcon("minecraft");
}
QString id() const override
{

View File

@ -23,7 +23,7 @@
#include "settings/SettingsObject.h"
#include "tools/BaseProfiler.h"
#include "MultiMC.h"
#include "Launcher.h"
PasteEEPage::PasteEEPage(QWidget *parent) :
QWidget(parent),
@ -42,7 +42,7 @@ PasteEEPage::~PasteEEPage()
void PasteEEPage::loadSettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
QString keyToUse = s->get("PasteEEAPIKey").toString();
if(keyToUse == "multimc")
{
@ -57,7 +57,7 @@ void PasteEEPage::loadSettings()
void PasteEEPage::applySettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
QString pasteKeyToUse;
if (ui->customButton->isChecked())

View File

@ -18,7 +18,7 @@
#include <QWidget>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
namespace Ui {
class PasteEEPage;
@ -38,7 +38,7 @@ public:
}
QIcon icon() const override
{
return MMC->getThemedIcon("log");
return LAUNCHER->getThemedIcon("log");
}
QString id() const override
{

View File

@ -19,7 +19,7 @@
#include <QTabBar>
#include "settings/SettingsObject.h"
#include "MultiMC.h"
#include "Launcher.h"
#include "Env.h"
ProxyPage::ProxyPage(QWidget *parent) : QWidget(parent), ui(new Ui::ProxyPage)
@ -58,7 +58,7 @@ void ProxyPage::proxyChanged(int)
void ProxyPage::applySettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
// Proxy
QString proxyType = "None";
@ -82,7 +82,7 @@ void ProxyPage::applySettings()
}
void ProxyPage::loadSettings()
{
auto s = MMC->settings();
auto s = LAUNCHER->settings();
// Proxy
QString proxyType = s->get("ProxyType").toString();
if (proxyType == "Default")

View File

@ -19,7 +19,7 @@
#include <QDialog>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
namespace Ui
{
@ -40,7 +40,7 @@ public:
}
QIcon icon() const override
{
return MMC->getThemedIcon("proxy");
return LAUNCHER->getThemedIcon("proxy");
}
QString id() const override
{

View File

@ -19,7 +19,7 @@
#include <QString>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
namespace Ui
{
@ -46,7 +46,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("settings");
return LAUNCHER->getThemedIcon("settings");
}
virtual QString id() const override
{

View File

@ -7,7 +7,7 @@
#include "dialogs/VersionSelectDialog.h"
#include "JavaCommon.h"
#include "MultiMC.h"
#include "Launcher.h"
#include <java/JavaInstallList.h>
#include <FileSystem.h>
@ -22,8 +22,8 @@ InstanceSettingsPage::InstanceSettingsPage(BaseInstance *inst, QWidget *parent)
auto sysMB = Sys::getSystemRam() / Sys::mebibyte;
ui->maxMemSpinBox->setMaximum(sysMB);
connect(ui->openGlobalJavaSettingsButton, &QCommandLinkButton::clicked, this, &InstanceSettingsPage::globalSettingsButtonClicked);
connect(MMC, &MultiMC::globalSettingsAboutToOpen, this, &InstanceSettingsPage::applySettings);
connect(MMC, &MultiMC::globalSettingsClosed, this, &InstanceSettingsPage::loadSettings);
connect(LAUNCHER, &Launcher::globalSettingsAboutToOpen, this, &InstanceSettingsPage::applySettings);
connect(LAUNCHER, &Launcher::globalSettingsClosed, this, &InstanceSettingsPage::loadSettings);
loadSettings();
}
@ -41,13 +41,13 @@ void InstanceSettingsPage::globalSettingsButtonClicked(bool)
{
switch(ui->settingsTabs->currentIndex()) {
case 0:
MMC->ShowGlobalSettings(this, "java-settings");
LAUNCHER->ShowGlobalSettings(this, "java-settings");
return;
case 1:
MMC->ShowGlobalSettings(this, "minecraft-settings");
LAUNCHER->ShowGlobalSettings(this, "minecraft-settings");
return;
case 2:
MMC->ShowGlobalSettings(this, "custom-commands");
LAUNCHER->ShowGlobalSettings(this, "custom-commands");
return;
}
}
@ -278,7 +278,7 @@ void InstanceSettingsPage::on_javaDetectBtn_clicked()
{
JavaInstallPtr java;
VersionSelectDialog vselect(MMC->javalist().get(), tr("Select a Java version"), this, true);
VersionSelectDialog vselect(LAUNCHER->javalist().get(), tr("Select a Java version"), this, true);
vselect.setResizeOn(2);
vselect.exec();

View File

@ -22,7 +22,7 @@
#include <QObjectPtr.h>
#include "pages/BasePage.h"
#include "JavaCommon.h"
#include "MultiMC.h"
#include "Launcher.h"
class JavaChecker;
namespace Ui
@ -43,7 +43,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("instance-settings");
return LAUNCHER->getThemedIcon("instance-settings");
}
virtual QString id() const override
{

View File

@ -4,7 +4,7 @@
#include "InstanceList.h"
#include "minecraft/legacy/LegacyInstance.h"
#include "minecraft/legacy/LegacyUpgradeTask.h"
#include "MultiMC.h"
#include "Launcher.h"
#include "dialogs/CustomMessageBox.h"
#include "dialogs/ProgressDialog.h"
@ -38,9 +38,9 @@ void LegacyUpgradePage::on_upgradeButton_clicked()
QString newName = tr("%1 (Migrated)").arg(m_inst->name());
auto upgradeTask = new LegacyUpgradeTask(m_inst);
upgradeTask->setName(newName);
upgradeTask->setGroup(MMC->instances()->getInstanceGroup(m_inst->id()));
upgradeTask->setGroup(LAUNCHER->instances()->getInstanceGroup(m_inst->id()));
upgradeTask->setIcon(m_inst->iconKey());
unique_qobject_ptr<Task> task(MMC->instances()->wrapInstanceTask(upgradeTask));
unique_qobject_ptr<Task> task(LAUNCHER->instances()->wrapInstanceTask(upgradeTask));
runModalTask(task.get());
}

View File

@ -19,7 +19,7 @@
#include "minecraft/legacy/LegacyInstance.h"
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include "tasks/Task.h"
namespace Ui
@ -40,7 +40,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("checkupdate");
return LAUNCHER->getThemedIcon("checkupdate");
}
virtual QString id() const override
{

View File

@ -1,7 +1,7 @@
#include "LogPage.h"
#include "ui_LogPage.h"
#include "MultiMC.h"
#include "Launcher.h"
#include <QIcon>
#include <QScrollBar>
@ -124,9 +124,9 @@ LogPage::LogPage(InstancePtr instance, QWidget *parent)
// set up fonts in the log proxy
{
QString fontFamily = MMC->settings()->get("ConsoleFont").toString();
QString fontFamily = LAUNCHER->settings()->get("ConsoleFont").toString();
bool conversionOk = false;
int fontSize = MMC->settings()->get("ConsoleFontSize").toInt(&conversionOk);
int fontSize = LAUNCHER->settings()->get("ConsoleFontSize").toInt(&conversionOk);
if(!conversionOk)
{
fontSize = 11;

View File

@ -20,7 +20,7 @@
#include "BaseInstance.h"
#include "launch/LaunchTask.h"
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
namespace Ui
{
@ -42,7 +42,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("log");
return LAUNCHER->getThemedIcon("log");
}
virtual QString id() const override
{

View File

@ -22,7 +22,7 @@
#include <QAbstractItemModel>
#include <QMenu>
#include "MultiMC.h"
#include "Launcher.h"
#include "dialogs/CustomMessageBox.h"
#include <GuiUtil.h>
#include "minecraft/mod/ModFolderModel.h"
@ -301,7 +301,7 @@ void ModFolderPage::on_actionAdd_triggered()
tr("Select %1",
"Select whatever type of files the page contains. Example: 'Loader Mods'")
.arg(m_displayName),
m_fileSelectionFilter.arg(m_displayName), MMC->settings()->get("CentralModsDir").toString(),
m_fileSelectionFilter.arg(m_displayName), LAUNCHER->settings()->get("CentralModsDir").toString(),
this->parentWidget());
if (!list.empty())
{

View File

@ -19,7 +19,7 @@
#include "minecraft/MinecraftInstance.h"
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
class ModFolderModel;
namespace Ui
@ -54,7 +54,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon(m_iconName);
return LAUNCHER->getThemedIcon(m_iconName);
}
virtual QString id() const override
{

View File

@ -19,7 +19,7 @@
#include "BaseInstance.h"
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
namespace Ui
{
@ -39,9 +39,9 @@ public:
}
virtual QIcon icon() const override
{
auto icon = MMC->getThemedIcon("notes");
auto icon = LAUNCHER->getThemedIcon("notes");
if(icon.isNull())
icon = MMC->getThemedIcon("news");
icon = LAUNCHER->getThemedIcon("news");
return icon;
}
virtual QString id() const override

View File

@ -129,9 +129,9 @@ void OtherLogsPage::on_btnReload_clicked()
{
auto setPlainText = [&](const QString & text)
{
QString fontFamily = MMC->settings()->get("ConsoleFont").toString();
QString fontFamily = LAUNCHER->settings()->get("ConsoleFont").toString();
bool conversionOk = false;
int fontSize = MMC->settings()->get("ConsoleFontSize").toInt(&conversionOk);
int fontSize = LAUNCHER->settings()->get("ConsoleFontSize").toInt(&conversionOk);
if(!conversionOk)
{
fontSize = 11;

View File

@ -18,7 +18,7 @@
#include <QWidget>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include <pathmatcher/IPathMatcher.h>
namespace Ui
@ -46,7 +46,7 @@ public:
}
QIcon icon() const override
{
return MMC->getThemedIcon("log");
return LAUNCHER->getThemedIcon("log");
}
QString helpPage() const override
{

View File

@ -15,7 +15,7 @@
#include <QKeyEvent>
#include <QMenu>
#include <MultiMC.h>
#include <Launcher.h>
#include "dialogs/ProgressDialog.h"
#include "dialogs/CustomMessageBox.h"
@ -104,7 +104,7 @@ public:
{
m_thumbnailingPool.setMaxThreadCount(4);
m_thumbnailCache = std::make_shared<SharedIconCache>();
m_thumbnailCache->add("placeholder", MMC->getThemedIcon("screenshot-placeholder"));
m_thumbnailCache->add("placeholder", LAUNCHER->getThemedIcon("screenshot-placeholder"));
connect(&watcher, SIGNAL(fileChanged(QString)), SLOT(fileChanged(QString)));
// FIXME: the watched file set is not updated when files are removed
}

View File

@ -18,7 +18,7 @@
#include <QMainWindow>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
class QFileSystemModel;
class QIdentityProxyModel;
@ -53,7 +53,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("screenshots");
return LAUNCHER->getThemedIcon("screenshots");
}
virtual QString id() const override
{

View File

@ -324,7 +324,7 @@ public:
if(px.loadFromData(bytes))
return QIcon(px);
}
return MMC->getThemedIcon("unknown_server");
return LAUNCHER->getThemedIcon("unknown_server");
}
case Qt::DisplayRole:
return m_servers[row].m_name;
@ -762,7 +762,7 @@ void ServersPage::on_actionMove_Down_triggered()
void ServersPage::on_actionJoin_triggered()
{
const auto &address = m_model->at(currentServer)->m_address;
MMC->launch(m_inst, true, nullptr, std::make_shared<MinecraftServerTarget>(MinecraftServerTarget::parse(address)));
LAUNCHER->launch(m_inst, true, nullptr, std::make_shared<MinecraftServerTarget>(MinecraftServerTarget::parse(address)));
}
#include "ServersPage.moc"

View File

@ -19,7 +19,7 @@
#include <QString>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
namespace Ui
{
@ -47,7 +47,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("unknown_server");
return LAUNCHER->getThemedIcon("unknown_server");
}
virtual QString id() const override
{

View File

@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "MultiMC.h"
#include "Launcher.h"
#include <QMessageBox>
#include <QLabel>
@ -70,14 +70,14 @@ public:
auto string = var.toString();
if(string == "warning")
{
return MMC->getThemedIcon("status-yellow");
return LAUNCHER->getThemedIcon("status-yellow");
}
else if(string == "error")
{
return MMC->getThemedIcon("status-bad");
return LAUNCHER->getThemedIcon("status-bad");
}
}
return MMC->getThemedIcon("status-good");
return LAUNCHER->getThemedIcon("status-good");
}
return var;
}
@ -93,7 +93,7 @@ private:
QIcon VersionPage::icon() const
{
return MMC->icons()->getIcon(m_inst->iconKey());
return LAUNCHER->icons()->getIcon(m_inst->iconKey());
}
bool VersionPage::shouldDisplay() const
{
@ -297,7 +297,7 @@ void VersionPage::on_actionInstall_mods_triggered()
void VersionPage::on_actionAdd_to_Minecraft_jar_triggered()
{
auto list = GuiUtil::BrowseForFiles("jarmod", tr("Select jar mods"), tr("Minecraft.jar mods (*.zip *.jar)"), MMC->settings()->get("CentralModsDir").toString(), this->parentWidget());
auto list = GuiUtil::BrowseForFiles("jarmod", tr("Select jar mods"), tr("Minecraft.jar mods (*.zip *.jar)"), LAUNCHER->settings()->get("CentralModsDir").toString(), this->parentWidget());
if(!list.empty())
{
m_profile->installJarMods(list);
@ -307,7 +307,7 @@ void VersionPage::on_actionAdd_to_Minecraft_jar_triggered()
void VersionPage::on_actionReplace_Minecraft_jar_triggered()
{
auto jarPath = GuiUtil::BrowseForFile("jar", tr("Select jar"), tr("Minecraft.jar replacement (*.jar)"), MMC->settings()->get("CentralModsDir").toString(), this->parentWidget());
auto jarPath = GuiUtil::BrowseForFile("jar", tr("Select jar"), tr("Minecraft.jar replacement (*.jar)"), LAUNCHER->settings()->get("CentralModsDir").toString(), this->parentWidget());
if(!jarPath.isEmpty())
{
m_profile->installCustomJar(jarPath);
@ -395,7 +395,7 @@ void VersionPage::on_actionChange_version_triggered()
void VersionPage::on_actionDownload_All_triggered()
{
if (!MMC->accounts()->anyAccountIsValid())
if (!LAUNCHER->accounts()->anyAccountIsValid())
{
CustomMessageBox::selectable(
this, tr("Error"),
@ -614,7 +614,7 @@ void VersionPage::on_actionEdit_triggered()
qWarning() << "file" << filename << "can't be opened for editing, doesn't exist!";
return;
}
MMC->openJsonEditor(filename);
LAUNCHER->openJsonEditor(filename);
}
void VersionPage::on_actionRevert_triggered()

View File

@ -26,7 +26,7 @@
#include <QInputDialog>
#include <tools/MCEditTool.h>
#include "MultiMC.h"
#include "Launcher.h"
#include <GuiUtil.h>
#include <QProcess>
#include <FileSystem.h>
@ -48,7 +48,7 @@ public:
auto iconFile = worlds->data(sourceIndex, WorldList::IconFileRole).toString();
if(iconFile.isNull()) {
// NOTE: Minecraft uses the same placeholder for servers AND worlds
return MMC->getThemedIcon("unknown_server");
return LAUNCHER->getThemedIcon("unknown_server");
}
return QIcon(iconFile);
}
@ -218,7 +218,7 @@ void WorldListPage::on_actionCopy_Seed_triggered()
return;
}
int64_t seed = m_worlds->data(index, WorldList::SeedRole).toLongLong();
MMC->clipboard()->setText(QString::number(seed));
LAUNCHER->clipboard()->setText(QString::number(seed));
}
void WorldListPage::on_actionMCEdit_triggered()
@ -226,7 +226,7 @@ void WorldListPage::on_actionMCEdit_triggered()
if(m_mceditStarting)
return;
auto mcedit = MMC->mcedit();
auto mcedit = LAUNCHER->mcedit();
const QString mceditPath = mcedit->path();

View File

@ -19,7 +19,7 @@
#include "minecraft/MinecraftInstance.h"
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include <LoggedProcess.h>
class WorldList;
@ -46,7 +46,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("worlds");
return LAUNCHER->getThemedIcon("worlds");
}
virtual QString id() const override
{

View File

@ -1,7 +1,7 @@
#include "ImportPage.h"
#include "ui_ImportPage.h"
#include "MultiMC.h"
#include "Launcher.h"
#include "dialogs/NewInstanceDialog.h"
#include <QFileDialog>
#include <QValidator>

View File

@ -18,7 +18,7 @@
#include <QWidget>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include "tasks/Task.h"
namespace Ui
@ -41,7 +41,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("viewfolder");
return LAUNCHER->getThemedIcon("viewfolder");
}
virtual QString id() const override
{

View File

@ -1,7 +1,7 @@
#include "VanillaPage.h"
#include "ui_VanillaPage.h"
#include "MultiMC.h"
#include "Launcher.h"
#include <meta/Index.h>
#include <meta/VersionList.h>

View File

@ -18,7 +18,7 @@
#include <QWidget>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include "tasks/Task.h"
namespace Ui
@ -41,7 +41,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("minecraft");
return LAUNCHER->getThemedIcon("minecraft");
}
virtual QString id() const override
{

View File

@ -1,7 +1,7 @@
#include "AtlListModel.h"
#include <BuildConfig.h>
#include <MultiMC.h>
#include <Launcher.h>
#include <Env.h>
#include <Json.h>
@ -48,7 +48,7 @@ QVariant ListModel::data(const QModelIndex &index, int role) const
{
return (m_logoMap.value(pack.safeName));
}
auto icon = MMC->getThemedIcon("atlauncher-placeholder");
auto icon = LAUNCHER->getThemedIcon("atlauncher-placeholder");
auto url = QString(BuildConfig.ATL_DOWNLOAD_SERVER_URL + "launcher/images/%1.png").arg(pack.safeName.toLower());
((ListModel *)this)->requestLogo(pack.safeName, url);

View File

@ -139,7 +139,7 @@ QVector<QString> AtlPage::chooseOptionalMods(QVector<ATLauncher::VersionMod> mod
}
QString AtlPage::chooseVersion(Meta::VersionListPtr vlist, QString minecraftVersion) {
VersionSelectDialog vselect(vlist.get(), "Choose Version", MMC->activeWindow(), false);
VersionSelectDialog vselect(vlist.get(), "Choose Version", LAUNCHER->activeWindow(), false);
if (minecraftVersion != Q_NULLPTR) {
vselect.setExactFilter(BaseVersionList::ParentVersionRole, minecraftVersion);
vselect.setEmptyString(tr("No versions are currently available for Minecraft %1").arg(minecraftVersion));

View File

@ -21,7 +21,7 @@
#include <QWidget>
#include <modplatform/atlauncher/ATLPackInstallTask.h>
#include "MultiMC.h"
#include "Launcher.h"
#include "pages/BasePage.h"
#include "tasks/Task.h"
@ -45,7 +45,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("atlauncher");
return LAUNCHER->getThemedIcon("atlauncher");
}
virtual QString id() const override
{

View File

@ -1,5 +1,5 @@
#include "FlameModel.h"
#include "MultiMC.h"
#include "Launcher.h"
#include <Json.h>
#include <MMCStrings.h>
@ -62,7 +62,7 @@ QVariant ListModel::data(const QModelIndex &index, int role) const
{
return (m_logoMap.value(pack.logoName));
}
QIcon icon = MMC->getThemedIcon("screenshot-placeholder");
QIcon icon = LAUNCHER->getThemedIcon("screenshot-placeholder");
((ListModel *)this)->requestLogo(pack.logoName, pack.logoUrl);
return icon;
}

View File

@ -1,7 +1,7 @@
#include "FlamePage.h"
#include "ui_FlamePage.h"
#include "MultiMC.h"
#include "Launcher.h"
#include <Json.h>
#include "dialogs/NewInstanceDialog.h"
#include <InstanceImportTask.h>

View File

@ -18,7 +18,7 @@
#include <QWidget>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include "tasks/Task.h"
#include <modplatform/flame/FlamePackIndex.h>
@ -46,7 +46,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("flame");
return LAUNCHER->getThemedIcon("flame");
}
virtual QString id() const override
{

View File

@ -2,7 +2,7 @@
#include "BuildConfig.h"
#include "Env.h"
#include "MultiMC.h"
#include "Launcher.h"
#include "Json.h"
#include <QPainter>
@ -46,7 +46,7 @@ QVariant ListModel::data(const QModelIndex &index, int role) const
}
else if(role == Qt::DecorationRole)
{
QIcon placeholder = MMC->getThemedIcon("screenshot-placeholder");
QIcon placeholder = LAUNCHER->getThemedIcon("screenshot-placeholder");
auto iter = m_logoMap.find(pack.name);
if (iter != m_logoMap.end()) {

View File

@ -20,7 +20,7 @@
#include <QWidget>
#include "MultiMC.h"
#include "Launcher.h"
#include "pages/BasePage.h"
#include "tasks/Task.h"
@ -44,7 +44,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("ftb_logo");
return LAUNCHER->getThemedIcon("ftb_logo");
}
virtual QString id() const override
{

View File

@ -1,5 +1,5 @@
#include "ListModel.h"
#include "MultiMC.h"
#include "Launcher.h"
#include <MMCStrings.h>
#include <Version.h>
@ -130,7 +130,7 @@ QVariant ListModel::data(const QModelIndex &index, int role) const
{
return (m_logoMap.value(pack.logo));
}
QIcon icon = MMC->getThemedIcon("screenshot-placeholder");
QIcon icon = LAUNCHER->getThemedIcon("screenshot-placeholder");
((ListModel *)this)->requestLogo(pack.logo);
return icon;
}

View File

@ -3,7 +3,7 @@
#include <QInputDialog>
#include "MultiMC.h"
#include "Launcher.h"
#include "dialogs/CustomMessageBox.h"
#include "dialogs/NewInstanceDialog.h"
#include "modplatform/legacy_ftb/PackFetchTask.h"

View File

@ -20,7 +20,7 @@
#include <QTextBrowser>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include "tasks/Task.h"
#include "modplatform/legacy_ftb/PackHelpers.h"
#include "modplatform/legacy_ftb/PackFetchTask.h"
@ -54,7 +54,7 @@ public:
}
QIcon icon() const override
{
return MMC->getThemedIcon("ftb_logo");
return LAUNCHER->getThemedIcon("ftb_logo");
}
QString id() const override
{

View File

@ -15,7 +15,7 @@
#include "TechnicModel.h"
#include "Env.h"
#include "MultiMC.h"
#include "Launcher.h"
#include "Json.h"
#include <QIcon>
@ -47,7 +47,7 @@ QVariant Technic::ListModel::data(const QModelIndex& index, int role) const
{
return (m_logoMap.value(pack.logoName));
}
QIcon icon = MMC->getThemedIcon("screenshot-placeholder");
QIcon icon = LAUNCHER->getThemedIcon("screenshot-placeholder");
((ListModel *)this)->requestLogo(pack.logoName, pack.logoUrl);
return icon;
}

View File

@ -16,7 +16,7 @@
#include "TechnicPage.h"
#include "ui_TechnicPage.h"
#include "MultiMC.h"
#include "Launcher.h"
#include "dialogs/NewInstanceDialog.h"
#include "TechnicModel.h"
#include <QKeyEvent>

View File

@ -18,7 +18,7 @@
#include <QWidget>
#include "pages/BasePage.h"
#include <MultiMC.h>
#include <Launcher.h>
#include "tasks/Task.h"
#include "TechnicData.h"
@ -46,7 +46,7 @@ public:
}
virtual QIcon icon() const override
{
return MMC->getThemedIcon("technic");
return LAUNCHER->getThemedIcon("technic");
}
virtual QString id() const override
{