fix: use display name in code

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2022-10-18 09:50:27 +02:00
parent 722194405a
commit 3ac398ac49
No known key found for this signature in database
GPG Key ID: C10411294912A422
14 changed files with 26 additions and 27 deletions

View File

@ -224,9 +224,9 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
consoleAttached = true; consoleAttached = true;
} }
#endif #endif
setOrganizationName(BuildConfig.LAUNCHER_NAME); setOrganizationName(BuildConfig.LAUNCHER_DISPLAYNAME);
setOrganizationDomain(BuildConfig.LAUNCHER_DOMAIN); setOrganizationDomain(BuildConfig.LAUNCHER_DOMAIN);
setApplicationName(BuildConfig.LAUNCHER_NAME); setApplicationName(BuildConfig.LAUNCHER_DISPLAYNAME);
setApplicationDisplayName(QString("%1 %2").arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString())); setApplicationDisplayName(QString("%1 %2").arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString()));
setApplicationVersion(BuildConfig.printableVersionString()); setApplicationVersion(BuildConfig.printableVersionString());
setDesktopFileName(BuildConfig.LAUNCHER_DESKTOPFILENAME); setDesktopFileName(BuildConfig.LAUNCHER_DESKTOPFILENAME);
@ -237,7 +237,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
// Commandline parsing // Commandline parsing
QCommandLineParser parser; QCommandLineParser parser;
parser.setApplicationDescription(BuildConfig.LAUNCHER_NAME); parser.setApplicationDescription(BuildConfig.LAUNCHER_DISPLAYNAME);
parser.addOptions({ parser.addOptions({
{{"d", "dir"}, "Use a custom path as application root (use '.' for current directory)", "directory"}, {{"d", "dir"}, "Use a custom path as application root (use '.' for current directory)", "directory"},

View File

@ -355,7 +355,7 @@ QString BaseInstance::name() const
QString BaseInstance::windowTitle() const QString BaseInstance::windowTitle() const
{ {
return BuildConfig.LAUNCHER_NAME + ": " + name().replace(QRegularExpression("\\s+"), " "); return BuildConfig.LAUNCHER_DISPLAYNAME + ": " + name().replace(QRegularExpression("\\s+"), " ");
} }
// FIXME: why is this here? move it to MinecraftInstance!!! // FIXME: why is this here? move it to MinecraftInstance!!!

View File

@ -382,7 +382,7 @@ void LaunchController::launchInstance()
m_launcher->prependStep(new TextPrint(m_launcher.get(), "Launched instance in " + online_mode + " mode\n", MessageLevel::Launcher)); m_launcher->prependStep(new TextPrint(m_launcher.get(), "Launched instance in " + online_mode + " mode\n", MessageLevel::Launcher));
// Prepend Version // Prepend Version
m_launcher->prependStep(new TextPrint(m_launcher.get(), BuildConfig.LAUNCHER_NAME + " version: " + BuildConfig.printableVersionString() + "\n\n", MessageLevel::Launcher)); m_launcher->prependStep(new TextPrint(m_launcher.get(), BuildConfig.LAUNCHER_DISPLAYNAME + " version: " + BuildConfig.printableVersionString() + "\n\n", MessageLevel::Launcher));
m_launcher->start(); m_launcher->start();
} }

View File

@ -358,7 +358,7 @@ void UpdateController::fail()
msg = QObject::tr( msg = QObject::tr(
"Couldn't replace file %1. Changes will be reverted.\n" "Couldn't replace file %1. Changes will be reverted.\n"
"See the %2 log file for details." "See the %2 log file for details."
).arg(m_failedFile, BuildConfig.LAUNCHER_NAME); ).arg(m_failedFile, BuildConfig.LAUNCHER_DISPLAYNAME);
doRollback = true; doRollback = true;
QMessageBox::critical(m_parent, failTitle, msg); QMessageBox::critical(m_parent, failTitle, msg);
break; break;
@ -368,7 +368,7 @@ void UpdateController::fail()
msg = QObject::tr( msg = QObject::tr(
"Couldn't remove file %1. Changes will be reverted.\n" "Couldn't remove file %1. Changes will be reverted.\n"
"See the %2 log file for details." "See the %2 log file for details."
).arg(m_failedFile, BuildConfig.LAUNCHER_NAME); ).arg(m_failedFile, BuildConfig.LAUNCHER_DISPLAYNAME);
doRollback = true; doRollback = true;
QMessageBox::critical(m_parent, failTitle, msg); QMessageBox::critical(m_parent, failTitle, msg);
break; break;
@ -399,7 +399,7 @@ void UpdateController::fail()
{ {
msg = QObject::tr("The rollback failed too.\n" msg = QObject::tr("The rollback failed too.\n"
"You will have to repair %1 manually.\n" "You will have to repair %1 manually.\n"
"Please let us know why and how this happened.").arg(BuildConfig.LAUNCHER_NAME); "Please let us know why and how this happened.").arg(BuildConfig.LAUNCHER_DISPLAYNAME);
QMessageBox::critical(m_parent, rollFailTitle, msg); QMessageBox::critical(m_parent, rollFailTitle, msg);
qApp->quit(); qApp->quit();
} }

View File

@ -214,7 +214,7 @@ void MojangVersionFormat::readVersionProperties(const QJsonObject &in, VersionFi
QObject::tr("The 'minimumLauncherVersion' value of this version (%1) is higher than supported by %3 (%2). It might not work properly!") QObject::tr("The 'minimumLauncherVersion' value of this version (%1) is higher than supported by %3 (%2). It might not work properly!")
.arg(out->minimumLauncherVersion) .arg(out->minimumLauncherVersion)
.arg(CURRENT_MINIMUM_LAUNCHER_VERSION) .arg(CURRENT_MINIMUM_LAUNCHER_VERSION)
.arg(BuildConfig.LAUNCHER_NAME) .arg(BuildConfig.LAUNCHER_DISPLAYNAME)
); );
} }
} }

