aboutsummaryrefslogtreecommitdiff
path: root/launcher/dialogs
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2021-10-13 01:59:25 +0200
committerPetr Mrázek <peterix@gmail.com>2021-10-21 00:47:53 +0200
commit441ab7eedcb8fe120a7f934684ed5545cdd7a4b6 (patch)
tree5a1a93e871f5172b3f087e9eb04bf6918bd34ec7 /launcher/dialogs
parent6a4130c9149deb029b496c81e3b874ad834c54b7 (diff)
downloadPrismLauncher-441ab7eedcb8fe120a7f934684ed5545cdd7a4b6.tar.gz
PrismLauncher-441ab7eedcb8fe120a7f934684ed5545cdd7a4b6.tar.bz2
PrismLauncher-441ab7eedcb8fe120a7f934684ed5545cdd7a4b6.zip
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.
Diffstat (limited to 'launcher/dialogs')
-rw-r--r--launcher/dialogs/AboutDialog.cpp4
-rw-r--r--launcher/dialogs/CopyInstanceDialog.cpp10
-rw-r--r--launcher/dialogs/ExportInstanceDialog.cpp4
-rw-r--r--launcher/dialogs/IconPickerDialog.cpp12
-rw-r--r--launcher/dialogs/NewComponentDialog.cpp4
-rw-r--r--launcher/dialogs/NewInstanceDialog.cpp24
-rw-r--r--launcher/dialogs/ProfileSelectDialog.cpp4
-rw-r--r--launcher/dialogs/UpdateDialog.cpp12
-rw-r--r--launcher/dialogs/VersionSelectDialog.cpp2
9 files changed, 38 insertions, 38 deletions
diff --git a/launcher/dialogs/AboutDialog.cpp b/launcher/dialogs/AboutDialog.cpp
index c97c471e..890f9f80 100644
--- a/launcher/dialogs/AboutDialog.cpp
+++ b/launcher/dialogs/AboutDialog.cpp
@@ -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());
diff --git a/launcher/dialogs/CopyInstanceDialog.cpp b/launcher/dialogs/CopyInstanceDialog.cpp
index 5fe90334..802016d9 100644
--- a/launcher/dialogs/CopyInstanceDialog.cpp
+++ b/launcher/dialogs/CopyInstanceDialog.cpp
@@ -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));
}
}
diff --git a/launcher/dialogs/ExportInstanceDialog.cpp b/launcher/dialogs/ExportInstanceDialog.cpp
index a42779d4..639b7043 100644
--- a/launcher/dialogs/ExportInstanceDialog.cpp
+++ b/launcher/dialogs/ExportInstanceDialog.cpp
@@ -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;
diff --git a/launcher/dialogs/IconPickerDialog.cpp b/launcher/dialogs/IconPickerDialog.cpp
index 90436554..3878d8e3 100644
--- a/launcher/dialogs/IconPickerDialog.cpp
+++ b/launcher/dialogs/IconPickerDialog.cpp
@@ -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);
}
diff --git a/launcher/dialogs/NewComponentDialog.cpp b/launcher/dialogs/NewComponentDialog.cpp
index f4d6274f..1cea54f4 100644
--- a/launcher/dialogs/NewComponentDialog.cpp
+++ b/launcher/dialogs/NewComponentDialog.cpp
@@ -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();
diff --git a/launcher/dialogs/NewInstanceDialog.cpp b/launcher/dialogs/NewInstanceDialog.cpp
index 86963149..d18eb3d5 100644
--- a/launcher/dialogs/NewInstanceDialog.cpp
+++ b/launcher/dialogs/NewInstanceDialog.cpp
@@ -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());
}
diff --git a/launcher/dialogs/ProfileSelectDialog.cpp b/launcher/dialogs/ProfileSelectDialog.cpp
index e2ad73e4..1082748f 100644
--- a/launcher/dialogs/ProfileSelectDialog.cpp
+++ b/launcher/dialogs/ProfileSelectDialog.cpp
@@ -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);
diff --git a/launcher/dialogs/UpdateDialog.cpp b/launcher/dialogs/UpdateDialog.cpp
index 2baaf5e9..04732d1b 100644
--- a/launcher/dialogs/UpdateDialog.cpp
+++ b/launcher/dialogs/UpdateDialog.cpp
@@ -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);
}
diff --git a/launcher/dialogs/VersionSelectDialog.cpp b/launcher/dialogs/VersionSelectDialog.cpp
index ed1210ba..82eb70f4 100644
--- a/launcher/dialogs/VersionSelectDialog.cpp
+++ b/launcher/dialogs/VersionSelectDialog.cpp
@@ -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>