NOISSUE continue debranding...

This commit is contained in:
Petr Mrázek 2021-10-18 00:47:02 +02:00
parent 297d4b4196
commit 5b3dffce62
50 changed files with 255 additions and 172 deletions

1
.gitignore vendored
View File

@ -3,7 +3,6 @@ Thumbs.db
.user .user
.directory .directory
resources/CMakeFiles resources/CMakeFiles
resources/MultiMCLauncher.jar
*~ *~
*.swp *.swp
html/ html/

View File

@ -5,6 +5,16 @@ const Config BuildConfig;
Config::Config() 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 information
VERSION_MAJOR = @Launcher_VERSION_MAJOR@; VERSION_MAJOR = @Launcher_VERSION_MAJOR@;
VERSION_MINOR = @Launcher_VERSION_MINOR@; VERSION_MINOR = @Launcher_VERSION_MINOR@;

View File

@ -8,6 +8,12 @@ class Config
{ {
public: public:
Config(); Config();
QString LAUNCHER_NAME;
QString LAUNCHER_DISPLAYNAME;
QString LAUNCHER_COPYRIGHT;
QString LAUNCHER_DOMAIN;
QString LAUNCHER_CONFIGFILE;
/// The major version number. /// The major version number.
int VERSION_MAJOR; int VERSION_MAJOR;
/// The minor version number. /// The minor version number.
@ -31,10 +37,13 @@ public:
/// URL for the updater's channel /// URL for the updater's channel
QString UPDATER_BASE; QString UPDATER_BASE;
/// User-Agent to use. /// User-Agent to use.
QString USER_AGENT = "MultiMC/5.0"; QString USER_AGENT;
/// User-Agent to use for uncached requests. /// User-Agent to use for uncached requests.
QString USER_AGENT_UNCACHED = "MultiMC/5.0 (Uncached)"; QString USER_AGENT_UNCACHED;
/// Google analytics ID /// Google analytics ID
QString ANALYTICS_ID; QString ANALYTICS_ID;
@ -71,7 +80,7 @@ public:
QString IMGUR_CLIENT_ID; QString IMGUR_CLIENT_ID;
/** /**
* MultiMC Metadata repository URL prefix * Metadata repository URL prefix
*/ */
QString META_URL; QString META_URL;

View File

@ -23,6 +23,6 @@ public:
} }
}; };
#define MULTIMC_GET_TEST_FILE(file) TestsInternal::readFile(QFINDTESTDATA(file)) #define GET_TEST_FILE(file) TestsInternal::readFile(QFINDTESTDATA(file))
#define MULTIMC_GET_TEST_FILE_UTF8(file) TestsInternal::readFileUtf8(QFINDTESTDATA(file)) #define GET_TEST_FILE_UTF8(file) TestsInternal::readFileUtf8(QFINDTESTDATA(file))

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity name="MultiMC.Test.0" type="win32" version="5.0.0.0" /> <assemblyIdentity name="Launcher.Test.0" type="win32" version="5.0.0.0" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security> <security>
<requestedPrivileges> <requestedPrivileges>
@ -24,4 +24,4 @@
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
</application> </application>
</compatibility> </compatibility>
</assembly> </assembly>

View File

@ -17,7 +17,7 @@ BEGIN
VALUE "CompanyName", "MultiMC Contributors" VALUE "CompanyName", "MultiMC Contributors"
VALUE "FileDescription", "Testcase" VALUE "FileDescription", "Testcase"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
VALUE "ProductName", "MultiMC Testcase" VALUE "ProductName", "Launcher Testcase"
VALUE "ProductVersion", "5" VALUE "ProductVersion", "5"
END END
END END

View File

@ -25,6 +25,7 @@
#include "FileSystem.h" #include "FileSystem.h"
#include "Commandline.h" #include "Commandline.h"
#include "BuildConfig.h"
BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir) BaseInstance::BaseInstance(SettingsObjectPtr globalSettings, SettingsObjectPtr settings, const QString &rootDir)
: QObject() : QObject()
@ -260,7 +261,7 @@ QString BaseInstance::name() const
QString BaseInstance::windowTitle() 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!!! // FIXME: why is this here? move it to MinecraftInstance!!!

View File

@ -71,7 +71,7 @@ public:
virtual void saveNow() = 0; 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. * 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. * Happens when the instance folder changes to some other location, or the instance is removed by external means.

View File

@ -555,7 +555,7 @@ set(LOGIC_SOURCES
${ATLAUNCHER_SOURCES} ${ATLAUNCHER_SOURCES}
) )
SET(MULTIMC_SOURCES SET(LAUNCHER_SOURCES
# Application base # Application base
Launcher.h Launcher.h
Launcher.cpp Launcher.cpp
@ -812,7 +812,7 @@ SET(MULTIMC_SOURCES
) )
######## UIs ######## ######## UIs ########
SET(MULTIMC_UIS SET(LAUNCHER_UIS
# Instance pages # Instance pages
pages/instance/GameOptionsPage.ui pages/instance/GameOptionsPage.ui
pages/instance/VersionPage.ui pages/instance/VersionPage.ui
@ -868,7 +868,7 @@ SET(MULTIMC_UIS
widgets/MCModInfoFrame.ui widgets/MCModInfoFrame.ui
) )
set(MULTIMC_QRCS set(LAUNCHER_QRCS
resources/backgrounds/backgrounds.qrc resources/backgrounds/backgrounds.qrc
resources/multimc/multimc.qrc resources/multimc/multimc.qrc
resources/pe_dark/pe_dark.qrc resources/pe_dark/pe_dark.qrc
@ -879,19 +879,20 @@ set(MULTIMC_QRCS
resources/iOS/iOS.qrc resources/iOS/iOS.qrc
resources/flat/flat.qrc resources/flat/flat.qrc
resources/documents/documents.qrc resources/documents/documents.qrc
../${Launcher_Branding_LogoQRC}
) )
######## Windows resource files ######## ######## Windows resource files ########
if(WIN32) if(WIN32)
set(MULTIMC_RCS ../${Launcher_Branding_WindowsRC}) set(LAUNCHER_RCS ../${Launcher_Branding_WindowsRC})
endif() endif()
# Qt 5 stuff # Qt 5 stuff
qt5_wrap_ui(MULTIMC_UI ${MULTIMC_UIS}) qt5_wrap_ui(LAUNCHER_UI ${LAUNCHER_UIS})
qt5_add_resources(MULTIMC_RESOURCES ${MULTIMC_QRCS}) qt5_add_resources(LAUNCHER_RESOURCES ${LAUNCHER_QRCS})
# Add executable # 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 target_link_libraries(Launcher_logic
systeminfo systeminfo
Launcher_quazip Launcher_quazip
@ -921,7 +922,7 @@ target_link_libraries(Launcher_logic
target_link_libraries(Launcher_logic secrets) 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) target_link_libraries(${Launcher_Name} Launcher_logic)
if(DEFINED Launcher_APP_BINARY_NAME) if(DEFINED Launcher_APP_BINARY_NAME)

View File

@ -91,7 +91,7 @@ public:
LogColorCache(QColor front, QColor back) LogColorCache(QColor front, QColor back)
: ColorCache(front, back, 1.0) : 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::Debug, QColor("green"));
addColor((int)MessageLevel::Warning, QColor("orange")); addColor((int)MessageLevel::Warning, QColor("orange"));
addColor((int)MessageLevel::Error, QColor("red")); addColor((int)MessageLevel::Error, QColor("red"));

View File

@ -135,7 +135,7 @@ slots:
<< "asdf" << "asdf"
<< QString() << QString()
#if defined(Q_OS_LINUX) #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) #elif defined(Q_OS_WIN)
<< QByteArray() << QByteArray()
#endif #endif

View File

@ -259,7 +259,7 @@ void InstanceList::deleteInstance(const InstanceId& id)
return; return;
} }
qDebug() << "Instance" << id << "has been deleted by MultiMC."; qDebug() << "Instance" << id << "has been deleted by the launcher.";
} }
static QMap<InstanceId, InstanceLocator> getIdMapping(const QList<InstancePtr> &list) static QMap<InstanceId, InstanceLocator> getIdMapping(const QList<InstancePtr> &list)
@ -799,7 +799,7 @@ private slots:
private: private:
/* /*
* WHY: the whole reason why this uses an exponential backoff retry scheme is antivirus on Windows. * 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. * and causes that horrible failure that is NTFS to lock files in place because they are open.
*/ */
ExponentialSeries backoff; ExponentialSeries backoff;