View File

@ -161,7 +161,7 @@ public:
QString result; QString result;
result = QApplication::translate("MainWindow", m_text); result = QApplication::translate("MainWindow", m_text);
if(result.contains("%1")) { if(result.contains("%1")) {
result = result.arg(BuildConfig.LAUNCHER_NAME); result = result.arg(BuildConfig.LAUNCHER_DISPLAYNAME);
} }
m_contained->setText(result); m_contained->setText(result);
} }
@ -170,7 +170,7 @@ public:
QString result; QString result;
result = QApplication::translate("MainWindow", m_tooltip); result = QApplication::translate("MainWindow", m_tooltip);
if(result.contains("%1")) { if(result.contains("%1")) {
result = result.arg(BuildConfig.LAUNCHER_NAME); result = result.arg(BuildConfig.LAUNCHER_DISPLAYNAME);
} }
m_contained->setToolTip(result); m_contained->setToolTip(result);
} }
@ -829,7 +829,7 @@ public:
MainWindow->setWindowIcon(APPLICATION->getThemedIcon("logo")); MainWindow->setWindowIcon(APPLICATION->getThemedIcon("logo"));
MainWindow->setWindowTitle(APPLICATION->applicationDisplayName()); MainWindow->setWindowTitle(APPLICATION->applicationDisplayName());
#ifndef QT_NO_ACCESSIBILITY #ifndef QT_NO_ACCESSIBILITY
MainWindow->setAccessibleName(BuildConfig.LAUNCHER_NAME); MainWindow->setAccessibleName(BuildConfig.LAUNCHER_DISPLAYNAME);
#endif #endif
createMainToolbarActions(MainWindow); createMainToolbarActions(MainWindow);
@ -1146,7 +1146,7 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
{ {
auto group = view->groupNameAt(pos); auto group = view->groupNameAt(pos);
QAction *actionVoid = new QAction(BuildConfig.LAUNCHER_NAME, this); QAction *actionVoid = new QAction(BuildConfig.LAUNCHER_DISPLAYNAME, this);
actionVoid->setEnabled(false); actionVoid->setEnabled(false);
QAction *actionCreateInstance = new QAction(tr("Create instance"), this); QAction *actionCreateInstance = new QAction(tr("Create instance"), this);
@ -2239,7 +2239,7 @@ void MainWindow::checkInstancePathForProblems()
"You have now two options: <br/>" "You have now two options: <br/>"
" - change the instance folder in the settings <br/>" " - change the instance folder in the settings <br/>"
" - move this installation of %1 to a different folder" " - move this installation of %1 to a different folder"
).arg(BuildConfig.LAUNCHER_NAME) ).arg(BuildConfig.LAUNCHER_DISPLAYNAME)
); );
warning.setDefaultButton(QMessageBox::Ok); warning.setDefaultButton(QMessageBox::Ok);
warning.exec(); warning.exec();

