diff options
Diffstat (limited to 'launcher/Application.cpp')
-rw-r--r-- | launcher/Application.cpp | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 9bd4ebae..a3d6216e 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -14,7 +14,7 @@ #include "ui/pages/global/ProxyPage.h" #include "ui/pages/global/ExternalToolsPage.h" #include "ui/pages/global/AccountListPage.h" -#include "ui/pages/global/PasteEEPage.h" +#include "ui/pages/global/APIPage.h" #include "ui/pages/global/CustomCommandsPage.h" #include "ui/themes/ITheme.h" @@ -187,7 +187,9 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) setApplicationName(BuildConfig.LAUNCHER_NAME); setApplicationDisplayName(BuildConfig.LAUNCHER_DISPLAYNAME); setApplicationVersion(BuildConfig.printableVersionString()); - + #if (QT_VERSION >= QT_VERSION_CHECK(5,7,0)) + setDesktopFileName(BuildConfig.LAUNCHER_DESKTOPFILENAME); + #endif startTime = QDateTime::currentDateTime(); #ifdef Q_OS_LINUX @@ -311,7 +313,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) dataPath = xdgDataHome + "/polymc"; adjustedBy += "XDG standard " + dataPath; #elif defined(Q_OS_MAC) - QDir foo(FS::PathCombine(applicationDirPath(), "../../Data")); + QDir foo(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "..")); dataPath = foo.absolutePath(); adjustedBy += "Fallback to special Mac location " + dataPath; #else @@ -435,7 +437,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) #endif /* - * Establish the mechanism for communication with an already running MultiMC that uses the same data path. + * Establish the mechanism for communication with an already running PolyMC that uses the same data path. * If there is one, tell it what the user actually wanted to do and exit. * We want to initialize this before logging to avoid messing with the log of a potential already running copy. */ @@ -529,10 +531,8 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) #elif defined(Q_OS_WIN32) m_rootPath = binPath; #elif defined(Q_OS_MAC) - QDir foo(FS::PathCombine(binPath, "../..")); + QDir foo(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), "..")); m_rootPath = foo.absolutePath(); - // on macOS, touch the root to force Finder to reload the .app metadata (and fix any icon change issues) - FS::updateTimestamp(m_rootPath); #endif #ifdef MULTIMC_JARS_LOCATION @@ -595,7 +595,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_settings->registerSetting("AutoUpdate", true); // Theming - m_settings->registerSetting("IconTheme", QString("multimc")); + m_settings->registerSetting("IconTheme", QString("pe_colored")); m_settings->registerSetting("ApplicationTheme", QString("system")); // Notifications @@ -662,7 +662,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) // Memory m_settings->registerSetting({"MinMemAlloc", "MinMemoryAlloc"}, 512); - m_settings->registerSetting({"MaxMemAlloc", "MaxMemoryAlloc"}, 1024); + m_settings->registerSetting({"MaxMemAlloc", "MaxMemoryAlloc"}, 4096); m_settings->registerSetting("PermGen", 128); // Java Settings @@ -714,8 +714,13 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_settings->registerSetting("UpdateDialogGeometry", ""); - // paste.ee API key - m_settings->registerSetting("PasteEEAPIKey", "multimc"); + // pastebin URL + m_settings->registerSetting("PastebinURL", "https://0x0.st"); + + m_settings->registerSetting("CloseAfterLaunch", false); + + // Custom MSA credentials + m_settings->registerSetting("MSAClientIDOverride", ""); // Init page provider { @@ -728,7 +733,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_globalSettingsProvider->addPage<ProxyPage>(); m_globalSettingsProvider->addPage<ExternalToolsPage>(); m_globalSettingsProvider->addPage<AccountListPage>(); - m_globalSettingsProvider->addPage<PasteEEPage>(); + m_globalSettingsProvider->addPage<APIPage>(); } qDebug() << "<> Settings loaded."; } @@ -1514,3 +1519,13 @@ QString Application::getJarsPath() } return m_jarsPath; } + +QString Application::getMSAClientID() +{ + QString clientIDOverride = m_settings->get("MSAClientIDOverride").toString(); + if (!clientIDOverride.isEmpty()) { + return clientIDOverride; + } + + return BuildConfig.MSA_CLIENT_ID; +} |