View File

@ -47,7 +47,7 @@ void LaunchController::login() {
m_parentWidget, m_parentWidget,
tr("No Accounts"), tr("No Accounts"),
tr("In order to play Minecraft, you must have at least one Mojang or Minecraft " 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?"), "Would you like to open the account manager to add an account now?"),
QMessageBox::Information, QMessageBox::Information,
QMessageBox::Yes | QMessageBox::No QMessageBox::Yes | QMessageBox::No
@ -286,7 +286,7 @@ void LaunchController::launchInstance()
} }
resolved_servers = resolved_servers + "]\n\n"; 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 { } else {
online_mode = "offline"; online_mode = "offline";
} }
@ -298,10 +298,10 @@ void LaunchController::launchInstance()
auth_server_status = "offline"; 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 // 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(); m_launcher->start();
} }

View File

@ -87,7 +87,7 @@ static const QLatin1String liveCheckFile("live.check");
using namespace Commandline; 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"\ "This usually fixes the problem and you can move the application elsewhere afterwards.\n"\
"\n" "\n"
@ -179,10 +179,10 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
consoleAttached = true; consoleAttached = true;
} }
#endif #endif
setOrganizationName("MultiMC"); setOrganizationName(BuildConfig.LAUNCHER_NAME);
setOrganizationDomain("multimc.org"); setOrganizationDomain(BuildConfig.LAUNCHER_DOMAIN);
setApplicationName("MultiMC5"); setApplicationName(BuildConfig.LAUNCHER_NAME);
setApplicationDisplayName("MultiMC 5"); setApplicationDisplayName(BuildConfig.LAUNCHER_DISPLAYNAME);
setApplicationVersion(BuildConfig.printableVersionString()); setApplicationVersion(BuildConfig.printableVersionString());
startTime = QDateTime::currentDateTime(); startTime = QDateTime::currentDateTime();
@ -200,7 +200,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
showFatalErrorMessage( showFatalErrorMessage(
"Unsupported system detected!", "Unsupported system detected!",
"Linux-on-Windows distributions are not supported.\n\n" "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; return;
} }
@ -227,7 +227,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
// --dir // --dir
parser.addOption("dir"); parser.addOption("dir");
parser.addShortOpt("dir", 'd'); 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)"); "the binary location (use '.' for current)");
// --launch // --launch
parser.addOption("launch"); parser.addOption("launch");
@ -240,7 +240,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
"(only valid in combination with --launch)"); "(only valid in combination with --launch)");
// --alive // --alive
parser.addSwitch("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 // --import
parser.addOption("import"); parser.addOption("import");
parser.addShortOpt("import", 'I'); parser.addShortOpt("import", 'I');
@ -255,7 +255,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
{ {
std::cerr << "CommandLineError: " << e.what() << std::endl; std::cerr << "CommandLineError: " << e.what() << std::endl;
if(argc > 0) 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; << std::endl;
m_status = Launcher::Failed; m_status = Launcher::Failed;
return; return;
@ -298,13 +298,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
} }
else else
{ {
#ifdef MULTIMC_LINUX_DATADIR #if defined(Q_OS_MAC)
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)
QDir foo(FS::PathCombine(applicationDirPath(), "../../Data")); QDir foo(FS::PathCombine(applicationDirPath(), "../../Data"));
dataPath = foo.absolutePath(); dataPath = foo.absolutePath();
adjustedBy += "Fallback to special Mac location " + dataPath; adjustedBy += "Fallback to special Mac location " + dataPath;
@ -317,30 +311,30 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
if (!FS::ensureFolderPathExists(dataPath)) if (!FS::ensureFolderPathExists(dataPath))
{ {
showFatalErrorMessage( showFatalErrorMessage(
"MultiMC data folder could not be created.", "The launcher data folder could not be created.",
"MultiMC data folder could not be created.\n" "The launcher data folder could not be created.\n"
"\n" "\n"
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
MACOS_HINT MACOS_HINT
#endif #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" "\n"
"MultiMC cannot continue until you fix this problem." "The launcher cannot continue until you fix this problem."
); );
return; return;
} }
if (!QDir::setCurrent(dataPath)) if (!QDir::setCurrent(dataPath))
{ {
showFatalErrorMessage( showFatalErrorMessage(
"MultiMC data folder could not be opened.", "The launcher data folder could not be opened.",
"MultiMC data folder could not be opened.\n" "The launcher data folder could not be opened.\n"
"\n" "\n"
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
MACOS_HINT MACOS_HINT
#endif #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" "\n"
"MultiMC cannot continue until you fix this problem." "The launcher cannot continue until you fix this problem."
); );
return; return;
} }
@ -357,18 +351,24 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
QDir fi(applicationDirPath()); QDir fi(applicationDirPath());
QString originalData = fi.absolutePath(); QString originalData = fi.absolutePath();
// if the config file exists in Contents/MacOS, then user data is still there and needs to moved // 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"))) if (!QFileInfo::exists(FS::PathCombine(originalData, "dontmovemacdata")))
{ {
QMessageBox::StandardButton askMoveDialogue; 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) if (askMoveDialogue == QMessageBox::Yes)
{ {
qDebug() << "On macOS and found config file in old location, moving user data..."; qDebug() << "On macOS and found config file in old location, moving user data...";
QDir dir; QDir dir;
QStringList dataFiles { QStringList dataFiles {
"*.log", // MultiMC-@.log "*.log", // Launcher log files: ${Launcher_Name}-@.log
"accounts.json", "accounts.json",
"accounts", "accounts",
"assets", "assets",
@ -379,7 +379,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
"meta", "meta",
"metacache", "metacache",
"mods", "mods",
"multimc.cfg", BuildConfig.LAUNCHER_CONFIGFILE,
"themes", "themes",
"translations" "translations"
}; };
@ -451,7 +451,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
// init the logger // 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) auto moveFile = [](const QString &oldName, const QString &newName)
{ {
QFile::remove(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)) if(!logFile->open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Truncate))
{ {
showFatalErrorMessage( showFatalErrorMessage(
"MultiMC data folder is not writable!", "The launcher data folder is not writable!",
"MultiMC couldn't create a log file - the MultiMC data folder is not writable.\n" "The launcher couldn't create a log file - the data folder is not writable.\n"
"\n" "\n"
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
MACOS_HINT MACOS_HINT
#endif #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" "\n"
"MultiMC cannot continue until you fix this problem." "The launcher cannot continue until you fix this problem."
); );
return; return;
} }
@ -503,7 +503,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
ENV.setJarsPath( TOSTRING(MULTIMC_JARS_LOCATION) ); ENV.setJarsPath( TOSTRING(MULTIMC_JARS_LOCATION) );
#endif #endif
qDebug() << "MultiMC 5, (c) 2013-2021 MultiMC Contributors"; qDebug() << BuildConfig.LAUNCHER_DISPLAYNAME << ", (c) 2013-2021 " << BuildConfig.LAUNCHER_COPYRIGHT;
qDebug() << "Version : " << BuildConfig.printableVersionString(); qDebug() << "Version : " << BuildConfig.printableVersionString();
qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT; qDebug() << "Git commit : " << BuildConfig.GIT_COMMIT;
qDebug() << "Git refspec : " << BuildConfig.GIT_REFSPEC; qDebug() << "Git refspec : " << BuildConfig.GIT_REFSPEC;
@ -553,7 +553,7 @@ Launcher::Launcher(int &argc, char **argv) : QApplication(argc, argv)
// Initialize application settings // Initialize application settings
{ {
m_settings.reset(new INISettingsObject("multimc.cfg", this)); m_settings.reset(new INISettingsObject(BuildConfig.LAUNCHER_CONFIGFILE, this));
// Updates // Updates
m_settings->registerSetting("UpdateChannel", BuildConfig.VERSION_CHANNEL); m_settings->registerSetting("UpdateChannel", BuildConfig.VERSION_CHANNEL);
m_settings->registerSetting("AutoUpdate", true); m_settings->registerSetting("AutoUpdate", true);
@ -1164,6 +1164,9 @@ void Launcher::setIconTheme(const QString& name)
QIcon Launcher::getThemedIcon(const QString& name) QIcon Launcher::getThemedIcon(const QString& name)
{ {
if(name == "logo") {
return QIcon(":/logo.svg");
}
return XdgIcon::fromTheme(name); return XdgIcon::fromTheme(name);
} }

View File

@ -221,7 +221,7 @@ private:
// main window, if any // main window, if any
MainWindow * m_mainWindow = nullptr; 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; LocalPeer * m_peerInstance = nullptr;
GAnalytics * m_analytics = nullptr; GAnalytics * m_analytics = nullptr;

View File

@ -65,16 +65,16 @@ void LoggedProcess::on_exit(int exit_code, QProcess::ExitStatus status)
if (status == QProcess::NormalExit) if (status == QProcess::NormalExit)
{ {
//: Message displayed on instance exit //: 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); changeState(LoggedProcess::Finished);
} }
else else
{ {
//: Message displayed on instance crashed //: Message displayed on instance crashed
if(exit_code == -1) if(exit_code == -1)
emit log({tr("Process crashed.")}, MessageLevel::MultiMC); emit log({tr("Process crashed.")}, MessageLevel::Launcher);
else 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); changeState(LoggedProcess::Crashed);
} }
} }

View File

@ -133,11 +133,21 @@ public:
{ {
if(m_text) 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) 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: private:
@ -324,7 +334,7 @@ public:
actionReportBug->setObjectName(QStringLiteral("actionReportBug")); actionReportBug->setObjectName(QStringLiteral("actionReportBug"));
actionReportBug->setIcon(LAUNCHER->getThemedIcon("bug")); actionReportBug->setIcon(LAUNCHER->getThemedIcon("bug"));
actionReportBug.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Report a 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); all_actions.append(&actionReportBug);
helpMenu->addAction(actionReportBug); helpMenu->addAction(actionReportBug);
} }
@ -334,7 +344,7 @@ public:
actionDISCORD->setObjectName(QStringLiteral("actionDISCORD")); actionDISCORD->setObjectName(QStringLiteral("actionDISCORD"));
actionDISCORD->setIcon(LAUNCHER->getThemedIcon("discord")); actionDISCORD->setIcon(LAUNCHER->getThemedIcon("discord"));
actionDISCORD.setTextId(QT_TRANSLATE_NOOP("MainWindow", "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); all_actions.append(&actionDISCORD);
helpMenu->addAction(actionDISCORD); helpMenu->addAction(actionDISCORD);
} }
@ -344,7 +354,7 @@ public:
actionREDDIT->setObjectName(QStringLiteral("actionREDDIT")); actionREDDIT->setObjectName(QStringLiteral("actionREDDIT"));
actionREDDIT->setIcon(LAUNCHER->getThemedIcon("reddit-alien")); actionREDDIT->setIcon(LAUNCHER->getThemedIcon("reddit-alien"));
actionREDDIT.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Reddit")); 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); all_actions.append(&actionREDDIT);
helpMenu->addAction(actionREDDIT); helpMenu->addAction(actionREDDIT);
} }
@ -353,14 +363,14 @@ public:
actionAbout->setObjectName(QStringLiteral("actionAbout")); actionAbout->setObjectName(QStringLiteral("actionAbout"));
actionAbout->setIcon(LAUNCHER->getThemedIcon("about")); actionAbout->setIcon(LAUNCHER->getThemedIcon("about"));
actionAbout->setMenuRole(QAction::AboutRole); actionAbout->setMenuRole(QAction::AboutRole);
actionAbout.setTextId(QT_TRANSLATE_NOOP("MainWindow", "About MultiMC")); actionAbout.setTextId(QT_TRANSLATE_NOOP("MainWindow", "About %1"));
actionAbout.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "View information about MultiMC.")); actionAbout.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "View information about %1."));
all_actions.append(&actionAbout); all_actions.append(&actionAbout);
helpMenu->addAction(actionAbout); helpMenu->addAction(actionAbout);
helpMenuButton = TranslatedToolButton(MainWindow); helpMenuButton = TranslatedToolButton(MainWindow);
helpMenuButton.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Help")); 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->setMenu(helpMenu);
helpMenuButton->setPopupMode(QToolButton::InstantPopup); helpMenuButton->setPopupMode(QToolButton::InstantPopup);
helpMenuButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); helpMenuButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
@ -377,7 +387,7 @@ public:
actionCheckUpdate->setObjectName(QStringLiteral("actionCheckUpdate")); actionCheckUpdate->setObjectName(QStringLiteral("actionCheckUpdate"));
actionCheckUpdate->setIcon(LAUNCHER->getThemedIcon("checkupdate")); actionCheckUpdate->setIcon(LAUNCHER->getThemedIcon("checkupdate"));
actionCheckUpdate.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Update")); 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); all_actions.append(&actionCheckUpdate);
mainToolBar->addAction(actionCheckUpdate); mainToolBar->addAction(actionCheckUpdate);
} }
@ -387,8 +397,8 @@ public:
actionPatreon = TranslatedAction(MainWindow); actionPatreon = TranslatedAction(MainWindow);
actionPatreon->setObjectName(QStringLiteral("actionPatreon")); actionPatreon->setObjectName(QStringLiteral("actionPatreon"));
actionPatreon->setIcon(LAUNCHER->getThemedIcon("patreon")); actionPatreon->setIcon(LAUNCHER->getThemedIcon("patreon"));
actionPatreon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Support MultiMC")); actionPatreon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Support %1"));
actionPatreon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the MultiMC Patreon page.")); actionPatreon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Open the %1 Patreon page."));
all_actions.append(&actionPatreon); all_actions.append(&actionPatreon);
mainToolBar->addAction(actionPatreon); mainToolBar->addAction(actionPatreon);
@ -437,7 +447,7 @@ public:
actionMoreNews->setObjectName(QStringLiteral("actionMoreNews")); actionMoreNews->setObjectName(QStringLiteral("actionMoreNews"));
actionMoreNews->setIcon(LAUNCHER->getThemedIcon("news")); actionMoreNews->setIcon(LAUNCHER->getThemedIcon("news"));
actionMoreNews.setTextId(QT_TRANSLATE_NOOP("MainWindow", "More 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); all_actions.append(&actionMoreNews);
newsToolBar->addAction(actionMoreNews); newsToolBar->addAction(actionMoreNews);
@ -596,9 +606,9 @@ public:
} }
MainWindow->resize(800, 600); MainWindow->resize(800, 600);
MainWindow->setWindowIcon(LAUNCHER->getThemedIcon("logo")); MainWindow->setWindowIcon(LAUNCHER->getThemedIcon("logo"));
MainWindow->setWindowTitle("MultiMC 5"); MainWindow->setWindowTitle(BuildConfig.LAUNCHER_DISPLAYNAME);
#ifndef QT_NO_ACCESSIBILITY #ifndef QT_NO_ACCESSIBILITY
MainWindow->setAccessibleName("MultiMC"); MainWindow->setAccessibleName(BuildConfig.LAUNCHER_NAME);
#endif #endif
createMainToolbar(MainWindow); createMainToolbar(MainWindow);
@ -623,7 +633,7 @@ public:
void retranslateUi(QMainWindow *MainWindow) 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()) if (!BuildConfig.BUILD_PLATFORM.isEmpty())
{ {
winTitle += tr(" on %1", "on platform, as in operating system").arg(BuildConfig.BUILD_PLATFORM); 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); auto group = view->groupNameAt(pos);
QAction *actionVoid = new QAction("MultiMC", this); QAction *actionVoid = new QAction(BuildConfig.LAUNCHER_NAME, this);
actionVoid->setEnabled(false); actionVoid->setEnabled(false);
QAction *actionCreateInstance = new QAction(tr("Create instance"), this); QAction *actionCreateInstance = new QAction(tr("Create instance"), this);
@ -1381,10 +1391,13 @@ void MainWindow::finalizeInstance(InstancePtr inst)
} }
else else
{ {
CustomMessageBox::selectable(this, tr("Error"), tr("MultiMC cannot download Minecraft or update instances unless you have at least " CustomMessageBox::selectable(
"one account added.\nPlease add your Mojang or Minecraft account."), this,
QMessageBox::Warning) tr("Error"),
->show(); 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); QMessageBox warning(this);
warning.setText(tr("Your instance folder contains \'!\' and this is known to cause Java problems!")); warning.setText(tr("Your instance folder contains \'!\' and this is known to cause Java problems!"));
warning.setInformativeText(tr("You have now two options: <br/>" warning.setInformativeText(
" - change the instance folder in the settings <br/>" tr(
" - move this installation of MultiMC5 to a different folder")); "You have now two options: <br/>"
" - change the instance folder in the settings <br/>"
" - move this installation of %1 to a different folder"
).arg(BuildConfig.LAUNCHER_NAME)
);
warning.setDefaultButton(QMessageBox::Ok); warning.setDefaultButton(QMessageBox::Ok);
warning.exec(); warning.exec();
} }
auto tempFolderText = tr("This is a problem: <br/>" auto tempFolderText = tr("This is a problem: <br/>"
" - MultiMC will likely be deleted without warning by the operating system <br/>" " - The launcher will likely be deleted without warning by the operating system <br/>"
" - close MultiMC now and extract it to a real location, not a temporary folder"); " - close the launcher now and extract it to a real location, not a temporary folder");
QString pathfoldername = QDir(instanceFolder).absolutePath(); QString pathfoldername = QDir(instanceFolder).absolutePath();
if (pathfoldername.contains("Rar$", Qt::CaseInsensitive)) if (pathfoldername.contains("Rar$", Qt::CaseInsensitive))
{ {
QMessageBox warning(this); 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.setInformativeText(tempFolderText);
warning.setDefaultButton(QMessageBox::Ok); warning.setDefaultButton(QMessageBox::Ok);
warning.exec(); warning.exec();

View File

@ -2,8 +2,8 @@
MessageLevel::Enum MessageLevel::getLevel(const QString& levelName) MessageLevel::Enum MessageLevel::getLevel(const QString& levelName)
{ {
if (levelName == "MultiMC") if (levelName == "Launcher")
return MessageLevel::MultiMC; return MessageLevel::Launcher;
else if (levelName == "Debug") else if (levelName == "Debug")
return MessageLevel::Debug; return MessageLevel::Debug;
else if (levelName == "Info") else if (levelName == "Info")

View File

@ -13,7 +13,7 @@ enum Enum
Unknown, /**< No idea what this is or where it came from */ Unknown, /**< No idea what this is or where it came from */
StdOut, /**< Undetermined stderr messages */ StdOut, /**< Undetermined stderr messages */
StdErr, /**< Undetermined stdout messages */ StdErr, /**< Undetermined stdout messages */
MultiMC, /**< MultiMC Messages */ Launcher, /**< Launcher Messages */
Debug, /**< Debug Messages */ Debug, /**< Debug Messages */
Info, /**< Info Messages */ Info, /**< Info Messages */
Message, /**< Standard Messages */ Message, /**< Standard Messages */

View File

@ -8,6 +8,9 @@
#include <chrono> #include <chrono>
#include <LocalPeer.h> #include <LocalPeer.h>
#include "BuildConfig.h"
// from <sys/stat.h> // from <sys/stat.h>
#ifndef S_IRUSR #ifndef S_IRUSR
#define __S_IREAD 0400 /* Read by owner. */ #define __S_IREAD 0400 /* Read by owner. */
@ -91,7 +94,7 @@ void UpdateController::installUpdates()
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QString finishCmd = QApplication::applicationFilePath(); QString finishCmd = QApplication::applicationFilePath();
#elif defined Q_OS_LINUX #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 #elif defined Q_OS_MAC
QString finishCmd = QApplication::applicationFilePath(); QString finishCmd = QApplication::applicationFilePath();
#else #else
@ -127,8 +130,9 @@ void UpdateController::installUpdates()
case GoUpdate::Operation::OP_REPLACE: case GoUpdate::Operation::OP_REPLACE:
{ {
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32
QString windowsExeName = BuildConfig.LAUNCHER_NAME + ".exe";
// hack for people renaming the .exe because ... reasons :) // hack for people renaming the .exe because ... reasons :)
if(op.destination == "MultiMC.exe") if(op.destination == windowsExeName)
{ {
op.destination = QFileInfo(QApplication::applicationFilePath()).fileName(); op.destination = QFileInfo(QApplication::applicationFilePath()).fileName();
} }
@ -137,7 +141,7 @@ void UpdateController::installUpdates()
#ifdef Q_OS_WIN32 #ifdef Q_OS_WIN32
if(QSysInfo::windowsVersion() < QSysInfo::WV_VISTA) if(QSysInfo::windowsVersion() < QSysInfo::WV_VISTA)
{ {
if(destination.fileName() == "MultiMC.exe") if(destination.fileName() == windowsExeName)
{ {
QDir rootDir(m_root); QDir rootDir(m_root);
exeOrigin = rootDir.relativeFilePath(op.source); exeOrigin = rootDir.relativeFilePath(op.source);
@ -365,16 +369,20 @@ void UpdateController::fail()
{ {
case Replace: case Replace:
{ {
msg = QObject::tr("Couldn't replace file %1. Changes will be reverted.\n" msg = QObject::tr(
"See the MultiMC log file for details.").arg(m_failedFile); "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; doRollback = true;
QMessageBox::critical(m_parent, failTitle, msg); QMessageBox::critical(m_parent, failTitle, msg);
break; break;
} }
case Delete: case Delete:
{ {
msg = QObject::tr("Couldn't remove file %1. Changes will be reverted.\n" msg = QObject::tr(
"See the MultiMC log file for details.").arg(m_failedFile); "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; doRollback = true;
QMessageBox::critical(m_parent, failTitle, msg); QMessageBox::critical(m_parent, failTitle, msg);
break; break;
@ -404,8 +412,8 @@ void UpdateController::fail()
if(!rollbackOK) if(!rollbackOK)
{ {
msg = QObject::tr("The rollback failed too.\n" msg = QObject::tr("The rollback failed too.\n"
"You will have to repair MultiMC manually.\n" "You will have to repair %1 manually.\n"
"Please let us know why and how this happened.").arg(m_failedFile); "Please let us know why and how this happened.").arg(BuildConfig.LAUNCHER_NAME);
QMessageBox::critical(m_parent, rollFailTitle, msg); QMessageBox::critical(m_parent, rollFailTitle, msg);
qApp->quit(); qApp->quit();
} }

View File

@ -31,9 +31,10 @@ QString getCreditsHtml(QStringList patrons)
QString patronsHeading = QObject::tr("Patrons", "About Credits"); QString patronsHeading = QObject::tr("Patrons", "About Credits");
QString output; QString output;
QTextStream stream(&output); QTextStream stream(&output);
stream.setCodec(QTextCodec::codecForName("UTF-8"));
stream << "<center>\n"; stream << "<center>\n";
// TODO: possibly retrieve from git history at build time? // TODO: possibly retrieve from git history at build time?
stream << "<h3>" << QObject::tr("MultiMC Developers", "About Credits") << "</h3>\n"; stream << "<h3>" << QObject::tr("Developers", "About Credits") << "</h3>\n";
stream << "<p>Andrew Okin &lt;<a href='mailto:forkk@forkk.net'>forkk@forkk.net</a>&gt;</p>\n"; stream << "<p>Andrew Okin &lt;<a href='mailto:forkk@forkk.net'>forkk@forkk.net</a>&gt;</p>\n";
stream << "<p>Petr Mrázek &lt;<a href='mailto:peterix@gmail.com'>peterix@gmail.com</a>&gt;</p>\n"; stream << "<p>Petr Mrázek &lt;<a href='mailto:peterix@gmail.com'>peterix@gmail.com</a>&gt;</p>\n";
stream << "<p>Sky Welch &lt;<a href='mailto:multimc@bunnies.io'>multimc@bunnies.io</a>&gt;</p>\n"; stream << "<p>Sky Welch &lt;<a href='mailto:multimc@bunnies.io'>multimc@bunnies.io</a>&gt;</p>\n";
@ -75,6 +76,10 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia
{ {
ui->setupUi(this); ui->setupUi(this);
QString launcherName = BuildConfig.LAUNCHER_NAME;
setWindowTitle(tr("About %1").arg(launcherName));
QString chtml = getCreditsHtml(QStringList()); QString chtml = getCreditsHtml(QStringList());
ui->creditsText->setHtml(chtml); ui->creditsText->setHtml(chtml);
@ -84,7 +89,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QDialog(parent), ui(new Ui::AboutDia
ui->urlLabel->setOpenExternalLinks(true); ui->urlLabel->setOpenExternalLinks(true);
ui->icon->setPixmap(LAUNCHER->getThemedIcon("logo").pixmap(64)); 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->versionLabel->setText(tr("Version") +": " + BuildConfig.printableVersionString());
ui->platformLabel->setText(tr("Platform") +": " + BuildConfig.BUILD_PLATFORM); ui->platformLabel->setText(tr("Platform") +": " + BuildConfig.BUILD_PLATFORM);

View File

@ -16,9 +16,6 @@
<height>400</height> <height>400</height>
</size> </size>
</property> </property>
<property name="windowTitle">
<string>About MultiMC</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">

View File

@ -48,7 +48,7 @@ void CheckJava::executeTask()
} }
else 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); QFileInfo javaInfo(realJavaPath);
@ -62,7 +62,7 @@ void CheckJava::executeTask()
if (javaUnixTime != storedUnixTime || storedVersion.size() == 0 || storedArchitecture.size() == 0 || storedVendor.size() == 0) if (javaUnixTime != storedUnixTime || storedVersion.size() == 0 || storedArchitecture.size() == 0 || storedVendor.size() == 0)
{ {
m_JavaChecker = new JavaChecker(); 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); connect(m_JavaChecker.get(), &JavaChecker::checkFinished, this, &CheckJava::checkJavaFinished);
m_JavaChecker->m_path = realJavaPath; m_JavaChecker->m_path = realJavaPath;
m_JavaChecker->performCheck(); m_JavaChecker->performCheck();
@ -87,7 +87,7 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
// Error message displayed if java can't start // Error message displayed if java can't start
emit logLine(QString("Could not start java:"), MessageLevel::Error); emit logLine(QString("Could not start java:"), MessageLevel::Error);
emit logLines(result.errorLog.split('\n'), 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); printSystemInfo(false, false);
emitFailed(QString("Could not start java!")); emitFailed(QString("Could not start java!"));
return; 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 logLine(QString("Java checker returned some invalid data MultiMC doesn't understand:"), MessageLevel::Error);
emit logLines(result.outLog.split('\n'), MessageLevel::Warning); 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); printSystemInfo(false, false);
emitSucceeded(); emitSucceeded();
return; return;
@ -117,7 +117,7 @@ void CheckJava::checkJavaFinished(JavaCheckResult result)
void CheckJava::printJavaInfo(const QString& version, const QString& architecture, const QString & vendor) 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"); printSystemInfo(true, architecture == "64");
} }

View File

@ -103,8 +103,8 @@ signals:
void requestLogging(); void requestLogging();
public slots: public slots:
void onLogLines(const QStringList& lines, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC); void onLogLines(const QStringList& lines, MessageLevel::Enum defaultLevel = MessageLevel::Launcher);
void onLogLine(QString line, MessageLevel::Enum defaultLevel = MessageLevel::MultiMC); void onLogLine(QString line, MessageLevel::Enum defaultLevel = MessageLevel::Launcher);
void onReadyForLaunch(); void onReadyForLaunch();
void onStepFinished(); void onStepFinished();
void onProgressReportingRequested(); void onProgressReportingRequested();

View File

@ -60,7 +60,7 @@ void LookupServerAddress::on_dnsLookupFinished()
if (m_dnsLookup->error() != QDnsLookup::NoError) if (m_dnsLookup->error() != QDnsLookup::NoError)
{ {
emit logLine(QString("Failed to resolve server address (this is NOT an error!) %1: %2\n") 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 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 // and leave it up to minecraft to fail (or maybe not) when connecting
return; return;
@ -81,7 +81,7 @@ void LookupServerAddress::on_dnsLookupFinished()
quint16 port = firstRecord.port(); quint16 port = firstRecord.port();
emit logLine(QString("Resolved server address %1 to %2 with port %3\n").arg( 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); resolve(firstRecord.target(), port);
} }

View File

@ -28,7 +28,7 @@ PostLaunchCommand::PostLaunchCommand(LaunchTask *parent) : LaunchStep(parent)
void PostLaunchCommand::executeTask() void PostLaunchCommand::executeTask()
{ {
QString postlaunch_cmd = m_parent->substituteVariables(m_command); 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); m_process.start(postlaunch_cmd);
} }
@ -59,7 +59,7 @@ void PostLaunchCommand::on_state(LoggedProcess::State state)
} }
else 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(); emitSucceeded();
} }
} }

View File

@ -29,7 +29,7 @@ void PreLaunchCommand::executeTask()
{ {
//FIXME: where to put this? //FIXME: where to put this?
QString prelaunch_cmd = m_parent->substituteVariables(m_command); 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); m_process.start(prelaunch_cmd);
} }
@ -60,7 +60,7 @@ void PreLaunchCommand::on_state(LoggedProcess::State state)
} }
else 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(); emitSucceeded();
} }
} }

View File

@ -43,6 +43,8 @@ int main(int argc, char *argv[])
{ {
Q_INIT_RESOURCE(multimc); Q_INIT_RESOURCE(multimc);
Q_INIT_RESOURCE(backgrounds); Q_INIT_RESOURCE(backgrounds);
Q_INIT_RESOURCE(documents);
Q_INIT_RESOURCE(logo);
Q_INIT_RESOURCE(pe_dark); Q_INIT_RESOURCE(pe_dark);
Q_INIT_RESOURCE(pe_light); Q_INIT_RESOURCE(pe_light);
@ -51,7 +53,6 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(OSX); Q_INIT_RESOURCE(OSX);
Q_INIT_RESOURCE(iOS); Q_INIT_RESOURCE(iOS);
Q_INIT_RESOURCE(flat); Q_INIT_RESOURCE(flat);
Q_INIT_RESOURCE(documents);
return app.exec(); return app.exec();
} }
case Launcher::Failed: case Launcher::Failed:

View File

@ -838,7 +838,7 @@ shared_qobject_ptr<LaunchTask> MinecraftInstance::createLaunchTask(AuthSessionPt
// print a header // 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 // check java

View File

@ -5,6 +5,7 @@
#include "Json.h" #include "Json.h"
using namespace Json; using namespace Json;
#include "ParseUtils.h" #include "ParseUtils.h"
#include <BuildConfig.h>
static const int CURRENT_MINIMUM_LAUNCHER_VERSION = 18; static const int CURRENT_MINIMUM_LAUNCHER_VERSION = 18;
@ -175,9 +176,11 @@ void MojangVersionFormat::readVersionProperties(const QJsonObject &in, VersionFi
{ {
out->addProblem( out->addProblem(
ProblemSeverity::Warning, 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(out->minimumLauncherVersion)
.arg(CURRENT_MINIMUM_LAUNCHER_VERSION)); .arg(CURRENT_MINIMUM_LAUNCHER_VERSION)
.arg(BuildConfig.LAUNCHER_NAME)
);
} }
} }
if(in.contains("downloads")) if(in.contains("downloads"))

View File

@ -241,13 +241,16 @@ void Yggdrasil::processReply()
case QNetworkReply::SslHandshakeFailedError: case QNetworkReply::SslHandshakeFailedError:
changeState( changeState(
STATE_FAILED_SOFT, STATE_FAILED_SOFT,
tr("<b>SSL Handshake failed.</b><br/>There might be a few causes for it:<br/>" tr(
"<ul>" "<b>SSL Handshake failed.</b><br/>There might be a few causes for it:<br/>"
"<li>You use Windows and need to update your root certificates, please install any outstanding updates.</li>" "<ul>"
"<li>Some device on your network is interfering with SSL traffic. In that case, " "<li>You use Windows and need to update your root certificates, please install any outstanding updates.</li>"
"you have bigger worries than Minecraft not starting.</li>" "<li>Some device on your network is interfering with SSL traffic. In that case, "
"<li>Possibly something else. Check the MultiMC log file for details</li>" "you have bigger worries than Minecraft not starting.</li>"
"</ul>")); "<li>Possibly something else. Check the %1 log file for details</li>"
"</ul>"
).arg(BuildConfig.LAUNCHER_NAME)
);
return; return;
// used for invalid credentials and similar errors. Fall through. // used for invalid credentials and similar errors. Fall through.
case QNetworkReply::ContentAccessDenied: case QNetworkReply::ContentAccessDenied:

View File

@ -46,7 +46,7 @@ void DirectJavaLaunch::executeTask()
args.append(minecraftInstance->getMainClass()); args.append(minecraftInstance->getMainClass());
QString allArgs = args.join(", "); 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()); auto javaPath = FS::ResolveExecutable(instance->settings()->get("JavaPath").toString());
@ -71,7 +71,7 @@ void DirectJavaLaunch::executeTask()
emitFailed(tr(reason).arg(wrapperCommand)); emitFailed(tr(reason).arg(wrapperCommand));
return; 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); args.prepend(javaPath);
m_process.start(wrapperCommand, wrapperArgs + args); m_process.start(wrapperCommand, wrapperArgs + args);
} }
@ -117,7 +117,7 @@ void DirectJavaLaunch::on_state(LoggedProcess::State state)
break; break;
} }
case LoggedProcess::Running: 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->setPid(m_process.processId());
m_parent->instance()->setLastLaunch(); m_parent->instance()->setLastLaunch();
break; break;

