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

@@ -16,7 +16,7 @@
#include "AboutDialog.h"
#include "ui_AboutDialog.h"
#include <QIcon>
#include "MultiMC.h"
#include "Launcher.h"
#include "BuildConfig.h"
#include <net/NetJob.h>
@@ -83,7 +83,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia
ui->urlLabel->setOpenExternalLinks(true);
ui->icon->setPixmap(MMC->getThemedIcon("logo").pixmap(64));
ui->icon->setPixmap(LAUNCHER->getThemedIcon("logo").pixmap(64));
ui->title->setText("MultiMC 5");
ui->versionLabel->setText(tr("Version") +": " + BuildConfig.printableVersionString());

View File

@@ -16,7 +16,7 @@
#include <QLayout>
#include <QPushButton>
#include "MultiMC.h"
#include "Launcher.h"
#include "CopyInstanceDialog.h"
#include "ui_CopyInstanceDialog.h"
@@ -36,16 +36,16 @@ CopyInstanceDialog::CopyInstanceDialog(InstancePtr original, QWidget *parent)
layout()->setSizeConstraint(QLayout::SetFixedSize);
InstIconKey = original->iconKey();
ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
ui->iconButton->setIcon(LAUNCHER->icons()->getIcon(InstIconKey));
ui->instNameTextBox->setText(original->name());
ui->instNameTextBox->setFocus();
auto groups = MMC->instances()->getGroups().toSet();
auto groups = LAUNCHER->instances()->getGroups().toSet();
auto groupList = QStringList(groups.toList());
groupList.sort(Qt::CaseInsensitive);
groupList.removeOne("");
groupList.push_front("");
ui->groupBox->addItems(groupList);
int index = groupList.indexOf(MMC->instances()->getInstanceGroup(m_original->id()));
int index = groupList.indexOf(LAUNCHER->instances()->getInstanceGroup(m_original->id()));
if(index == -1)
{
index = 0;
@@ -99,7 +99,7 @@ void CopyInstanceDialog::on_iconButton_clicked()
if (dlg.result() == QDialog::Accepted)
{
InstIconKey = dlg.selectedIconKey;
ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
ui->iconButton->setIcon(LAUNCHER->icons()->getIcon(InstIconKey));
}
}

View File