View File

@ -70,8 +70,7 @@ QString getCreditsHtml()
stream << "<center>\n"; stream << "<center>\n";
//: %1 is the name of the launcher, determined at build time, e.g. "PolyMC Developers" //: %1 is the name of the launcher, determined at build time, e.g. "PolyMC Developers"
stream << "<h3>" << QObject::tr("%1 Developers", "About Credits").arg(BuildConfig.LAUNCHER_NAME) << "</h3>\n"; stream << "<h3>" << QObject::tr("%1 Developers", "About Credits").arg(BuildConfig.LAUNCHER_DISPLAYNAME) << "</h3>\n";
stream << QString("<p>LennyMcLennington %1</p>\n") .arg(getGitHub("LennyMcLennington"));
stream << QString("<p>Sefa Eyeoglu (Scrumplex) %1</p>\n") .arg(getWebsite("https://scrumplex.net")); stream << QString("<p>Sefa Eyeoglu (Scrumplex) %1</p>\n") .arg(getWebsite("https://scrumplex.net"));
stream << QString("<p>dada513 %1</p>\n") .arg(getGitHub("dada513")); stream << QString("<p>dada513 %1</p>\n") .arg(getGitHub("dada513"));
stream << QString("<p>txtsd %1</p>\n") .arg(getGitHub("txtsd")); stream << QString("<p>txtsd %1</p>\n") .arg(getGitHub("txtsd"));
@ -81,7 +80,7 @@ QString getCreditsHtml()
stream << "<br />\n"; stream << "<br />\n";
//: %1 is the name of the launcher, determined at build time, e.g. "PolyMC Contributors" //: %1 is the name of the launcher, determined at build time, e.g. "PolyMC Contributors"
stream << "<h3>" << QObject::tr("%1 Contributors", "About Credits").arg(BuildConfig.LAUNCHER_NAME) << "</h3>\n"; stream << "<h3>" << QObject::tr("%1 Contributors", "About Credits").arg(BuildConfig.LAUNCHER_DISPLAYNAME) << "</h3>\n";
stream << QString("<p>DioEgizio %1</p>\n") .arg(getGitHub("DioEgizio")); stream << QString("<p>DioEgizio %1</p>\n") .arg(getGitHub("DioEgizio"));
stream << QString("<p>flowln %1</p>\n") .arg(getGitHub("flowln")); stream << QString("<p>flowln %1</p>\n") .arg(getGitHub("flowln"));
stream << QString("<p>swirl %1</p>\n") .arg(getWebsite("https://swurl.xyz/")); stream << QString("<p>swirl %1</p>\n") .arg(getWebsite("https://swurl.xyz/"));
@ -125,7 +124,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia
{ {
ui->setupUi(this); ui->setupUi(this);
QString launcherName = BuildConfig.LAUNCHER_NAME; QString launcherName = BuildConfig.LAUNCHER_DISPLAYNAME;
setWindowTitle(tr("About %1").arg(launcherName)); setWindowTitle(tr("About %1").arg(launcherName));

View File

@ -167,7 +167,7 @@ void AccountListPage::on_actionAddMicrosoft_triggered()
tr( tr(
"Microsoft accounts are only usable on macOS 10.13 or newer, with fully updated %1.\n\n" "Microsoft accounts are only usable on macOS 10.13 or newer, with fully updated %1.\n\n"
"Please update both your operating system and %1." "Please update both your operating system and %1."
).arg(BuildConfig.LAUNCHER_NAME), ).arg(BuildConfig.LAUNCHER_DISPLAYNAME),
QMessageBox::Warning QMessageBox::Warning
)->exec(); )->exec();
return; return;

View File