View File

@ -62,7 +62,7 @@ void LauncherPartLaunch::executeTask()
m_launchScript = minecraftInstance->createLaunchScript(m_session, m_serverToJoin); m_launchScript = minecraftInstance->createLaunchScript(m_session, m_serverToJoin);
QStringList args = minecraftInstance->javaArguments(); QStringList args = minecraftInstance->javaArguments();
QString allArgs = args.join(", "); 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()); auto javaPath = FS::ResolveExecutable(instance->settings()->get("JavaPath").toString());
@ -123,7 +123,7 @@ void LauncherPartLaunch::executeTask()
emitFailed(tr(reason).arg(wrapperCommand)); emitFailed(tr(reason).arg(wrapperCommand));
return; 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); args.prepend(javaPath);
m_process.start(wrapperCommand, wrapperArgs + args); m_process.start(wrapperCommand, wrapperArgs + args);
} }
@ -169,7 +169,7 @@ void LauncherPartLaunch::on_state(LoggedProcess::State state)
break; break;
} }
case LoggedProcess::Running: 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->setPid(m_process.processId());
m_parent->instance()->setLastLaunch(); m_parent->instance()->setLastLaunch();
// send the launch script to the launcher part // send the launch script to the launcher part

View File

@ -100,7 +100,7 @@ void PrintInstanceInfo::executeTask()
::runGlxinfo(log); ::runGlxinfo(log);
#endif #endif
logLines(log, MessageLevel::MultiMC); logLines(log, MessageLevel::Launcher);
logLines(instance->verboseDescription(m_session, m_serverToJoin), MessageLevel::MultiMC); logLines(instance->verboseDescription(m_session, m_serverToJoin), MessageLevel::Launcher);
emitSucceeded(); emitSucceeded();
} }

