aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordada513 <dada513@protonmail.com>2022-04-30 15:19:57 +0200
committerdada513 <dada513@protonmail.com>2022-04-30 15:19:57 +0200
commitdac801c8ac388495bfc8a4376d01457553ef6bad (patch)
tree7a638bda32a1b1d58a1106913f09b5ce45c602cc
parent3205d9e9da569fb7297916bfaac52faabd279fa1 (diff)
downloadPrismLauncher-dac801c8ac388495bfc8a4376d01457553ef6bad.tar.gz
PrismLauncher-dac801c8ac388495bfc8a4376d01457553ef6bad.tar.bz2
PrismLauncher-dac801c8ac388495bfc8a4376d01457553ef6bad.zip
add hide java wizard toggle
-rw-r--r--launcher/Application.cpp6
-rw-r--r--launcher/ui/pages/global/JavaPage.cpp2
-rw-r--r--launcher/ui/pages/global/JavaPage.ui88
l---------share1
4 files changed, 58 insertions, 39 deletions
diff --git a/launcher/Application.cpp b/launcher/Application.cpp
index 8bd434f0..c8f6b780 100644
--- a/launcher/Application.cpp
+++ b/launcher/Application.cpp
@@ -691,6 +691,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 +937,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 +971,7 @@ bool Application::createSetupWizard()
{
m_setupWizard->addPage(new LanguageWizardPage(m_setupWizard));
}
+
if (javaRequired)
{
m_setupWizard->addPage(new JavaWizardPage(m_setupWizard));
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..7268601f 100644
--- a/launcher/ui/pages/global/JavaPage.ui
+++ b/launcher/ui/pages/global/JavaPage.ui
@@ -154,35 +154,6 @@
</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">
@@ -196,21 +167,24 @@
</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>&amp;Auto-detect...</string>
+ <string>&amp;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 +192,59 @@
</sizepolicy>
</property>
<property name="text">
- <string>&amp;Test</string>
+ <string>&amp;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>&amp;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>&amp;Skip Java compatibility checks</string>
+ <string>Skip Java Wizard</string>
</property>
</widget>
</item>
diff --git a/share b/share
new file mode 120000
index 00000000..bf797c5f
--- /dev/null
+++ b/share
@@ -0,0 +1 @@
+cmake-build-debug \ No newline at end of file