diff --git a/.gitignore b/.gitignore index 84bf1676..bb82c254 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ Thumbs.db .user .directory resources/CMakeFiles -resources/MultiMCLauncher.jar *~ *.swp html/ diff --git a/buildconfig/BuildConfig.cpp.in b/buildconfig/BuildConfig.cpp.in index 1b223b5d..40940793 100644 --- a/buildconfig/BuildConfig.cpp.in +++ b/buildconfig/BuildConfig.cpp.in @@ -5,6 +5,16 @@ const Config BuildConfig; Config::Config() { + // Name and copyright + LAUNCHER_NAME = "@Launcher_Name@"; + LAUNCHER_DISPLAYNAME = "@Launcher_DisplayName@"; + LAUNCHER_COPYRIGHT = "@Launcher_Copyright@"; + LAUNCHER_DOMAIN = "@Launcher_Domain@"; + LAUNCHER_CONFIGFILE = "@Launcher_ConfigFile@"; + + USER_AGENT = "@Launcher_UserAgent@"; + USER_AGENT_UNCACHED = USER_AGENT + " (Uncached)"; + // Version information VERSION_MAJOR = @Launcher_VERSION_MAJOR@; VERSION_MINOR = @Launcher_VERSION_MINOR@; diff --git a/buildconfig/BuildConfig.h b/buildconfig/BuildConfig.h index 95f3ef22..641bd602 100644 --- a/buildconfig/BuildConfig.h +++ b/buildconfig/BuildConfig.h @@ -8,6 +8,12 @@ class Config { public: Config(); + QString LAUNCHER_NAME; + QString LAUNCHER_DISPLAYNAME; + QString LAUNCHER_COPYRIGHT; + QString LAUNCHER_DOMAIN; + QString LAUNCHER_CONFIGFILE; + /// The major version number. int VERSION_MAJOR; /// The minor version number. @@ -31,10 +37,13 @@ public: /// URL for the updater's channel QString UPDATER_BASE; + /// User-Agent to use. - QString USER_AGENT = "MultiMC/5.0"; + QString USER_AGENT; + /// User-Agent to use for uncached requests. - QString USER_AGENT_UNCACHED = "MultiMC/5.0 (Uncached)"; + QString USER_AGENT_UNCACHED; + /// Google analytics ID QString ANALYTICS_ID; @@ -71,7 +80,7 @@ public: QString IMGUR_CLIENT_ID; /** - * MultiMC Metadata repository URL prefix + * Metadata repository URL prefix */ QString META_URL; diff --git a/cmake/UnitTest/TestUtil.h b/cmake/UnitTest/TestUtil.h index a478bdde..ebe3c662 100644 --- a/cmake/UnitTest/TestUtil.h +++ b/cmake/UnitTest/TestUtil.h @@ -23,6 +23,6 @@ public: } }; -#define MULTIMC_GET_TEST_FILE(file) TestsInternal::readFile(QFINDTESTDATA(file)) -#define MULTIMC_GET_TEST_FILE_UTF8(file) TestsInternal::readFileUtf8(QFINDTESTDATA(file)) +#define GET_TEST_FILE(file) TestsInternal::readFile(QFINDTESTDATA(file)) +#define GET_TEST_FILE_UTF8(file) TestsInternal::readFileUtf8(QFINDTESTDATA(file)) diff --git a/cmake/UnitTest/test.manifest b/cmake/UnitTest/test.manifest index 8b4dbb98..dc5f9d8f 100644 --- a/cmake/UnitTest/test.manifest +++ b/cmake/UnitTest/test.manifest @@ -1,6 +1,6 @@ - + @@ -24,4 +24,4 @@ - \ No newline at end of file + diff --git a/cmake/UnitTest/test.rc b/cmake/UnitTest/test.rc index a288dba6..9fe4147e 100644 --- a/cmake/UnitTest/test.rc +++ b/cmake/UnitTest/test.rc @@ -17,7 +17,7 @@ BEGIN VALUE "CompanyName", "MultiMC Contributors" VALUE "FileDescription", "Testcase" VALUE "FileVersion", "1.0.0.0" - VALUE "ProductName", "MultiMC Testcase" + VALUE "ProductName", "Launcher Testcase" VALUE "ProductVersion", "5" END END diff --git a/launcher/BaseInstance.cpp b/launcher/BaseInstance.cpp index 46b45827..374d4a29 100644 --- a/launcher/BaseInstance.cpp +++ b/launcher/BaseInstance.cpp @@ -25,6 +25,7 @@ #include "FileSystem.h" #include "Commandline.h" +#include "BuildConfig.h" BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) : QObject() @@ -260,7 +261,7 @@ QString BaseInstance::name() const QString BaseInstance::windowTitle() const { - return "MultiMC: " + name().replace(QRegExp("[ \n\r\t]+"), " "); + return BuildConfig.LAUNCHER_NAME + ": " + name().replace(QRegExp("[ \n\r\t]+"), " "); } // FIXME: why is this here? move it to MinecraftInstance!!! diff --git a/launcher/BaseInstance.h b/launcher/BaseInstance.h index 51258933..253d2130 100644 --- a/launcher/BaseInstance.h +++ b/launcher/BaseInstance.h @@ -71,7 +71,7 @@ public: virtual void saveNow() = 0; /*** - * the instance has been invalidated - it is no longer tracked by MultiMC for some reason, + * the instance has been invalidated - it is no longer tracked by the launcher for some reason, * but it has not necessarily been deleted. * * Happens when the instance folder changes to some other location, or the instance is removed by external means. diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index eb49b6d9..5c45273b 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -555,7 +555,7 @@ set(LOGIC_SOURCES ${ATLAUNCHER_SOURCES} ) -SET(MULTIMC_SOURCES +SET(LAUNCHER_SOURCES # Application base Launcher.h Launcher.cpp @@ -812,7 +812,7 @@ SET(MULTIMC_SOURCES ) ######## UIs ######## -SET(MULTIMC_UIS +SET(LAUNCHER_UIS # Instance pages pages/instance/GameOptionsPage.ui pages/instance/VersionPage.ui @@ -868,7 +868,7 @@ SET(MULTIMC_UIS widgets/MCModInfoFrame.ui ) -set(MULTIMC_QRCS +set(LAUNCHER_QRCS resources/backgrounds/backgrounds.qrc resources/multimc/multimc.qrc resources/pe_dark/pe_dark.qrc @@ -879,19 +879,20 @@ set(MULTIMC_QRCS resources/iOS/iOS.qrc resources/flat/flat.qrc resources/documents/documents.qrc + ../${Launcher_Branding_LogoQRC} ) ######## Windows resource files ######## if(WIN32) - set(MULTIMC_RCS ../${Launcher_Branding_WindowsRC}) + set(LAUNCHER_RCS ../${Launcher_Branding_WindowsRC}) endif() # Qt 5 stuff -qt5_wrap_ui(MULTIMC_UI ${MULTIMC_UIS}) -qt5_add_resources(MULTIMC_RESOURCES ${MULTIMC_QRCS}) +qt5_wrap_ui(LAUNCHER_UI ${LAUNCHER_UIS}) +qt5_add_resources(LAUNCHER_RESOURCES ${LAUNCHER_QRCS}) # Add executable -add_library(Launcher_logic STATIC ${LOGIC_SOURCES} ${MULTIMC_SOURCES} ${MULTIMC_UI} ${MULTIMC_RESOURCES}) +add_library(Launcher_logic STATIC ${LOGIC_SOURCES} ${LAUNCHER_SOURCES} ${LAUNCHER_UI} ${LAUNCHER_RESOURCES}) target_link_libraries(Launcher_logic systeminfo Launcher_quazip @@ -921,7 +922,7 @@ target_link_libraries(Launcher_logic target_link_libraries(Launcher_logic secrets) -add_executable(${Launcher_Name} MACOSX_BUNDLE WIN32 main.cpp ${MULTIMC_RCS}) +add_executable(${Launcher_Name} MACOSX_BUNDLE WIN32 main.cpp ${LAUNCHER_RCS}) target_link_libraries(${Launcher_Name} Launcher_logic) if(DEFINED Launcher_APP_BINARY_NAME) diff --git a/launcher/ColorCache.h b/launcher/ColorCache.h index 6ae633b9..a840664d 100644 --- a/launcher/ColorCache.h +++ b/launcher/ColorCache.h @@ -91,7 +91,7 @@ public: LogColorCache(QColor front, QColor back) : ColorCache(front, back, 1.0) { - addColor((int)MessageLevel::MultiMC, QColor("purple")); + addColor((int)MessageLevel::Launcher, QColor("purple")); addColor((int)MessageLevel::Debug, QColor("green")); addColor((int)MessageLevel::Warning, QColor("orange")); addColor((int)MessageLevel::Error, QColor("red")); diff --git a/launcher/FileSystem_test.cpp b/launcher/FileSystem_test.cpp index df653ea1..90ddc499 100644 --- a/launcher/FileSystem_test.cpp +++ b/launcher/FileSystem_test.cpp @@ -135,7 +135,7 @@ slots: << "asdf" << QString() #if defined(Q_OS_LINUX) - << MULTIMC_GET_TEST_FILE("data/FileSystem-test_createShortcut-unix") + << GET_TEST_FILE("data/FileSystem-test_createShortcut-unix") #elif defined(Q_OS_WIN) << QByteArray() #endif diff --git a/launcher/InstanceList.cpp b/launcher/InstanceList.cpp index 42b2ae1a..ae905414 100644 --- a/launcher/InstanceList.cpp +++ b/launcher/InstanceList.cpp @@ -259,7 +259,7 @@ void InstanceList::deleteInstance(const InstanceId& id) return; } - qDebug() << "Instance" << id << "has been deleted by MultiMC."; + qDebug() << "Instance" << id << "has been deleted by the launcher."; } static QMap getIdMapping(const QList &list) @@ -799,7 +799,7 @@ private slots: private: /* * WHY: the whole reason why this uses an exponential backoff retry scheme is antivirus on Windows. - * Basically, it starts messing things up while MultiMC is extracting/creating instances + * Basically, it starts messing things up while the launcher is extracting/creating instances * and causes that horrible failure that is NTFS to lock files in place because they are open. */ ExponentialSeries backoff; diff --git a/launcher/LaunchController.cpp b/launcher/LaunchController.cpp index 15972923..a865caab 100644 --- a/launcher/LaunchController.cpp +++ b/launcher/LaunchController.cpp @@ -47,7 +47,7 @@ void LaunchController::login() { m_parentWidget, tr("No Accounts"), tr("In order to play Minecraft, you must have at least one Mojang or Minecraft " - "account logged in to MultiMC." + "account logged in." "Would you like to open the account manager to add an account now?"), QMessageBox::Information, QMessageBox::Yes | QMessageBox::No @@ -286,7 +286,7 @@ void LaunchController::launchInstance() } resolved_servers = resolved_servers + "]\n\n"; } - m_launcher->prependStep(new TextPrint(m_launcher.get(), resolved_servers, MessageLevel::MultiMC)); + m_launcher->prependStep(new TextPrint(m_launcher.get(), resolved_servers, MessageLevel::Launcher)); } else { online_mode = "offline"; } @@ -298,10 +298,10 @@ void LaunchController::launchInstance() auth_server_status = "offline"; } - m_launcher->prependStep(new TextPrint(m_launcher.get(), "Launched instance in " + online_mode + " mode\nAuthentication server is " + auth_server_status + "\n", MessageLevel::MultiMC)); + m_launcher->prependStep(new TextPrint(m_launcher.get(), "Launched instance in " + online_mode + " mode\nAuthentication server is " + auth_server_status + "\n", MessageLevel::Launcher)); // Prepend Version - m_launcher->prependStep(new TextPrint(m_launcher.get(), "MultiMC version: " + BuildConfig.printableVersionString() + "\n\n", MessageLevel::MultiMC)); + m_launcher->prependStep(new TextPrint(m_launcher.get(), BuildConfig.LAUNCHER_NAME + " version: " + BuildConfig.printableVersionString() + "\n\n", MessageLevel::Launcher)); m_launcher->start(); } diff --git a/launcher/Launcher.cpp b/launcher/Launcher.cpp index ab74a324..9a1d1ca3 100644 --- a/launcher/Launcher.cpp +++ b/launcher/Launcher.cpp @@ -87,7 +87,7 @@ static const QLatin1String liveCheckFile("live.check"); using namespace Commandline; -#define MACOS_HINT "If you are on macOS Sierra, you might have to move MultiMC.app to your /Applications or ~/Applications folder. "\ +#define MACOS_HINT "If you are on macOS Sierra, you might have to move the app to your /Applications or ~/Applications folder. "\ "This usually fixes the problem and you can move the application elsewhere afterwards.\n"\ "\n" @@ -179,10 +179,10 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) consoleAttached = true; } #endif - setOrganizationName("MultiMC"); - setOrganizationDomain("multimc.org"); - setApplicationName("MultiMC5"); - setApplicationDisplayName("MultiMC 5"); + setOrganizationName(BuildConfig.LAUNCHER_NAME); + setOrganizationDomain(BuildConfig.LAUNCHER_DOMAIN); + setApplicationName(BuildConfig.LAUNCHER_NAME); + setApplicationDisplayName(BuildConfig.LAUNCHER_DISPLAYNAME); setApplicationVersion(BuildConfig.printableVersionString()); startTime = QDateTime::currentDateTime(); @@ -200,7 +200,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) showFatalErrorMessage( "Unsupported system detected!", "Linux-on-Windows distributions are not supported.\n\n" - "Please use the Windows MultiMC binary when playing on Windows." + "Please use the Windows binary when playing on Windows." ); return; } @@ -227,7 +227,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) // --dir parser.addOption("dir"); parser.addShortOpt("dir", 'd'); - parser.addDocumentation("dir", "Use the supplied folder as MultiMC root instead of " + parser.addDocumentation("dir", "Use the supplied folder as application root instead of " "the binary location (use '.' for current)"); // --launch parser.addOption("launch"); @@ -240,7 +240,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) "(only valid in combination with --launch)"); // --alive parser.addSwitch("alive"); - parser.addDocumentation("alive", "Write a small '" + liveCheckFile + "' file after MultiMC starts"); + parser.addDocumentation("alive", "Write a small '" + liveCheckFile + "' file after the launcher starts"); // --import parser.addOption("import"); parser.addShortOpt("import", 'I'); @@ -255,7 +255,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) { std::cerr << "CommandLineError: " << e.what() << std::endl; if(argc > 0) - std::cerr << "Try '" << argv[0] << " -h' to get help on MultiMC's command line parameters." + std::cerr << "Try '" << argv[0] << " -h' to get help on command line parameters." << std::endl; m_status = Launcher::Failed; return; @@ -298,13 +298,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) } else { -#ifdef MULTIMC_LINUX_DATADIR - QString xdgDataHome = QFile::decodeName(qgetenv("XDG_DATA_HOME")); - if (xdgDataHome.isEmpty()) - xdgDataHome = QDir::homePath() + QLatin1String("/.local/share"); - dataPath = xdgDataHome + "/multimc"; - adjustedBy += "XDG standard " + dataPath; -#elif defined(Q_OS_MAC) +#if defined(Q_OS_MAC) QDir foo(FS::PathCombine(applicationDirPath(), "../../Data")); dataPath = foo.absolutePath(); adjustedBy += "Fallback to special Mac location " + dataPath; @@ -317,30 +311,30 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) if (!FS::ensureFolderPathExists(dataPath)) { showFatalErrorMessage( - "MultiMC data folder could not be created.", - "MultiMC data folder could not be created.\n" + "The launcher data folder could not be created.", + "The launcher data folder could not be created.\n" "\n" #if defined(Q_OS_MAC) MACOS_HINT #endif - "Make sure you have the right permissions to the MultiMC data folder and any folder needed to access it.\n" + "Make sure you have the right permissions to the launcher data folder and any folder needed to access it.\n" "\n" - "MultiMC cannot continue until you fix this problem." + "The launcher cannot continue until you fix this problem." ); return; } if (!QDir::setCurrent(dataPath)) { showFatalErrorMessage( - "MultiMC data folder could not be opened.", - "MultiMC data folder could not be opened.\n" + "The launcher data folder could not be opened.", + "The launcher data folder could not be opened.\n" "\n" #if defined(Q_OS_MAC) MACOS_HINT #endif - "Make sure you have the right permissions to the MultiMC data folder.\n" + "Make sure you have the right permissions to the launcher data folder.\n" "\n" - "MultiMC cannot continue until you fix this problem." + "The launcher cannot continue until you fix this problem." ); return; } @@ -357,18 +351,24 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) QDir fi(applicationDirPath()); QString originalData = fi.absolutePath(); // if the config file exists in Contents/MacOS, then user data is still there and needs to moved - if (QFileInfo::exists(FS::PathCombine(originalData, "multimc.cfg"))) + if (QFileInfo::exists(FS::PathCombine(originalData, BuildConfig.LAUNCHER_CONFIGFILE))) { if (!QFileInfo::exists(FS::PathCombine(originalData, "dontmovemacdata"))) { QMessageBox::StandardButton askMoveDialogue; - askMoveDialogue = QMessageBox::question(nullptr, "MultiMC 5", "Would you like to move application data to a new data location? It will improve MultiMC's performance, but if you switch to older versions it will look like instances have disappeared. If you select no, you can migrate later in settings. You should select yes unless you're commonly switching between different versions of MultiMC (eg. develop and stable).", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); + askMoveDialogue = QMessageBox::question( + nullptr, + BuildConfig.LAUNCHER_DISPLAYNAME, + "Would you like to move application data to a new data location? It will improve the launcher's performance, but if you switch to older versions it will look like instances have disappeared. If you select no, you can migrate later in settings. You should select yes unless you're commonly switching between different versions (eg. develop and stable).", + QMessageBox::Yes | QMessageBox::No, + QMessageBox::Yes + ); if (askMoveDialogue == QMessageBox::Yes) { qDebug() << "On macOS and found config file in old location, moving user data..."; QDir dir; QStringList dataFiles { - "*.log", // MultiMC-@.log + "*.log", // Launcher log files: ${Launcher_Name}-@.log "accounts.json", "accounts", "assets", @@ -379,7 +379,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) "meta", "metacache", "mods", - "multimc.cfg", + BuildConfig.LAUNCHER_CONFIGFILE, "themes", "translations" }; @@ -451,7 +451,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) // init the logger { - static const QString logBase = "MultiMC-%0.log"; + static const QString logBase = BuildConfig.LAUNCHER_NAME + "-%0.log"; auto moveFile = [](const QString &oldName, const QString &newName) { QFile::remove(newName); @@ -468,15 +468,15 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) if(!logFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate)) { showFatalErrorMessage( - "MultiMC data folder is not writable!", - "MultiMC couldn't create a log file - the MultiMC data folder is not writable.\n" + "The launcher data folder is not writable!", + "The launcher couldn't create a log file - the data folder is not writable.\n" "\n" #if defined(Q_OS_MAC) MACOS_HINT #endif - "Make sure you have write permissions to the MultiMC data folder.\n" + "Make sure you have write permissions to the data folder.\n" "\n" - "MultiMC cannot continue until you fix this problem." + "The launcher cannot continue until you fix this problem." ); return; } @@ -503,7 +503,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) ENV.setJarsPath( TOSTRING(MULTIMC_JARS_LOCATION) ); #endif - qDebug() << "MultiMC 5, (c) 2013-2021 MultiMC Contributors"; + qDebug() << BuildConfig.LAUNCHER_DISPLAYNAME << ", (c) 2013-2021 " << BuildConfig.LAUNCHER_COPYRIGHT; qDebug() << "Version : " << BuildConfig.printableVersionString(); qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT; qDebug() << "Git refspec : " << BuildConfig.GIT_REFSPEC; @@ -553,7 +553,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv) // Initialize application settings { - m_settings.reset(new INISettingsObject("multimc.cfg", this)); + m_settings.reset(new INISettingsObject(BuildConfig.LAUNCHER_CONFIGFILE, this)); // Updates m_settings->registerSetting("UpdateChannel", BuildConfig.VERSION_CHANNEL); m_settings->registerSetting("AutoUpdate", true); @@ -1164,6 +1164,9 @@ void Launcher::setIconTheme(const QString& name) QIcon Launcher::getThemedIcon(const QString& name) { + if(name == "logo") { + return QIcon(":/logo.svg"); + } return XdgIcon::fromTheme(name); } diff --git a/launcher/Launcher.h b/launcher/Launcher.h index 468f8a68..f4a20122 100644 --- a/launcher/Launcher.h +++ b/launcher/Launcher.h @@ -221,7 +221,7 @@ private: // main window, if any MainWindow * m_mainWindow = nullptr; - // peer MultiMC instance connector - used to implement single instance MultiMC and signalling + // peer launcher instance connector - used to implement single instance launcher and signalling LocalPeer * m_peerInstance = nullptr; GAnalytics * m_analytics = nullptr; diff --git a/launcher/LoggedProcess.cpp b/launcher/LoggedProcess.cpp index 822c0f04..2479f4ff 100644 --- a/launcher/LoggedProcess.cpp +++ b/launcher/LoggedProcess.cpp @@ -65,16 +65,16 @@ void LoggedProcess::on_exit(int exit_code, QProcess::ExitStatus status) if (status == QProcess::NormalExit) { //: Message displayed on instance exit - emit log({tr("Process exited with code %1.").arg(exit_code)}, MessageLevel::MultiMC); + emit log({tr("Process exited with code %1.").arg(exit_code)}, MessageLevel::Launcher); changeState(LoggedProcess::Finished); } else { //: Message displayed on instance crashed if(exit_code == -1) - emit log({tr("Process crashed.")}, MessageLevel::MultiMC); + emit log({tr("Process crashed.")}, MessageLevel::Launcher); else - emit log({tr("Process crashed with exitcode %1.").arg(exit_code)}, MessageLevel::MultiMC); + emit log({tr("Process crashed with exitcode %1.").arg(exit_code)}, MessageLevel::Launcher); changeState(LoggedProcess::Crashed); } } diff --git a/launcher/MainWindow.cpp b/launcher/MainWindow.cpp index 91cf203a..c3cc6b8d 100644 --- a/launcher/MainWindow.cpp +++ b/launcher/MainWindow.cpp @@ -133,11 +133,21 @@ public: { if(m_text) { - m_contained->setText(QApplication::translate("MainWindow", m_text)); + QString result; + result = QApplication::translate("MainWindow", m_text); + if(result.contains("%1")) { + result = result.arg(BuildConfig.LAUNCHER_NAME); + } + m_contained->setText(result); } if(m_tooltip) { - m_contained->setToolTip(QApplication::translate("MainWindow", m_tooltip)); + QString result; + result = QApplication::translate("MainWindow", m_tooltip); + if(result.contains("%1")) { + result = result.arg(BuildConfig.LAUNCHER_NAME); + } + m_contained->setToolTip(result); } } private: @@ -324,7 +334,7 @@ public: actionReportBug->setObjectName(QStringLiteral("actionReportBug")); actionReportBug->setIcon(LAUNCHER->getThemedIcon("bug")); actionReportBug.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Report a Bug")); - actionReportBug.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the bug tracker to report a bug with MultiMC.")); + actionReportBug.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the bug tracker to report a bug with %1.")); all_actions.append(&actionReportBug); helpMenu->addAction(actionReportBug); } @@ -334,7 +344,7 @@ public: actionDISCORD->setObjectName(QStringLiteral("actionDISCORD")); actionDISCORD->setIcon(LAUNCHER->getThemedIcon("discord")); actionDISCORD.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Discord")); - actionDISCORD.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC discord voice chat.")); + actionDISCORD.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open %1 discord voice chat.")); all_actions.append(&actionDISCORD); helpMenu->addAction(actionDISCORD); } @@ -344,7 +354,7 @@ public: actionREDDIT->setObjectName(QStringLiteral("actionREDDIT")); actionREDDIT->setIcon(LAUNCHER->getThemedIcon("reddit-alien")); actionREDDIT.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Reddit")); - actionREDDIT.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open MultiMC subreddit.")); + actionREDDIT.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open %1 subreddit.")); all_actions.append(&actionREDDIT); helpMenu->addAction(actionREDDIT); } @@ -353,14 +363,14 @@ public: actionAbout->setObjectName(QStringLiteral("actionAbout")); actionAbout->setIcon(LAUNCHER->getThemedIcon("about")); actionAbout->setMenuRole(QAction::AboutRole); - actionAbout.setTextId(QT_TRANSLATE_NOOP("MainWindow", "About MultiMC")); - actionAbout.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "View information about MultiMC.")); + actionAbout.setTextId(QT_TRANSLATE_NOOP("MainWindow", "About %1")); + actionAbout.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "View information about %1.")); all_actions.append(&actionAbout); helpMenu->addAction(actionAbout); helpMenuButton = TranslatedToolButton(MainWindow); helpMenuButton.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Help")); - helpMenuButton.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Get help with MultiMC or Minecraft.")); + helpMenuButton.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Get help with %1 or Minecraft.")); helpMenuButton->setMenu(helpMenu); helpMenuButton->setPopupMode(QToolButton::InstantPopup); helpMenuButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); @@ -377,7 +387,7 @@ public: actionCheckUpdate->setObjectName(QStringLiteral("actionCheckUpdate")); actionCheckUpdate->setIcon(LAUNCHER->getThemedIcon("checkupdate")); actionCheckUpdate.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Update")); - actionCheckUpdate.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Check for new updates for MultiMC.")); + actionCheckUpdate.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Check for new updates for %1.")); all_actions.append(&actionCheckUpdate); mainToolBar->addAction(actionCheckUpdate); } @@ -387,8 +397,8 @@ public: actionPatreon = TranslatedAction(MainWindow); actionPatreon->setObjectName(QStringLiteral("actionPatreon")); actionPatreon->setIcon(LAUNCHER->getThemedIcon("patreon")); - actionPatreon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Support MultiMC")); - actionPatreon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the MultiMC Patreon page.")); + actionPatreon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Support %1")); + actionPatreon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the %1 Patreon page.")); all_actions.append(&actionPatreon); mainToolBar->addAction(actionPatreon); @@ -437,7 +447,7 @@ public: actionMoreNews->setObjectName(QStringLiteral("actionMoreNews")); actionMoreNews->setIcon(LAUNCHER->getThemedIcon("news")); actionMoreNews.setTextId(QT_TRANSLATE_NOOP("MainWindow", "More news...")); - actionMoreNews.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the MultiMC development blog to read more news about MultiMC.")); + actionMoreNews.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the development blog to read more news about %1.")); all_actions.append(&actionMoreNews); newsToolBar->addAction(actionMoreNews); @@ -596,9 +606,9 @@ public: } MainWindow->resize(800, 600); MainWindow->setWindowIcon(LAUNCHER->getThemedIcon("logo")); - MainWindow->setWindowTitle("MultiMC 5"); + MainWindow->setWindowTitle(BuildConfig.LAUNCHER_DISPLAYNAME); #ifndef QT_NO_ACCESSIBILITY - MainWindow->setAccessibleName("MultiMC"); + MainWindow->setAccessibleName(BuildConfig.LAUNCHER_NAME); #endif createMainToolbar(MainWindow); @@ -623,7 +633,7 @@ public: void retranslateUi(QMainWindow *MainWindow) { - QString winTitle = tr("MultiMC 5 - Version %1").arg(BuildConfig.printableVersionString()); + QString winTitle = tr("%1 - Version %2", "Launcher - Version X").arg(BuildConfig.LAUNCHER_DISPLAYNAME, BuildConfig.printableVersionString()); if (!BuildConfig.BUILD_PLATFORM.isEmpty()) { winTitle += tr(" on %1", "on platform, as in operating system").arg(BuildConfig.BUILD_PLATFORM); @@ -897,7 +907,7 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos) { auto group = view->groupNameAt(pos); - QAction *actionVoid = new QAction("MultiMC", this); + QAction *actionVoid = new QAction(BuildConfig.LAUNCHER_NAME, this); actionVoid->setEnabled(false); QAction *actionCreateInstance = new QAction(tr("Create instance"), this); @@ -1381,10 +1391,13 @@ void MainWindow::finalizeInstance(InstancePtr inst) } else { - CustomMessageBox::selectable(this, tr("Error"), tr("MultiMC cannot download Minecraft or update instances unless you have at least " - "one account added.\nPlease add your Mojang or Minecraft account."), - QMessageBox::Warning) - ->show(); + CustomMessageBox::selectable( + this, + tr("Error"), + tr("The launcher cannot download Minecraft or update instances unless you have at least " + "one account added.\nPlease add your Mojang or Minecraft account."), + QMessageBox::Warning + )->show(); } } @@ -1879,20 +1892,24 @@ void MainWindow::checkInstancePathForProblems() { QMessageBox warning(this); warning.setText(tr("Your instance folder contains \'!\' and this is known to cause Java problems!")); - warning.setInformativeText(tr("You have now two options:
" - " - change the instance folder in the settings
" - " - move this installation of MultiMC5 to a different folder")); + warning.setInformativeText( + tr( + "You have now two options:
" + " - change the instance folder in the settings
" + " - move this installation of %1 to a different folder" + ).arg(BuildConfig.LAUNCHER_NAME) + ); warning.setDefaultButton(QMessageBox::Ok); warning.exec(); } auto tempFolderText = tr("This is a problem:
" - " - MultiMC will likely be deleted without warning by the operating system
" - " - close MultiMC now and extract it to a real location, not a temporary folder"); + " - The launcher will likely be deleted without warning by the operating system
" + " - close the launcher now and extract it to a real location, not a temporary folder"); QString pathfoldername = QDir(instanceFolder).absolutePath(); if (pathfoldername.contains("Rar$", Qt::CaseInsensitive)) { QMessageBox warning(this); - warning.setText(tr("Your instance folder contains \'Rar$\' - that means you haven't extracted the MultiMC zip!")); + warning.setText(tr("Your instance folder contains \'Rar$\' - that means you haven't extracted the launcher archive!")); warning.setInformativeText(tempFolderText); warning.setDefaultButton(QMessageBox::Ok); warning.exec(); diff --git a/launcher/MessageLevel.cpp b/launcher/MessageLevel.cpp index 0a2cd23d..135ef463 100644 --- a/launcher/MessageLevel.cpp +++ b/launcher/MessageLevel.cpp @@ -2,8 +2,8 @@ MessageLevel::Enum MessageLevel::getLevel(const QString& levelName) { - if (levelName == "MultiMC") - return MessageLevel::MultiMC; + if (levelName == "Launcher") + return MessageLevel::Launcher; else if (levelName == "Debug") return MessageLevel::Debug; else if (levelName == "Info") diff --git a/launcher/MessageLevel.h b/launcher/MessageLevel.h index f19048e3..227ad25d 100644 --- a/launcher/MessageLevel.h +++ b/launcher/MessageLevel.h @@ -13,7 +13,7 @@ enum Enum Unknown, /**< No idea what this is or where it came from */ StdOut, /**< Undetermined stderr messages */ StdErr, /**< Undetermined stdout messages */ - MultiMC, /**< MultiMC Messages */ + Launcher, /**< Launcher Messages */ Debug, /**< Debug Messages */ Info, /**< Info Messages */ Message, /**< Standard Messages */ diff --git a/launcher/UpdateController.cpp b/launcher/UpdateController.cpp index 0309ad93..136e22fd 100644 --- a/launcher/UpdateController.cpp +++ b/launcher/UpdateController.cpp @@ -8,6 +8,9 @@ #include #include +#include "BuildConfig.h" + + // from #ifndef S_IRUSR #define __S_IREAD 0400 /* Read by owner. */ @@ -91,7 +94,7 @@ void UpdateController::installUpdates() #ifdef Q_OS_WIN QString finishCmd = QApplication::applicationFilePath(); #elif defined Q_OS_LINUX - QString finishCmd = FS::PathCombine(m_root, "MultiMC"); + QString finishCmd = FS::PathCombine(m_root, BuildConfig.LAUNCHER_NAME); #elif defined Q_OS_MAC QString finishCmd = QApplication::applicationFilePath(); #else @@ -127,8 +130,9 @@ void UpdateController::installUpdates() case GoUpdate::Operation::OP_REPLACE: { #ifdef Q_OS_WIN32 + QString windowsExeName = BuildConfig.LAUNCHER_NAME + ".exe"; // hack for people renaming the .exe because ... reasons :) - if(op.destination == "MultiMC.exe") + if(op.destination == windowsExeName) { op.destination = QFileInfo(QApplication::applicationFilePath()).fileName(); } @@ -137,7 +141,7 @@ void UpdateController::installUpdates() #ifdef Q_OS_WIN32 if(QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) { - if(destination.fileName() == "MultiMC.exe") + if(destination.fileName() == windowsExeName) { QDir rootDir(m_root); exeOrigin = rootDir.relativeFilePath(op.source); @@ -365,16 +369,20 @@ void UpdateController::fail() { case Replace: { - msg = QObject::tr("Couldn't replace file %1. Changes will be reverted.\n" - "See the MultiMC log file for details.").arg(m_failedFile); + msg = QObject::tr( + "Couldn't replace file %1. Changes will be reverted.\n" + "See the %2 log file for details." + ).arg(m_failedFile, BuildConfig.LAUNCHER_NAME); doRollback = true; QMessageBox::critical(m_parent, failTitle, msg); break; } case Delete: { - msg = QObject::tr("Couldn't remove file %1. Changes will be reverted.\n" - "See the MultiMC log file for details.").arg(m_failedFile); + msg = QObject::tr( + "Couldn't remove file %1. Changes will be reverted.\n" + "See the %2 log file for details." + ).arg(m_failedFile, BuildConfig.LAUNCHER_NAME); doRollback = true; QMessageBox::critical(m_parent, failTitle, msg); break; @@ -404,8 +412,8 @@ void UpdateController::fail() if(!rollbackOK) { msg = QObject::tr("The rollback failed too.\n" - "You will have to repair MultiMC manually.\n" - "Please let us know why and how this happened.").arg(m_failedFile); + "You will have to repair %1 manually.\n" + "Please let us know why and how this happened.").arg(BuildConfig.LAUNCHER_NAME); QMessageBox::critical(m_parent, rollFailTitle, msg); qApp->quit(); } diff --git a/launcher/dialogs/AboutDialog.cpp b/launcher/dialogs/AboutDialog.cpp index 890f9f80..a4d30c3c 100644 --- a/launcher/dialogs/AboutDialog.cpp +++ b/launcher/dialogs/AboutDialog.cpp @@ -31,9 +31,10 @@ QString getCreditsHtml(QStringList patrons) QString patronsHeading = QObject::tr("Patrons", "About Credits"); QString output; QTextStream stream(&output); + stream.setCodec(QTextCodec::codecForName("UTF-8")); stream << "
\n"; // TODO: possibly retrieve from git history at build time? - stream << "

" << QObject::tr("MultiMC Developers", "About Credits") << "

\n"; + stream << "

" << QObject::tr("Developers", "About Credits") << "

\n"; stream << "

Andrew Okin <forkk@forkk.net>

\n"; stream << "

Petr Mrázek <peterix@gmail.com>

\n"; stream << "

Sky Welch <multimc@bunnies.io>

\n"; @@ -75,6 +76,10 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia { ui->setupUi(this); + QString launcherName = BuildConfig.LAUNCHER_NAME; + + setWindowTitle(tr("About %1").arg(launcherName)); + QString chtml = getCreditsHtml(QStringList()); ui->creditsText->setHtml(chtml); @@ -84,7 +89,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia ui->urlLabel->setOpenExternalLinks(true); ui->icon->setPixmap(LAUNCHER->getThemedIcon("logo").pixmap(64)); - ui->title->setText("MultiMC 5"); + ui->title->setText(launcherName); ui->versionLabel->setText(tr("Version") +": " + BuildConfig.printableVersionString()); ui->platformLabel->setText(tr("Platform") +": " + BuildConfig.BUILD_PLATFORM); diff --git a/launcher/dialogs/AboutDialog.ui b/launcher/dialogs/AboutDialog.ui index c6de9ebb..6dcc6ff4 100644 --- a/launcher/dialogs/AboutDialog.ui +++ b/launcher/dialogs/AboutDialog.ui @@ -16,9 +16,6 @@ 400 - - About MultiMC - diff --git a/launcher/java/launch/CheckJava.cpp b/launcher/java/launch/CheckJava.cpp index f58602f0..fb338231 100644 --- a/launcher/java/launch/CheckJava.cpp +++ b/launcher/java/launch/CheckJava.cpp @@ -48,7 +48,7 @@ void CheckJava::executeTask() } else { - emit logLine("Java path is:\n" + m_javaPath + "\n\n", MessageLevel::MultiMC); + emit logLine("Java path is:\n" + m_javaPath + "\n\n", MessageLevel::Launcher); } QFileInfo javaInfo(realJavaPath); @@ -62,7 +62,7 @@ void CheckJava::executeTask() if (javaUnixTime != storedUnixTime || storedVersion.size() == 0 || storedArchitecture.size() == 0 || storedVendor.size() == 0) { m_JavaChecker = new JavaChecker(); - emit logLine(QString("Checking Java version..."), MessageLevel::MultiMC); + emit logLine(QString("Checking Java version..."), MessageLevel::Launcher); connect(m_JavaChecker.get(), &JavaChecker::checkFinished, this, &CheckJava::checkJavaFinished); m_JavaChecker->m_path = realJavaPath; m_JavaChecker->performCheck(); @@ -87,7 +87,7 @@ void CheckJava::checkJavaFinished(JavaCheckResult result) // Error message displayed if java can't start emit logLine(QString("Could not start java:"), MessageLevel::Error); emit logLines(result.errorLog.split('\n'), MessageLevel::Error); - emit logLine("\nCheck your MultiMC Java settings.", MessageLevel::MultiMC); + emit logLine("\nCheck your MultiMC Java settings.", MessageLevel::Launcher); printSystemInfo(false, false); emitFailed(QString("Could not start java!")); return; @@ -96,7 +96,7 @@ void CheckJava::checkJavaFinished(JavaCheckResult result) { emit logLine(QString("Java checker returned some invalid data MultiMC doesn't understand:"), MessageLevel::Error); emit logLines(result.outLog.split('\n'), MessageLevel::Warning); - emit logLine("\nMinecraft might not start properly.", MessageLevel::MultiMC); + emit logLine("\nMinecraft might not start properly.", MessageLevel::Launcher); printSystemInfo(false, false); emitSucceeded(); return; @@ -117,7 +117,7 @@ void CheckJava::checkJavaFinished(JavaCheckResult result) void CheckJava::printJavaInfo(const QString& version, const QString& architecture, const QString & vendor) { - emit logLine(QString("Java is version %1, using %2-bit architecture, from %3.\n\n").arg(version, architecture, vendor), MessageLevel::MultiMC); + emit logLine(QString("Java is version %1, using %2-bit architecture, from %3.\n\n").arg(version, architecture, vendor), MessageLevel::Launcher); printSystemInfo(true, architecture == "64"); } diff --git a/launcher/launch/LaunchTask.h b/launcher/launch/LaunchTask.h index ae81462f..a1e891ac 100644 --- a/launcher/launch/LaunchTask.h +++ b/launcher/launch/LaunchTask.h @@ -103,8 +103,8 @@ signals: void requestLogging(); public slots: - void onLogLines(const QStringList& lines, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC); - void onLogLine(QString line, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC); + void onLogLines(const QStringList& lines, MessageLevel::Enum defaultLevel = MessageLevel::Launcher); + void onLogLine(QString line, MessageLevel::Enum defaultLevel = MessageLevel::Launcher); void onReadyForLaunch(); void onStepFinished(); void onProgressReportingRequested(); diff --git a/launcher/launch/steps/LookupServerAddress.cpp b/launcher/launch/steps/LookupServerAddress.cpp index de56c28a..c7b8cea4 100644 --- a/launcher/launch/steps/LookupServerAddress.cpp +++ b/launcher/launch/steps/LookupServerAddress.cpp @@ -60,7 +60,7 @@ void LookupServerAddress::on_dnsLookupFinished() if (m_dnsLookup->error() != QDnsLookup::NoError) { emit logLine(QString("Failed to resolve server address (this is NOT an error!) %1: %2\n") - .arg(m_dnsLookup->name(), m_dnsLookup->errorString()), MessageLevel::MultiMC); + .arg(m_dnsLookup->name(), m_dnsLookup->errorString()), MessageLevel::Launcher); resolve(m_lookupAddress, 25565); // Technically the task failed, however, we don't abort the launch // and leave it up to minecraft to fail (or maybe not) when connecting return; @@ -81,7 +81,7 @@ void LookupServerAddress::on_dnsLookupFinished() quint16 port = firstRecord.port(); emit logLine(QString("Resolved server address %1 to %2 with port %3\n").arg( - m_dnsLookup->name(), firstRecord.target(), QString::number(port)),MessageLevel::MultiMC); + m_dnsLookup->name(), firstRecord.target(), QString::number(port)),MessageLevel::Launcher); resolve(firstRecord.target(), port); } diff --git a/launcher/launch/steps/PostLaunchCommand.cpp b/launcher/launch/steps/PostLaunchCommand.cpp index d48d03d1..143eb441 100644 --- a/launcher/launch/steps/PostLaunchCommand.cpp +++ b/launcher/launch/steps/PostLaunchCommand.cpp @@ -28,7 +28,7 @@ PostLaunchCommand::PostLaunchCommand(LaunchTask *parent) : LaunchStep(parent) void PostLaunchCommand::executeTask() { QString postlaunch_cmd = m_parent->substituteVariables(m_command); - emit logLine(tr("Running Post-Launch command: %1").arg(postlaunch_cmd), MessageLevel::MultiMC); + emit logLine(tr("Running Post-Launch command: %1").arg(postlaunch_cmd), MessageLevel::Launcher); m_process.start(postlaunch_cmd); } @@ -59,7 +59,7 @@ void PostLaunchCommand::on_state(LoggedProcess::State state) } else { - emit logLine(tr("Post-Launch command ran successfully.\n\n"), MessageLevel::MultiMC); + emit logLine(tr("Post-Launch command ran successfully.\n\n"), MessageLevel::Launcher); emitSucceeded(); } } diff --git a/launcher/launch/steps/PreLaunchCommand.cpp b/launcher/launch/steps/PreLaunchCommand.cpp index 20e089e2..1a0889c8 100644 --- a/launcher/launch/steps/PreLaunchCommand.cpp +++ b/launcher/launch/steps/PreLaunchCommand.cpp @@ -29,7 +29,7 @@ void PreLaunchCommand::executeTask() { //FIXME: where to put this? QString prelaunch_cmd = m_parent->substituteVariables(m_command); - emit logLine(tr("Running Pre-Launch command: %1").arg(prelaunch_cmd), MessageLevel::MultiMC); + emit logLine(tr("Running Pre-Launch command: %1").arg(prelaunch_cmd), MessageLevel::Launcher); m_process.start(prelaunch_cmd); } @@ -60,7 +60,7 @@ void PreLaunchCommand::on_state(LoggedProcess::State state) } else { - emit logLine(tr("Pre-Launch command ran successfully.\n\n"), MessageLevel::MultiMC); + emit logLine(tr("Pre-Launch command ran successfully.\n\n"), MessageLevel::Launcher); emitSucceeded(); } } diff --git a/launcher/main.cpp b/launcher/main.cpp index e7e277fe..3c2b9445 100644 --- a/launcher/main.cpp +++ b/launcher/main.cpp @@ -43,6 +43,8 @@ int main(int argc, char *argv[]) { Q_INIT_RESOURCE(multimc); Q_INIT_RESOURCE(backgrounds); + Q_INIT_RESOURCE(documents); + Q_INIT_RESOURCE(logo); Q_INIT_RESOURCE(pe_dark); Q_INIT_RESOURCE(pe_light); @@ -51,7 +53,6 @@ int main(int argc, char *argv[]) Q_INIT_RESOURCE(OSX); Q_INIT_RESOURCE(iOS); Q_INIT_RESOURCE(flat); - Q_INIT_RESOURCE(documents); return app.exec(); } case Launcher::Failed: diff --git a/launcher/minecraft/MinecraftInstance.cpp b/launcher/minecraft/MinecraftInstance.cpp index f86269f0..11c4dec1 100644 --- a/launcher/minecraft/MinecraftInstance.cpp +++ b/launcher/minecraft/MinecraftInstance.cpp @@ -838,7 +838,7 @@ shared_qobject_ptr MinecraftInstance::createLaunchTask(AuthSessionPt // print a header { - process->appendStep(new TextPrint(pptr, "Minecraft folder is:\n" + gameRoot() + "\n\n", MessageLevel::MultiMC)); + process->appendStep(new TextPrint(pptr, "Minecraft folder is:\n" + gameRoot() + "\n\n", MessageLevel::Launcher)); } // check java diff --git a/launcher/minecraft/MojangVersionFormat.cpp b/launcher/minecraft/MojangVersionFormat.cpp index f9cb2228..ff5409fd 100644 --- a/launcher/minecraft/MojangVersionFormat.cpp +++ b/launcher/minecraft/MojangVersionFormat.cpp @@ -5,6 +5,7 @@ #include "Json.h" using namespace Json; #include "ParseUtils.h" +#include static const int CURRENT_MINIMUM_LAUNCHER_VERSION = 18; @@ -175,9 +176,11 @@ void MojangVersionFormat::readVersionProperties(const QJsonObject &in, VersionFi { out->addProblem( ProblemSeverity::Warning, - QObject::tr("The 'minimumLauncherVersion' value of this version (%1) is higher than supported by MultiMC (%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(CURRENT_MINIMUM_LAUNCHER_VERSION)); + .arg(CURRENT_MINIMUM_LAUNCHER_VERSION) + .arg(BuildConfig.LAUNCHER_NAME) + ); } } if(in.contains("downloads")) diff --git a/launcher/minecraft/auth/flows/Yggdrasil.cpp b/launcher/minecraft/auth/flows/Yggdrasil.cpp index ce828fd4..20ca63d0 100644 --- a/launcher/minecraft/auth/flows/Yggdrasil.cpp +++ b/launcher/minecraft/auth/flows/Yggdrasil.cpp @@ -241,13 +241,16 @@ void Yggdrasil::processReply() case QNetworkReply::SslHandshakeFailedError: changeState( STATE_FAILED_SOFT, - tr("SSL Handshake failed.
There might be a few causes for it:
" - "
    " - "
  • You use Windows and need to update your root certificates, please install any outstanding updates.
  • " - "
  • Some device on your network is interfering with SSL traffic. In that case, " - "you have bigger worries than Minecraft not starting.
  • " - "
  • Possibly something else. Check the MultiMC log file for details
  • " - "
")); + tr( + "SSL Handshake failed.
There might be a few causes for it:
" + "
    " + "
  • You use Windows and need to update your root certificates, please install any outstanding updates.
  • " + "
  • Some device on your network is interfering with SSL traffic. In that case, " + "you have bigger worries than Minecraft not starting.
  • " + "
  • Possibly something else. Check the %1 log file for details
  • " + "
" + ).arg(BuildConfig.LAUNCHER_NAME) + ); return; // used for invalid credentials and similar errors. Fall through. case QNetworkReply::ContentAccessDenied: diff --git a/launcher/minecraft/launch/DirectJavaLaunch.cpp b/launcher/minecraft/launch/DirectJavaLaunch.cpp index 2110384f..2bcff664 100644 --- a/launcher/minecraft/launch/DirectJavaLaunch.cpp +++ b/launcher/minecraft/launch/DirectJavaLaunch.cpp @@ -46,7 +46,7 @@ void DirectJavaLaunch::executeTask() args.append(minecraftInstance->getMainClass()); QString allArgs = args.join(", "); - emit logLine("Java Arguments:\n[" + m_parent->censorPrivateInfo(allArgs) + "]\n\n", MessageLevel::MultiMC); + emit logLine("Java Arguments:\n[" + m_parent->censorPrivateInfo(allArgs) + "]\n\n", MessageLevel::Launcher); auto javaPath = FS::ResolveExecutable(instance->settings()->get("JavaPath").toString()); @@ -71,7 +71,7 @@ void DirectJavaLaunch::executeTask() emitFailed(tr(reason).arg(wrapperCommand)); return; } - emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::MultiMC); + emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::Launcher); args.prepend(javaPath); m_process.start(wrapperCommand, wrapperArgs + args); } @@ -117,7 +117,7 @@ void DirectJavaLaunch::on_state(LoggedProcess::State state) break; } case LoggedProcess::Running: - emit logLine(QString("Minecraft process ID: %1\n\n").arg(m_process.processId()), MessageLevel::MultiMC); + emit logLine(QString("Minecraft process ID: %1\n\n").arg(m_process.processId()), MessageLevel::Launcher); m_parent->setPid(m_process.processId()); m_parent->instance()->setLastLaunch(); break; diff --git a/launcher/minecraft/launch/LauncherPartLaunch.cpp b/launcher/minecraft/launch/LauncherPartLaunch.cpp index ee469770..ff022c40 100644 --- a/launcher/minecraft/launch/LauncherPartLaunch.cpp +++ b/launcher/minecraft/launch/LauncherPartLaunch.cpp @@ -62,7 +62,7 @@ void LauncherPartLaunch::executeTask() m_launchScript = minecraftInstance->createLaunchScript(m_session, m_serverToJoin); QStringList args = minecraftInstance->javaArguments(); QString allArgs = args.join(", "); - emit logLine("Java Arguments:\n[" + m_parent->censorPrivateInfo(allArgs) + "]\n\n", MessageLevel::MultiMC); + emit logLine("Java Arguments:\n[" + m_parent->censorPrivateInfo(allArgs) + "]\n\n", MessageLevel::Launcher); auto javaPath = FS::ResolveExecutable(instance->settings()->get("JavaPath").toString()); @@ -123,7 +123,7 @@ void LauncherPartLaunch::executeTask() emitFailed(tr(reason).arg(wrapperCommand)); return; } - emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::MultiMC); + emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::Launcher); args.prepend(javaPath); m_process.start(wrapperCommand, wrapperArgs + args); } @@ -169,7 +169,7 @@ void LauncherPartLaunch::on_state(LoggedProcess::State state) break; } case LoggedProcess::Running: - emit logLine(QString("Minecraft process ID: %1\n\n").arg(m_process.processId()), MessageLevel::MultiMC); + emit logLine(QString("Minecraft process ID: %1\n\n").arg(m_process.processId()), MessageLevel::Launcher); m_parent->setPid(m_process.processId()); m_parent->instance()->setLastLaunch(); // send the launch script to the launcher part diff --git a/launcher/minecraft/launch/PrintInstanceInfo.cpp b/launcher/minecraft/launch/PrintInstanceInfo.cpp index 0b9611ad..3da17902 100644 --- a/launcher/minecraft/launch/PrintInstanceInfo.cpp +++ b/launcher/minecraft/launch/PrintInstanceInfo.cpp @@ -100,7 +100,7 @@ void PrintInstanceInfo::executeTask() ::runGlxinfo(log); #endif - logLines(log, MessageLevel::MultiMC); - logLines(instance->verboseDescription(m_session, m_serverToJoin), MessageLevel::MultiMC); + logLines(log, MessageLevel::Launcher); + logLines(instance->verboseDescription(m_session, m_serverToJoin), MessageLevel::Launcher); emitSucceeded(); } diff --git a/launcher/net/PasteUpload.cpp b/launcher/net/PasteUpload.cpp index cb470c49..8ec6e4ae 100644 --- a/launcher/net/PasteUpload.cpp +++ b/launcher/net/PasteUpload.cpp @@ -16,7 +16,7 @@ PasteUpload::PasteUpload(QWidget *window, QString text, QString key) : m_window( sectionObject.insert("contents", text); QJsonArray sectionArray; sectionArray.append(sectionObject); - topLevelObj.insert("description", "MultiMC Log Upload"); + topLevelObj.insert("description", "Log Upload"); topLevelObj.insert("sections", sectionArray); QJsonDocument docOut; docOut.setObject(topLevelObj); diff --git a/launcher/pages/global/ProxyPage.ui b/launcher/pages/global/ProxyPage.ui index 69fcef1e..347fa86c 100644 --- a/launcher/pages/global/ProxyPage.ui +++ b/launcher/pages/global/ProxyPage.ui @@ -39,7 +39,7 @@ - This only applies to MultiMC. Minecraft does not accept proxy settings. + This only applies to the launcher. Minecraft does not accept proxy settings. Qt::AlignCenter @@ -166,7 +166,7 @@ - Note: Proxy username and password are stored in plain text inside MultiMC's configuration file! + Note: Proxy username and password are stored in plain text inside the launcher's configuration file! true diff --git a/launcher/pages/instance/LogPage.cpp b/launcher/pages/instance/LogPage.cpp index 2399b55d..2846dc51 100644 --- a/launcher/pages/instance/LogPage.cpp +++ b/launcher/pages/instance/LogPage.cpp @@ -11,6 +11,7 @@ #include #include "GuiUtil.h" #include +#include class LogFormatProxyModel : public QIdentityProxyModel { @@ -236,15 +237,30 @@ void LogPage::on_btnPaste_clicked() return; //FIXME: turn this into a proper task and move the upload logic out of GuiUtil! - m_model->append(MessageLevel::MultiMC, QString("MultiMC: Log upload triggered at: %1").arg(QDateTime::currentDateTime().toString(Qt::RFC2822Date))); + m_model->append( + MessageLevel::Launcher, + QString("%2: Log upload triggered at: %1").arg( + QDateTime::currentDateTime().toString(Qt::RFC2822Date), + BuildConfig.LAUNCHER_NAME + ) + ); auto url = GuiUtil::uploadPaste(m_model->toPlainText(), this); if(!url.isEmpty()) { - m_model->append(MessageLevel::MultiMC, QString("MultiMC: Log uploaded to: %1").arg(url)); + m_model->append( + MessageLevel::Launcher, + QString("%2: Log uploaded to: %1").arg( + url, + BuildConfig.LAUNCHER_NAME + ) + ); } else { - m_model->append(MessageLevel::Error, "MultiMC: Log upload failed!"); + m_model->append( + MessageLevel::Error, + QString("%1: Log upload failed!").arg(BuildConfig.LAUNCHER_NAME) + ); } } @@ -252,7 +268,7 @@ void LogPage::on_btnCopy_clicked() { if(!m_model) return; - m_model->append(MessageLevel::MultiMC, QString("Clipboard copy at: %1").arg(QDateTime::currentDateTime().toString(Qt::RFC2822Date))); + m_model->append(MessageLevel::Launcher, QString("Clipboard copy at: %1").arg(QDateTime::currentDateTime().toString(Qt::RFC2822Date))); GuiUtil::setClipboardText(m_model->toPlainText()); } diff --git a/launcher/resources/multimc/index.theme b/launcher/resources/multimc/index.theme index 6061b7f8..070e23f1 100644 --- a/launcher/resources/multimc/index.theme +++ b/launcher/resources/multimc/index.theme @@ -1,6 +1,6 @@ [Icon Theme] Name=multimc -Comment=MultiMC Default Icons +Comment=Default Icons Inherits=default Directories=8x8,16x16,22x22,24x24,32x32,32x32/instances,48x48,50x50/instances,64x64,128x128/instances,256x256,scalable,scalable/instances diff --git a/launcher/setupwizard/AnalyticsWizardPage.cpp b/launcher/setupwizard/AnalyticsWizardPage.cpp index 3ecc034c..f1d7b006 100644 --- a/launcher/setupwizard/AnalyticsWizardPage.cpp +++ b/launcher/setupwizard/AnalyticsWizardPage.cpp @@ -47,13 +47,13 @@ void AnalyticsWizardPage::retranslate() setSubTitle(tr("We track some anonymous statistics about users.")); textBrowser->setHtml(tr( "" - "

MultiMC sends anonymous usage statistics on every start of the application. This helps us decide what platforms and issues to focus on.

" + "

The launcher sends anonymous usage statistics on every start of the application. This helps us decide what platforms and issues to focus on.

" "

The data is processed by Google Analytics, see their article on the " "matter.

" "

The following data is collected:

" - "
  • A random unique ID of the MultiMC installation.
    It is stored in the application settings (multimc.cfg).
  • " + "
    • A random unique ID of the installation.
      It is stored in the application settings file.
    • " "
    • Anonymized (partial) IP address.
    • " - "
    • MultiMC version.
    • " + "
    • Launcher version.
    • " "
    • Operating system name, version and architecture.
    • " "
    • CPU architecture (kernel architecture on linux).
    • " "
    • Size of system memory.
    • " diff --git a/launcher/setupwizard/LanguageWizardPage.cpp b/launcher/setupwizard/LanguageWizardPage.cpp index 6a5fd737..e352ccca 100644 --- a/launcher/setupwizard/LanguageWizardPage.cpp +++ b/launcher/setupwizard/LanguageWizardPage.cpp @@ -4,6 +4,7 @@ #include "widgets/LanguageSelectionWidget.h" #include +#include LanguageWizardPage::LanguageWizardPage(QWidget *parent) : BaseWizardPage(parent) @@ -43,6 +44,6 @@ bool LanguageWizardPage::validatePage() void LanguageWizardPage::retranslate() { setTitle(tr("Language")); - setSubTitle(tr("Select the language to use in MultiMC")); + setSubTitle(tr("Select the language to use in %1").arg(BuildConfig.LAUNCHER_NAME)); mainWidget->retranslate(); } diff --git a/launcher/setupwizard/SetupWizard.cpp b/launcher/setupwizard/SetupWizard.cpp index 31334924..46b2ef79 100644 --- a/launcher/setupwizard/SetupWizard.cpp +++ b/launcher/setupwizard/SetupWizard.cpp @@ -10,6 +10,7 @@ #include #include +#include SetupWizard::SetupWizard(QWidget *parent) : QWizard(parent) { @@ -30,7 +31,7 @@ void SetupWizard::retranslate() setButtonText(QWizard::BackButton, tr("< &Back")); setButtonText(QWizard::FinishButton, tr("&Finish")); setButtonText(QWizard::CustomButton1, tr("&Refresh")); - setWindowTitle(tr("MultiMC Quick Setup")); + setWindowTitle(tr("%1 Quick Setup").arg(BuildConfig.LAUNCHER_NAME)); } BaseWizardPage * SetupWizard::getBasePage(int id) diff --git a/launcher/tasks/Task.cpp b/launcher/tasks/Task.cpp index d0ac7569..57307b43 100644 --- a/launcher/tasks/Task.cpp +++ b/launcher/tasks/Task.cpp @@ -63,7 +63,7 @@ void Task::start() } case State::Running: { - qWarning() << "MultiMC tried to start task" << describe() << "while it was already running!"; + qWarning() << "The launcher tried to start task" << describe() << "while it was already running!"; return; } } diff --git a/launcher/updater/DownloadTask_test.cpp b/launcher/updater/DownloadTask_test.cpp index 8d5375e8..dc263c17 100644 --- a/launcher/updater/DownloadTask_test.cpp +++ b/launcher/updater/DownloadTask_test.cpp @@ -77,7 +77,7 @@ slots: QTest::addColumn("ret"); QTest::newRow("one") - << MULTIMC_GET_TEST_FILE("data/1.json") + << GET_TEST_FILE("data/1.json") << (VersionFileList() << VersionFileEntry{"fileOne", 493, @@ -93,7 +93,7 @@ slots: "f12df554b21e320be6471d7154130e70"}) << QString() << true; QTest::newRow("two") - << MULTIMC_GET_TEST_FILE("data/2.json") + << GET_TEST_FILE("data/2.json") << (VersionFileList() << VersionFileEntry{"fileOne", 493, diff --git a/launcher/updater/UpdateChecker.cpp b/launcher/updater/UpdateChecker.cpp index eea73dcf..c96a6c9f 100644 --- a/launcher/updater/UpdateChecker.cpp +++ b/launcher/updater/UpdateChecker.cpp @@ -190,14 +190,6 @@ void UpdateChecker::updateChanList(bool notifyNoUpdate) return; } - if (m_channelUrl.isEmpty()) - { - qCritical() << "Failed to update channel list. No channel list URL set." - << "If you'd like to use MultiMC's update system, please pass the channel " - "list URL to CMake at compile time."; - return; - } - m_chanListLoading = true; NetJob *job = new NetJob("Update System Channel List"); job->addNetAction(Net::Download::makeByteArray(QUrl(m_channelUrl), &chanlistData)); diff --git a/launcher/widgets/CustomCommands.ui b/launcher/widgets/CustomCommands.ui index 25b2681b..21964ad2 100644 --- a/launcher/widgets/CustomCommands.ui +++ b/launcher/widgets/CustomCommands.ui @@ -74,7 +74,7 @@ - <html><head/><body><p>Pre-launch command runs before the instance launches and post-exit command runs after it exits.</p><p>Both will be run in MultiMC's working folder with extra environment variables:</p><ul><li>$INST_NAME - Name of the instance</li><li>$INST_ID - ID of the instance (its folder name)</li><li>$INST_DIR - absolute path of the instance</li><li>$INST_MC_DIR - absolute path of minecraft</li><li>$INST_JAVA - java binary used for launch</li><li>$INST_JAVA_ARGS - command-line parameters used for launch</li></ul><p>Wrapper command allows launching using an extra wrapper program (like 'optirun' on Linux)</p></body></html> + <html><head/><body><p>Pre-launch command runs before the instance launches and post-exit command runs after it exits.</p><p>Both will be run in the launcher's working folder with extra environment variables:</p><ul><li>$INST_NAME - Name of the instance</li><li>$INST_ID - ID of the instance (its folder name)</li><li>$INST_DIR - absolute path of the instance</li><li>$INST_MC_DIR - absolute path of minecraft</li><li>$INST_JAVA - java binary used for launch</li><li>$INST_JAVA_ARGS - command-line parameters used for launch</li></ul><p>Wrapper command allows launching using an extra wrapper program (like 'optirun' on Linux)</p></body></html> Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop diff --git a/launcher/widgets/JavaSettingsWidget.cpp b/launcher/widgets/JavaSettingsWidget.cpp index 672d6115..0e292bb8 100644 --- a/launcher/widgets/JavaSettingsWidget.cpp +++ b/launcher/widgets/JavaSettingsWidget.cpp @@ -16,6 +16,7 @@ #include #include #include +#include JavaSettingsWidget::JavaSettingsWidget(QWidget* parent) : QWidget(parent) { @@ -146,11 +147,11 @@ JavaSettingsWidget::ValidationStatus JavaSettingsWidget::validate() this, tr("No Java version selected"), tr("You didn't select a Java version or selected something that doesn't work.\n" - "MultiMC will not be able to start Minecraft.\n" + "%1 will not be able to start Minecraft.\n" "Do you wish to proceed without any Java?" "\n\n" "You can change the Java version in the settings later.\n" - ), + ).arg(BuildConfig.LAUNCHER_NAME), QMessageBox::Warning, QMessageBox::Yes | QMessageBox::No, QMessageBox::NoButton diff --git a/libraries/launcher/org/multimc/EntryPoint.java b/libraries/launcher/org/multimc/EntryPoint.java index d47a9b18..0f904f5f 100644 --- a/libraries/launcher/org/multimc/EntryPoint.java +++ b/libraries/launcher/org/multimc/EntryPoint.java @@ -135,7 +135,7 @@ public class EntryPoint } if(isAborted) { - System.err.println("Launch aborted by MultiMC."); + System.err.println("Launch aborted by the launcher."); return 1; } if(m_launcher != null) diff --git a/libraries/launcher/org/multimc/Utils.java b/libraries/launcher/org/multimc/Utils.java index fcf3edce..353af7d3 100644 --- a/libraries/launcher/org/multimc/Utils.java +++ b/libraries/launcher/org/multimc/Utils.java @@ -94,7 +94,7 @@ public class Utils } /** - * Log to the MultiMC console + * Log to the launcher console * * @param message A String containing the message * @param level A String containing the level name. See MinecraftLauncher::getLevel() @@ -108,7 +108,7 @@ public class Utils public static void log(String message) { - log(message, "MultiMC"); + log(message, "Launcher"); } public static void log() diff --git a/notsecrets/CMakeLists.txt b/notsecrets/CMakeLists.txt index 63930672..f12b5274 100644 --- a/notsecrets/CMakeLists.txt +++ b/notsecrets/CMakeLists.txt @@ -3,8 +3,15 @@ target_link_libraries(secrets Qt5::Core) target_compile_definitions(secrets PUBLIC -DEMBED_SECRETS) target_include_directories(secrets PUBLIC .) -set(Launcher_Name "Launcher" PARENT_SCOPE) +set(Launcher_CommonName "DevLauncher") + set(Launcher_Copyright "MultiMC Contributors" PARENT_SCOPE) +set(Launcher_Domain "multimc.org" PARENT_SCOPE) +set(Launcher_Name "${Launcher_CommonName}" PARENT_SCOPE) +set(Launcher_DisplayName "${Launcher_CommonName} 5" PARENT_SCOPE) +set(Launcher_UserAgent "${Launcher_CommonName}/5.0" PARENT_SCOPE) +set(Launcher_ConfigFile "devlauncher.cfg" PARENT_SCOPE) set(Launcher_Branding_ICNS "notsecrets/Launcher.icns" PARENT_SCOPE) set(Launcher_Branding_WindowsRC "notsecrets/launcher.rc" PARENT_SCOPE) +set(Launcher_Branding_LogoQRC "notsecrets/logo.qrc" PARENT_SCOPE) diff --git a/notsecrets/logo.qrc b/notsecrets/logo.qrc new file mode 100644 index 00000000..f1da6fe6 --- /dev/null +++ b/notsecrets/logo.qrc @@ -0,0 +1,8 @@ + + + + logo.svg + + + +