View File

@ -16,7 +16,7 @@ PasteUpload::PasteUpload(QWidget *window, QString text, QString key) : m_window(
sectionObject.insert("contents", text); sectionObject.insert("contents", text);
QJsonArray sectionArray; QJsonArray sectionArray;
sectionArray.append(sectionObject); sectionArray.append(sectionObject);
topLevelObj.insert("description", "MultiMC Log Upload"); topLevelObj.insert("description", "Log Upload");
topLevelObj.insert("sections", sectionArray); topLevelObj.insert("sections", sectionArray);
QJsonDocument docOut; QJsonDocument docOut;
docOut.setObject(topLevelObj); docOut.setObject(topLevelObj);

View File

@ -39,7 +39,7 @@
<item> <item>
<widget class="QLabel" name="proxyPlainTextWarningLabel_2"> <widget class="QLabel" name="proxyPlainTextWarningLabel_2">
<property name="text"> <property name="text">
<string>This only applies to MultiMC. Minecraft does not accept proxy settings.</string> <string>This only applies to the launcher. Minecraft does not accept proxy settings.</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -166,7 +166,7 @@
<item row="2" column="0" colspan="2"> <item row="2" column="0" colspan="2">
<widget class="QLabel" name="proxyPlainTextWarningLabel"> <widget class="QLabel" name="proxyPlainTextWarningLabel">
<property name="text"> <property name="text">
<string>Note: Proxy username and password are stored in plain text inside MultiMC's configuration file!</string> <string>Note: Proxy username and password are stored in plain text inside the launcher's configuration file!</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>

View File

@ -11,6 +11,7 @@
#include <settings/Setting.h> #include <settings/Setting.h>
#include "GuiUtil.h" #include "GuiUtil.h"
#include <ColorCache.h> #include <ColorCache.h>
#include <BuildConfig.h>
class LogFormatProxyModel : public QIdentityProxyModel class LogFormatProxyModel : public QIdentityProxyModel
{ {
@ -236,15 +237,30 @@ void LogPage::on_btnPaste_clicked()
return; return;
//FIXME: turn this into a proper task and move the upload logic out of GuiUtil! //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); auto url = GuiUtil::uploadPaste(m_model->toPlainText(), this);
if(!url.isEmpty()) 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 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) if(!m_model)
return; 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()); GuiUtil::setClipboardText(m_model->toPlainText());
} }