@@ -27,7 +27,7 @@
#include <QSaveFile>
#include "MMCStrings.h"
#include "SeparatorPrefixTree.h"
#include "MultiMC.h"
#include "Launcher.h"
#include <icons/IconList.h>
#include <FileSystem.h>
@@ -341,7 +341,7 @@ ExportInstanceDialog::~ExportInstanceDialog()
void SaveIcon(InstancePtr m_instance)
{
auto iconKey = m_instance->iconKey();
auto iconList = MMC->icons();
auto iconList = LAUNCHER->icons();
auto mmcIcon = iconList->icon(iconKey);
if(!mmcIcon || mmcIcon->isBuiltIn()) {
return;

View File

@@ -17,7 +17,7 @@
#include <QPushButton>
#include <QFileDialog>
#include "MultiMC.h"
#include "Launcher.h"
#include "IconPickerDialog.h"
#include "ui_IconPickerDialog.h"
@@ -59,7 +59,7 @@ IconPickerDialog::IconPickerDialog(QWidget *parent)
contentsWidget->installEventFilter(this);
contentsWidget->setModel(MMC->icons().get());
contentsWidget->setModel(LAUNCHER->icons().get());
// NOTE: ResetRole forces the button to be on the left, while the OK/Cancel ones are on the right. We win.
auto buttonAdd = ui->buttonBox->addButton(tr("Add Icon"), QDialogButtonBox::ResetRole);
@@ -106,12 +106,12 @@ void IconPickerDialog::addNewIcon()
//: The type of icon files
auto filter = IconUtils::getIconFilter();
QStringList fileNames = QFileDialog::getOpenFileNames(this, selectIcons, QString(), tr("Icons %1").arg(filter));
MMC->icons()->installIcons(fileNames);
LAUNCHER->icons()->installIcons(fileNames);
}
void IconPickerDialog::removeSelectedIcon()
{
MMC->icons()->deleteIcon(selectedIconKey);
LAUNCHER->icons()->deleteIcon(selectedIconKey);
}
void IconPickerDialog::activated(QModelIndex index)
@@ -132,7 +132,7 @@ void IconPickerDialog::selectionChanged(QItemSelection selected, QItemSelection
int IconPickerDialog::execWithSelection(QString selection)
{
auto list = MMC->icons();
auto list = LAUNCHER->icons();
auto contentsWidget = ui->iconView;
selectedIconKey = selection;
@@ -159,5 +159,5 @@ IconPickerDialog::~IconPickerDialog()
void IconPickerDialog::openFolder()
{
DesktopServices::openDirectory(MMC->icons()->getDirectory(), true);
DesktopServices::openDirectory(LAUNCHER->icons()->getDirectory(), true);
}

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "MultiMC.h"
#include "Launcher.h"
#include "NewComponentDialog.h"
#include "ui_NewComponentDialog.h"
@@ -46,7 +46,7 @@ NewComponentDialog::NewComponentDialog(const QString & initialName, const QStrin
connect(ui->nameTextBox, &QLineEdit::textChanged, this, &NewComponentDialog::updateDialogState);
connect(ui->uidTextBox, &QLineEdit::textChanged, this, &NewComponentDialog::updateDialogState);
auto groups = MMC->instances()->getGroups().toSet();
auto groups = LAUNCHER->instances()->getGroups().toSet();
ui->nameTextBox->setFocus();
originalPlaceholderText = ui->uidTextBox->placeholderText();

View File

@@ -13,7 +13,7 @@
* limitations under the License.
*/
#include "MultiMC.h"
#include "Launcher.h"
#include "NewInstanceDialog.h"
#include "ui_NewInstanceDialog.h"
@@ -48,12 +48,12 @@ NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, const QString
{
ui->setupUi(this);
setWindowIcon(MMC->getThemedIcon("new"));
setWindowIcon(LAUNCHER->getThemedIcon("new"));
InstIconKey = "default";
ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
ui->iconButton->setIcon(LAUNCHER->icons()->getIcon(InstIconKey));
auto groups = MMC->instances()->getGroups().toSet();
auto groups = LAUNCHER->instances()->getGroups().toSet();
auto groupList = QStringList(groups.toList());
groupList.sort(Qt::CaseInsensitive);
groupList.removeOne("");
@@ -105,18 +105,18 @@ NewInstanceDialog::NewInstanceDialog(const QString & initialGroup, const QString
updateDialogState();
restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("NewInstanceGeometry").toByteArray()));
restoreGeometry(QByteArray::fromBase64(LAUNCHER->settings()->get("NewInstanceGeometry").toByteArray()));
}
void NewInstanceDialog::reject()
{
MMC->settings()->set("NewInstanceGeometry", saveGeometry().toBase64());
LAUNCHER->settings()->set("NewInstanceGeometry", saveGeometry().toBase64());
QDialog::reject();
}
void NewInstanceDialog::accept()
{
MMC->settings()->set("NewInstanceGeometry", saveGeometry().toBase64());
LAUNCHER->settings()->set("NewInstanceGeometry", saveGeometry().toBase64());
importIconNow();
QDialog::accept();
}
@@ -155,7 +155,7 @@ void NewInstanceDialog::setSuggestedPack(const QString& name, InstanceTask* task
if(!task)
{
ui->iconButton->setIcon(MMC->icons()->getIcon("default"));
ui->iconButton->setIcon(LAUNCHER->icons()->getIcon("default"));
importIcon = false;
}
@@ -175,7 +175,7 @@ void NewInstanceDialog::setSuggestedIconFromFile(const QString &path, const QStr
void NewInstanceDialog::setSuggestedIcon(const QString &key)
{
auto icon = MMC->icons()->getIcon(key);
auto icon = LAUNCHER->icons()->getIcon(key);
importIcon = false;
ui->iconButton->setIcon(icon);
@@ -234,7 +234,7 @@ void NewInstanceDialog::on_iconButton_clicked()
if (dlg.result() == QDialog::Accepted)
{
InstIconKey = dlg.selectedIconKey;
ui->iconButton->setIcon(MMC->icons()->getIcon(InstIconKey));
ui->iconButton->setIcon(LAUNCHER->icons()->getIcon(InstIconKey));
importIcon = false;
}
}
@@ -247,9 +247,9 @@ void NewInstanceDialog::on_instNameTextBox_textChanged(const QString &arg1)
void NewInstanceDialog::importIconNow()
{
if(importIcon) {
MMC->icons()->installIcon(importIconPath, importIconName);
LAUNCHER->icons()->installIcon(importIconPath, importIconName);
InstIconKey = importIconName;
importIcon = false;
}
MMC->settings()->set("NewInstanceGeometry", saveGeometry().toBase64());
LAUNCHER->settings()->set("NewInstanceGeometry", saveGeometry().toBase64());
}

View File

@@ -23,14 +23,14 @@
#include <dialogs/ProgressDialog.h>
#include <MultiMC.h>
#include <Launcher.h>
ProfileSelectDialog::ProfileSelectDialog(const QString &message, int flags, QWidget *parent)
: QDialog(parent), ui(new Ui::ProfileSelectDialog)
{
ui->setupUi(this);
m_accounts = MMC->accounts();
m_accounts = LAUNCHER->accounts();
auto view = ui->listView;
//view->setModel(m_accounts.get());
//view->hideColumn(AccountList::ActiveColumn);

View File

@@ -1,7 +1,7 @@
#include "UpdateDialog.h"
#include "ui_UpdateDialog.h"
#include <QDebug>
#include "MultiMC.h"
#include "Launcher.h"
#include <settings/SettingsObject.h>
#include <Json.h>
@@ -11,7 +11,7 @@
UpdateDialog::UpdateDialog(bool hasUpdate, QWidget *parent) : QDialog(parent), ui(new Ui::UpdateDialog)
{
ui->setupUi(this);
auto channel = MMC->settings()->get("UpdateChannel").toString();
auto channel = LAUNCHER->settings()->get("UpdateChannel").toString();
if(hasUpdate)
{
ui->label->setText(tr("A new %1 update is available!").arg(channel));
@@ -24,7 +24,7 @@ UpdateDialog::UpdateDialog(bool hasUpdate, QWidget *parent) : QDialog(parent), u
}
ui->changelogBrowser->setHtml(tr("<center><h1>Loading changelog...</h1></center>"));
loadChangelog();
restoreGeometry(QByteArray::fromBase64(MMC->settings()->get("UpdateDialogGeometry").toByteArray()));
restoreGeometry(QByteArray::fromBase64(LAUNCHER->settings()->get("UpdateDialogGeometry").toByteArray()));
}
UpdateDialog::~UpdateDialog()
@@ -33,7 +33,7 @@ UpdateDialog::~UpdateDialog()
void UpdateDialog::loadChangelog()
{
auto channel = MMC->settings()->get("UpdateChannel").toString();
auto channel = LAUNCHER->settings()->get("UpdateChannel").toString();
dljob.reset(new NetJob("Changelog"));
QString url;
if(channel == "stable")
@@ -65,7 +65,7 @@ QString reprocessMarkdown(QByteArray markdown)
QString reprocessCommits(QByteArray json)
{
auto channel = MMC->settings()->get("UpdateChannel").toString();
auto channel = LAUNCHER->settings()->get("UpdateChannel").toString();
try
{
QString result;
@@ -177,6 +177,6 @@ void UpdateDialog::on_btnUpdateNow_clicked()
void UpdateDialog::closeEvent(QCloseEvent* evt)
{
MMC->settings()->set("UpdateDialogGeometry", saveGeometry().toBase64());
LAUNCHER->settings()->set("UpdateDialogGeometry", saveGeometry().toBase64());
QDialog::closeEvent(evt);
}

View File

@@ -28,7 +28,7 @@
#include <BaseVersionList.h>
#include <tasks/Task.h>
#include <QDebug>
#include "MultiMC.h"
#include "Launcher.h"
#include <VersionProxyModel.h>
#include <widgets/VersionSelectWidget.h>