@ -279,7 +279,7 @@ void LogPage::on_btnPaste_clicked()
MessageLevel::Launcher, MessageLevel::Launcher,
QString("%2: Log upload triggered at: %1").arg( QString("%2: Log upload triggered at: %1").arg(
QDateTime::currentDateTime().toString(Qt::RFC2822Date), QDateTime::currentDateTime().toString(Qt::RFC2822Date),
BuildConfig.LAUNCHER_NAME BuildConfig.LAUNCHER_DISPLAYNAME
) )
); );
auto url = GuiUtil::uploadPaste(m_model->toPlainText(), this); auto url = GuiUtil::uploadPaste(m_model->toPlainText(), this);
@ -289,7 +289,7 @@ void LogPage::on_btnPaste_clicked()
MessageLevel::Launcher, MessageLevel::Launcher,
QString("%2: Log uploaded to: %1").arg( QString("%2: Log uploaded to: %1").arg(
url, url,
BuildConfig.LAUNCHER_NAME BuildConfig.LAUNCHER_DISPLAYNAME
) )
); );
} }
@ -297,7 +297,7 @@ void LogPage::on_btnPaste_clicked()
{ {
m_model->append( m_model->append(
MessageLevel::Error, MessageLevel::Error,
QString("%1: Log upload failed!").arg(BuildConfig.LAUNCHER_NAME) QString("%1: Log upload failed!").arg(BuildConfig.LAUNCHER_DISPLAYNAME)
); );
} }
} }

View File

@ -265,7 +265,7 @@ void ListModel::searchRequestFailed(QString reason)
//: %1 refers to the launcher itself //: %1 refers to the launcher itself
QString("%1 %2") QString("%1 %2")
.arg(m_parent->displayName()) .arg(m_parent->displayName())
.arg(tr("API version too old!\nPlease update %1!").arg(BuildConfig.LAUNCHER_NAME))); .arg(tr("API version too old!\nPlease update %1!").arg(BuildConfig.LAUNCHER_DISPLAYNAME)));
} }
jobPtr.reset(); jobPtr.reset();

View File

@ -321,7 +321,7 @@ void ModpackListModel::searchRequestFailed(QString reason)
//: %1 refers to the launcher itself //: %1 refers to the launcher itself
QString("%1 %2") QString("%1 %2")
.arg(m_parent->displayName()) .arg(m_parent->displayName())
.arg(tr("API version too old!\nPlease update %1!").arg(BuildConfig.LAUNCHER_NAME))); .arg(tr("API version too old!\nPlease update %1!").arg(BuildConfig.LAUNCHER_DISPLAYNAME)));
} }
jobPtr.reset(); jobPtr.reset();

View File

@ -44,6 +44,6 @@ bool LanguageWizardPage::validatePage()
void LanguageWizardPage::retranslate() void LanguageWizardPage::retranslate()
{ {
setTitle(tr("Language")); setTitle(tr("Language"));
setSubTitle(tr("Select the language to use in %1").arg(BuildConfig.LAUNCHER_NAME)); setSubTitle(tr("Select the language to use in %1").arg(BuildConfig.LAUNCHER_DISPLAYNAME));
mainWidget->retranslate(); mainWidget->retranslate();
} }

View File

@ -29,7 +29,7 @@ void SetupWizard::retranslate()
setButtonText(QWizard::BackButton, tr("< &Back")); setButtonText(QWizard::BackButton, tr("< &Back"));
setButtonText(QWizard::FinishButton, tr("&Finish")); setButtonText(QWizard::FinishButton, tr("&Finish"));
setButtonText(QWizard::CustomButton1, tr("&Refresh")); setButtonText(QWizard::CustomButton1, tr("&Refresh"));
setWindowTitle(tr("%1 Quick Setup").arg(BuildConfig.LAUNCHER_NAME)); setWindowTitle(tr("%1 Quick Setup").arg(BuildConfig.LAUNCHER_DISPLAYNAME));
} }
BaseWizardPage * SetupWizard::getBasePage(int id) BaseWizardPage * SetupWizard::getBasePage(int id)

View File

@ -159,7 +159,7 @@ JavaSettingsWidget::ValidationStatus JavaSettingsWidget::validate()
"Do you wish to proceed without any Java?" "Do you wish to proceed without any Java?"
"\n\n" "\n\n"
"You can change the Java version in the settings later.\n" "You can change the Java version in the settings later.\n"
).arg(BuildConfig.LAUNCHER_NAME), ).arg(BuildConfig.LAUNCHER_DISPLAYNAME),
QMessageBox::Warning, QMessageBox::Warning,
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes | QMessageBox::No,
QMessageBox::NoButton QMessageBox::NoButton