View File

@ -1,6 +1,6 @@
[Icon Theme] [Icon Theme]
Name=multimc Name=multimc
Comment=MultiMC Default Icons Comment=Default Icons
Inherits=default Inherits=default
Directories=8x8,16x16,22x22,24x24,32x32,32x32/instances,48x48,50x50/instances,64x64,128x128/instances,256x256,scalable,scalable/instances Directories=8x8,16x16,22x22,24x24,32x32,32x32/instances,48x48,50x50/instances,64x64,128x128/instances,256x256,scalable,scalable/instances

View File

@ -47,13 +47,13 @@ void AnalyticsWizardPage::retranslate()
setSubTitle(tr("We track some anonymous statistics about users.")); setSubTitle(tr("We track some anonymous statistics about users."));
textBrowser->setHtml(tr( textBrowser->setHtml(tr(
"<html><body>" "<html><body>"
"<p>MultiMC sends anonymous usage statistics on every start of the application. This helps us decide what platforms and issues to focus on.</p>" "<p>The launcher sends anonymous usage statistics on every start of the application. This helps us decide what platforms and issues to focus on.</p>"
"<p>The data is processed by Google Analytics, see their <a href=\"https://support.google.com/analytics/answer/6004245?hl=en\">article on the " "<p>The data is processed by Google Analytics, see their <a href=\"https://support.google.com/analytics/answer/6004245?hl=en\">article on the "
"matter</a>.</p>" "matter</a>.</p>"
"<p>The following data is collected:</p>" "<p>The following data is collected:</p>"
"<ul><li>A random unique ID of the MultiMC installation.<br />It is stored in the application settings (multimc.cfg).</li>" "<ul><li>A random unique ID of the installation.<br />It is stored in the application settings file.</li>"
"<li>Anonymized (partial) IP address.</li>" "<li>Anonymized (partial) IP address.</li>"
"<li>MultiMC version.</li>" "<li>Launcher version.</li>"
"<li>Operating system name, version and architecture.</li>" "<li>Operating system name, version and architecture.</li>"
"<li>CPU architecture (kernel architecture on linux).</li>" "<li>CPU architecture (kernel architecture on linux).</li>"
"<li>Size of system memory.</li>" "<li>Size of system memory.</li>"

View File

@ -4,6 +4,7 @@
#include "widgets/LanguageSelectionWidget.h" #include "widgets/LanguageSelectionWidget.h"
#include <QVBoxLayout> #include <QVBoxLayout>
#include <BuildConfig.h>
LanguageWizardPage::LanguageWizardPage(QWidget *parent) LanguageWizardPage::LanguageWizardPage(QWidget *parent)
: BaseWizardPage(parent) : BaseWizardPage(parent)
@ -43,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 MultiMC")); setSubTitle(tr("Select the language to use in %1").arg(BuildConfig.LAUNCHER_NAME));
mainWidget->retranslate(); mainWidget->retranslate();
} }

View File

@ -10,6 +10,7 @@
#include <ganalytics.h> #include <ganalytics.h>
#include <QAbstractButton> #include <QAbstractButton>
#include <BuildConfig.h>
SetupWizard::SetupWizard(QWidget *parent) : QWizard(parent) SetupWizard::SetupWizard(QWidget *parent) : QWizard(parent)
{ {
@ -30,7 +31,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("MultiMC Quick Setup")); setWindowTitle(tr("%1 Quick Setup").arg(BuildConfig.LAUNCHER_NAME));
} }
BaseWizardPage * SetupWizard::getBasePage(int id) BaseWizardPage * SetupWizard::getBasePage(int id)

View File

@ -63,7 +63,7 @@ void Task::start()
} }
case State::Running: 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; return;
} }
} }

