diff options
Diffstat (limited to 'launcher')
-rw-r--r-- | launcher/Application.cpp | 69 | ||||
-rw-r--r-- | launcher/minecraft/auth/steps/LauncherLoginStep.cpp | 2 | ||||
-rw-r--r-- | launcher/resources/multimc/multimc.qrc | 1 | ||||
-rw-r--r-- | launcher/resources/multimc/scalable/instances/polymc.svg | 21 | ||||
-rw-r--r-- | launcher/ui/pages/global/ExternalToolsPage.ui | 3 | ||||
-rw-r--r-- | launcher/ui/pages/global/JavaPage.cpp | 2 | ||||
-rw-r--r-- | launcher/ui/pages/global/JavaPage.ui | 103 | ||||
-rw-r--r-- | launcher/ui/pages/global/LauncherPage.cpp | 14 | ||||
-rw-r--r-- | launcher/ui/pages/global/LauncherPage.h | 1 | ||||
-rw-r--r-- | launcher/ui/pages/global/LauncherPage.ui | 7 | ||||
-rw-r--r-- | launcher/ui/pages/global/ProxyPage.ui | 6 | ||||
-rw-r--r-- | launcher/ui/widgets/CustomCommands.ui | 9 |
12 files changed, 114 insertions, 124 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp index 8bd434f0..11109857 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -409,69 +409,6 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) return; } -#if defined(Q_OS_MAC) - // move user data to new location if on macOS and it still exists in Contents/MacOS - 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, BuildConfig.LAUNCHER_CONFIGFILE))) - { - if (!QFileInfo::exists(FS::PathCombine(originalData, "dontmovemacdata"))) - { - QMessageBox::StandardButton askMoveDialogue; - 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", // Launcher log files: ${Launcher_Name}-@.log - "accounts.json", - "accounts", - "assets", - "cache", - "icons", - "instances", - "libraries", - "meta", - "metacache", - "mods", - BuildConfig.LAUNCHER_CONFIGFILE, - "themes", - "translations" - }; - QDirIterator files(originalData, dataFiles); - while (files.hasNext()) { - QString filePath(files.next()); - QString fileName(files.fileName()); - if (!dir.rename(filePath, FS::PathCombine(dataPath, fileName))) - { - qWarning() << "Failed to move " << fileName; - } - } - } - else - { - dataPath = originalData; - QDir::setCurrent(dataPath); - QFile file(originalData + "/dontmovemacdata"); - file.open(QIODevice::WriteOnly); - } - } - else - { - dataPath = originalData; - QDir::setCurrent(dataPath); - } - } -#endif - /* * 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. @@ -691,6 +628,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) m_settings->registerSetting("LastHostname", ""); m_settings->registerSetting("JvmArgs", ""); m_settings->registerSetting("IgnoreJavaCompatibility", false); + m_settings->registerSetting("IgnoreJavaWizard", false); // Native library workarounds m_settings->registerSetting("UseNativeOpenAL", false); @@ -936,6 +874,10 @@ bool Application::createSetupWizard() { bool javaRequired = [&]() { + bool ignoreJavaWizard = m_settings->get("IgnoreJavaWizard").toBool(); + if(ignoreJavaWizard) { + return false; + } QString currentHostName = QHostInfo::localHostName(); QString oldHostName = settings()->get("LastHostname").toString(); if (currentHostName != oldHostName) @@ -966,6 +908,7 @@ bool Application::createSetupWizard() { m_setupWizard->addPage(new LanguageWizardPage(m_setupWizard)); } + if (javaRequired) { m_setupWizard->addPage(new JavaWizardPage(m_setupWizard)); diff --git a/launcher/minecraft/auth/steps/LauncherLoginStep.cpp b/launcher/minecraft/auth/steps/LauncherLoginStep.cpp index c978bd07..f5697223 100644 --- a/launcher/minecraft/auth/steps/LauncherLoginStep.cpp +++ b/launcher/minecraft/auth/steps/LauncherLoginStep.cpp @@ -50,7 +50,9 @@ void LauncherLoginStep::onRequestDone( auto requestor = qobject_cast<AuthRequest *>(QObject::sender()); requestor->deleteLater(); +#ifndef NDEBUG qDebug() << data; +#endif if (error != QNetworkReply::NoError) { qWarning() << "Reply error:" << error; #ifndef NDEBUG diff --git a/launcher/resources/multimc/multimc.qrc b/launcher/resources/multimc/multimc.qrc index d31885b9..0fe673ff 100644 --- a/launcher/resources/multimc/multimc.qrc +++ b/launcher/resources/multimc/multimc.qrc @@ -313,5 +313,6 @@ <file>scalable/instances/fox.svg</file> <file>scalable/instances/bee.svg</file> + <file>scalable/instances/polymc.svg</file> </qresource> </RCC> diff --git a/launcher/resources/multimc/scalable/instances/polymc.svg b/launcher/resources/multimc/scalable/instances/polymc.svg new file mode 100644 index 00000000..c192d503 --- /dev/null +++ b/launcher/resources/multimc/scalable/instances/polymc.svg @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg width="64" height="64" version="1.1" viewBox="0 0 16.933 16.933" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <defs> + <linearGradient id="linearGradient84726" x1="4.4979" x2="12.435" y1="3.8011" y2="9.5681" gradientUnits="userSpaceOnUse"> + <stop stop-color="#88b858" offset="0"/> + <stop stop-color="#72b147" offset=".5"/> + <stop stop-color="#5a9a30" offset="1"/> + </linearGradient> + </defs> + <g> + <path d="m3.561 16.016s0-3.5642 4.9056-3.5642c4.9069 0 4.9056 3.5642 4.9056 3.5642z" fill="#765338"/> + <path d="m8.4667 12.452-4.9056 3.5642-3.0319-9.3311z" fill="#b7835a"/> + <path d="m8.4667 12.452 7.9375-5.7669-3.0319 9.3311z" fill="#5b422d"/> + <path d="m8.8308 12.716-0.36417 0.26458-0.36417-0.26458c0-0.26458 0.36417-0.26458 0.36417-0.26458s0.36417 0 0.36417 0.26458z" fill="#72b147"/> + <path d="m8.4667 12.452s-2e-7 -5.7669 7.9375-5.7669l-0.22507 0.69269-0.91853 1.1965-0.91853 0.13819-0.91853 1.1965-0.91853 0.13819-0.91853 1.1965-0.91853 0.13819-0.91853 1.1965-0.91853 0.13819z" fill="#5a9a30"/> + <path d="m8.1025 12.716-0.91853-0.13819-0.91853-1.1965-0.91853-0.13819-0.91853-1.1965-0.91853-0.13819-0.91853-1.1965-0.91853-0.13819-0.91853-1.1965-0.22507-0.69269c7.9375 1e-7 7.9375 5.7669 7.9375 5.7669z" fill="#88b858"/> + <path d="m0.52917 6.6846 7.9375 5.7669 7.9375-5.7669-7.9375-5.7669z" fill="url(#linearGradient84726)"/> + </g> + <path d="m0.75424 7.3773-0.22507-0.69269 7.9375 5.7669 7.9375-5.7669-0.22507 0.69269-7.7124 5.6034z" fill-opacity="0"/> +</svg> diff --git a/launcher/ui/pages/global/ExternalToolsPage.ui b/launcher/ui/pages/global/ExternalToolsPage.ui index 8609d469..3643094d 100644 --- a/launcher/ui/pages/global/ExternalToolsPage.ui +++ b/launcher/ui/pages/global/ExternalToolsPage.ui @@ -158,6 +158,9 @@ <property name="text"> <string>&Text Editor:</string> </property> + <property name="buddy"> + <cstring>jsonEditorTextBox</cstring> + </property> </widget> </item> <item row="0" column="2"> diff --git a/launcher/ui/pages/global/JavaPage.cpp b/launcher/ui/pages/global/JavaPage.cpp index f0616db1..b5e8de6c 100644 --- a/launcher/ui/pages/global/JavaPage.cpp +++ b/launcher/ui/pages/global/JavaPage.cpp @@ -97,6 +97,7 @@ void JavaPage::applySettings() s->set("JavaPath", ui->javaPathTextBox->text()); s->set("JvmArgs", ui->jvmArgsTextBox->text()); s->set("IgnoreJavaCompatibility", ui->skipCompatibilityCheckbox->isChecked()); + s->set("IgnoreJavaWizard", ui->skipJavaWizardCheckbox->isChecked()); JavaCommon::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget()); } void JavaPage::loadSettings() @@ -121,6 +122,7 @@ void JavaPage::loadSettings() ui->javaPathTextBox->setText(s->get("JavaPath").toString()); ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString()); ui->skipCompatibilityCheckbox->setChecked(s->get("IgnoreJavaCompatibility").toBool()); + ui->skipJavaWizardCheckbox->setChecked(s->get("IgnoreJavaWizard").toBool()); } void JavaPage::on_javaDetectBtn_clicked() diff --git a/launcher/ui/pages/global/JavaPage.ui b/launcher/ui/pages/global/JavaPage.ui index bb195770..3e4b12a1 100644 --- a/launcher/ui/pages/global/JavaPage.ui +++ b/launcher/ui/pages/global/JavaPage.ui @@ -72,6 +72,9 @@ <property name="text"> <string>&Minimum memory allocation:</string> </property> + <property name="buddy"> + <cstring>minMemSpinBox</cstring> + </property> </widget> </item> <item row="1" column="0"> @@ -79,6 +82,9 @@ <property name="text"> <string>Ma&ximum memory allocation:</string> </property> + <property name="buddy"> + <cstring>maxMemSpinBox</cstring> + </property> </widget> </item> <item row="0" column="1"> @@ -108,6 +114,9 @@ <property name="text"> <string notr="true">&PermGen:</string> </property> + <property name="buddy"> + <cstring>permGenSpinBox</cstring> + </property> </widget> </item> <item row="2" column="1"> @@ -152,37 +161,11 @@ <property name="text"> <string>&Java path:</string> </property> + <property name="buddy"> + <cstring>javaPathTextBox</cstring> + </property> </widget> </item> - <item row="0" column="1" colspan="2"> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLineEdit" name="javaPathTextBox"/> - </item> - <item> - <widget class="QPushButton" name="javaBrowseBtn"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="maximumSize"> - <size> - <width>28</width> - <height>16777215</height> - </size> - </property> - <property name="text"> - <string notr="true">...</string> - </property> - </widget> - </item> - </layout> - </item> - <item row="2" column="1" colspan="2"> - <widget class="QLineEdit" name="jvmArgsTextBox"/> - </item> <item row="2" column="0"> <widget class="QLabel" name="labelJVMArgs"> <property name="sizePolicy"> @@ -194,23 +177,29 @@ <property name="text"> <string>J&VM arguments:</string> </property> + <property name="buddy"> + <cstring>jvmArgsTextBox</cstring> + </property> </widget> </item> - <item row="3" column="1"> - <widget class="QPushButton" name="javaDetectBtn"> + <item row="4" column="1"> + <widget class="QCheckBox" name="skipCompatibilityCheckbox"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="toolTip"> + <string>If enabled, the launcher will not check if an instance is compatible with the selected Java version.</string> + </property> <property name="text"> - <string>&Auto-detect...</string> + <string>&Skip Java compatibility checks</string> </property> </widget> </item> - <item row="3" column="2"> - <widget class="QPushButton" name="javaTestBtn"> + <item row="3" column="1"> + <widget class="QPushButton" name="javaDetectBtn"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> @@ -218,23 +207,59 @@ </sizepolicy> </property> <property name="text"> - <string>&Test</string> + <string>&Auto-detect...</string> </property> </widget> </item> - <item row="4" column="1"> - <widget class="QCheckBox" name="skipCompatibilityCheckbox"> + <item row="0" column="1" colspan="2"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLineEdit" name="javaPathTextBox"/> + </item> + <item> + <widget class="QPushButton" name="javaBrowseBtn"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>28</width> + <height>16777215</height> + </size> + </property> + <property name="text"> + <string notr="true">...</string> + </property> + </widget> + </item> + </layout> + </item> + <item row="3" column="2"> + <widget class="QPushButton" name="javaTestBtn"> <property name="sizePolicy"> <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> + <property name="text"> + <string>&Test</string> + </property> + </widget> + </item> + <item row="2" column="1" colspan="2"> + <widget class="QLineEdit" name="jvmArgsTextBox"/> + </item> + <item row="5" column="1"> + <widget class="QCheckBox" name="skipJavaWizardCheckbox"> <property name="toolTip"> - <string>If enabled, the launcher will not check if an instance is compatible with the selected Java version.</string> + <string>If enabled, the launcher will not prompt you to choose a Java version if one isn't found.</string> </property> <property name="text"> - <string>&Skip Java compatibility checks</string> + <string>Skip Java &Wizard</string> </property> </widget> </item> diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index 097a2bfa..af2e2cd1 100644 --- a/launcher/ui/pages/global/LauncherPage.cpp +++ b/launcher/ui/pages/global/LauncherPage.cpp @@ -97,13 +97,6 @@ LauncherPage::LauncherPage(QWidget *parent) : QWidget(parent), ui(new Ui::Launch } connect(ui->fontSizeBox, SIGNAL(valueChanged(int)), SLOT(refreshFontPreview())); connect(ui->consoleFont, SIGNAL(currentFontChanged(QFont)), SLOT(refreshFontPreview())); - - //move mac data button - QFile file(QDir::current().absolutePath() + "/dontmovemacdata"); - if (!file.exists()) - { - ui->migrateDataFolderMacBtn->setVisible(false); - } } LauncherPage::~LauncherPage() @@ -190,13 +183,6 @@ void LauncherPage::on_modsDirBrowseBtn_clicked() ui->modsDirTextBox->setText(cooked_dir); } } -void LauncherPage::on_migrateDataFolderMacBtn_clicked() -{ - QFile file(QDir::current().absolutePath() + "/dontmovemacdata"); - file.remove(); - QProcess::startDetached(qApp->arguments()[0]); - qApp->quit(); -} void LauncherPage::refreshUpdateChannelList() { diff --git a/launcher/ui/pages/global/LauncherPage.h b/launcher/ui/pages/global/LauncherPage.h index 63cfe9c3..bbf5d2fe 100644 --- a/launcher/ui/pages/global/LauncherPage.h +++ b/launcher/ui/pages/global/LauncherPage.h @@ -88,7 +88,6 @@ slots: void on_instDirBrowseBtn_clicked(); void on_modsDirBrowseBtn_clicked(); void on_iconsDirBrowseBtn_clicked(); - void on_migrateDataFolderMacBtn_clicked(); /*! * Updates the list of update channels in the combo box. diff --git a/launcher/ui/pages/global/LauncherPage.ui b/launcher/ui/pages/global/LauncherPage.ui index 086de17b..ae7eb73f 100644 --- a/launcher/ui/pages/global/LauncherPage.ui +++ b/launcher/ui/pages/global/LauncherPage.ui @@ -158,13 +158,6 @@ </widget> </item> <item> - <widget class="QPushButton" name="migrateDataFolderMacBtn"> - <property name="text"> - <string>Move the data to new location (will restart the launcher)</string> - </property> - </widget> - </item> - <item> <spacer name="verticalSpacer_2"> <property name="orientation"> <enum>Qt::Vertical</enum> diff --git a/launcher/ui/pages/global/ProxyPage.ui b/launcher/ui/pages/global/ProxyPage.ui index 5a2fc73d..91ba46b3 100644 --- a/launcher/ui/pages/global/ProxyPage.ui +++ b/launcher/ui/pages/global/ProxyPage.ui @@ -147,6 +147,9 @@ <property name="text"> <string>&Username:</string> </property> + <property name="buddy"> + <cstring>proxyUserEdit</cstring> + </property> </widget> </item> <item row="1" column="0"> @@ -154,6 +157,9 @@ <property name="text"> <string>&Password:</string> </property> + <property name="buddy"> + <cstring>proxyPassEdit</cstring> + </property> </widget> </item> <item row="1" column="1"> diff --git a/launcher/ui/widgets/CustomCommands.ui b/launcher/ui/widgets/CustomCommands.ui index 68e680a5..4a39ff7f 100644 --- a/launcher/ui/widgets/CustomCommands.ui +++ b/launcher/ui/widgets/CustomCommands.ui @@ -43,6 +43,9 @@ <property name="text"> <string>P&ost-exit command:</string> </property> + <property name="buddy"> + <cstring>postExitCmdTextBox</cstring> + </property> </widget> </item> <item row="0" column="1"> @@ -53,6 +56,9 @@ <property name="text"> <string>&Pre-launch command:</string> </property> + <property name="buddy"> + <cstring>preLaunchCmdTextBox</cstring> + </property> </widget> </item> <item row="2" column="1"> @@ -63,6 +69,9 @@ <property name="text"> <string>&Wrapper command:</string> </property> + <property name="buddy"> + <cstring>wrapperCmdTextBox</cstring> + </property> </widget> </item> <item row="1" column="1"> |