View File

@ -77,7 +77,7 @@ slots:
QTest::addColumn<bool>("ret"); QTest::addColumn<bool>("ret");
QTest::newRow("one") QTest::newRow("one")
<< MULTIMC_GET_TEST_FILE("data/1.json") << GET_TEST_FILE("data/1.json")
<< (VersionFileList() << (VersionFileList()
<< VersionFileEntry{"fileOne", << VersionFileEntry{"fileOne",
493, 493,
@ -93,7 +93,7 @@ slots:
"f12df554b21e320be6471d7154130e70"}) "f12df554b21e320be6471d7154130e70"})
<< QString() << true; << QString() << true;
QTest::newRow("two") QTest::newRow("two")
<< MULTIMC_GET_TEST_FILE("data/2.json") << GET_TEST_FILE("data/2.json")
<< (VersionFileList() << (VersionFileList()
<< VersionFileEntry{"fileOne", << VersionFileEntry{"fileOne",
493, 493,

View File

@ -190,14 +190,6 @@ void UpdateChecker::updateChanList(bool notifyNoUpdate)
return; 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; m_chanListLoading = true;
NetJob *job = new NetJob("Update System Channel List"); NetJob *job = new NetJob("Update System Channel List");
job->addNetAction(Net::Download::makeByteArray(QUrl(m_channelUrl), &chanlistData)); job->addNetAction(Net::Download::makeByteArray(QUrl(m_channelUrl), &chanlistData));

View File

@ -74,7 +74,7 @@
<item> <item>
<widget class="QLabel" name="labelCustomCmdsDescription"> <widget class="QLabel" name="labelCustomCmdsDescription">
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Pre-launch command runs before the instance launches and post-exit command runs after it exits.&lt;/p&gt;&lt;p&gt;Both will be run in MultiMC's working folder with extra environment variables:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;$INST_NAME - Name of the instance&lt;/li&gt;&lt;li&gt;$INST_ID - ID of the instance (its folder name)&lt;/li&gt;&lt;li&gt;$INST_DIR - absolute path of the instance&lt;/li&gt;&lt;li&gt;$INST_MC_DIR - absolute path of minecraft&lt;/li&gt;&lt;li&gt;$INST_JAVA - java binary used for launch&lt;/li&gt;&lt;li&gt;$INST_JAVA_ARGS - command-line parameters used for launch&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Wrapper command allows launching using an extra wrapper program (like 'optirun' on Linux)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Pre-launch command runs before the instance launches and post-exit command runs after it exits.&lt;/p&gt;&lt;p&gt;Both will be run in the launcher's working folder with extra environment variables:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;$INST_NAME - Name of the instance&lt;/li&gt;&lt;li&gt;$INST_ID - ID of the instance (its folder name)&lt;/li&gt;&lt;li&gt;$INST_DIR - absolute path of the instance&lt;/li&gt;&lt;li&gt;$INST_MC_DIR - absolute path of minecraft&lt;/li&gt;&lt;li&gt;$INST_JAVA - java binary used for launch&lt;/li&gt;&lt;li&gt;$INST_JAVA_ARGS - command-line parameters used for launch&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Wrapper command allows launching using an extra wrapper program (like 'optirun' on Linux)&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>

View File

@ -16,6 +16,7 @@
#include <widgets/VersionSelectWidget.h> #include <widgets/VersionSelectWidget.h>
#include <FileSystem.h> #include <FileSystem.h>
#include <QFileDialog> #include <QFileDialog>
#include <BuildConfig.h>
JavaSettingsWidget::JavaSettingsWidget(QWidget* parent) : QWidget(parent) JavaSettingsWidget::JavaSettingsWidget(QWidget* parent) : QWidget(parent)
{ {
@ -146,11 +147,11 @@ JavaSettingsWidget::ValidationStatus JavaSettingsWidget::validate()
this, this,
tr("No Java version selected"), tr("No Java version selected"),
tr("You didn't select a Java version or selected something that doesn't work.\n" 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?" "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),
QMessageBox::Warning, QMessageBox::Warning,
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes | QMessageBox::No,
QMessageBox::NoButton QMessageBox::NoButton

View File

@ -135,7 +135,7 @@ public class EntryPoint
} }
if(isAborted) if(isAborted)
{ {
System.err.println("Launch aborted by MultiMC."); System.err.println("Launch aborted by the launcher.");
return 1; return 1;
} }
if(m_launcher != null) if(m_launcher != null)

View File

@ -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 message A String containing the message
* @param level A String containing the level name. See MinecraftLauncher::getLevel() * @param level A String containing the level name. See MinecraftLauncher::getLevel()
@ -108,7 +108,7 @@ public class Utils
public static void log(String message) public static void log(String message)
{ {
log(message, "MultiMC"); log(message, "Launcher");
} }
public static void log() public static void log()

View File

@ -3,8 +3,15 @@ target_link_libraries(secrets Qt5::Core)
target_compile_definitions(secrets PUBLIC -DEMBED_SECRETS) target_compile_definitions(secrets PUBLIC -DEMBED_SECRETS)
target_include_directories(secrets PUBLIC .) target_include_directories(secrets PUBLIC .)
set(Launcher_Name "Launcher" PARENT_SCOPE) set(Launcher_CommonName "DevLauncher")
set(Launcher_Copyright "MultiMC Contributors" PARENT_SCOPE) 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_ICNS "notsecrets/Launcher.icns" PARENT_SCOPE)
set(Launcher_Branding_WindowsRC "notsecrets/launcher.rc" PARENT_SCOPE) set(Launcher_Branding_WindowsRC "notsecrets/launcher.rc" PARENT_SCOPE)
set(Launcher_Branding_LogoQRC "notsecrets/logo.qrc" PARENT_SCOPE)

8
notsecrets/logo.qrc Normal file
View File

@ -0,0 +1,8 @@
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/">
<file>logo.svg</file>
</qresource>
</RCC>