add hide java wizard toggle
This commit is contained in:
		@@ -691,6 +691,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv)
 | 
				
			|||||||
        m_settings->registerSetting("LastHostname", "");
 | 
					        m_settings->registerSetting("LastHostname", "");
 | 
				
			||||||
        m_settings->registerSetting("JvmArgs", "");
 | 
					        m_settings->registerSetting("JvmArgs", "");
 | 
				
			||||||
        m_settings->registerSetting("IgnoreJavaCompatibility", false);
 | 
					        m_settings->registerSetting("IgnoreJavaCompatibility", false);
 | 
				
			||||||
 | 
					        m_settings->registerSetting("IgnoreJavaWizard", false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Native library workarounds
 | 
					        // Native library workarounds
 | 
				
			||||||
        m_settings->registerSetting("UseNativeOpenAL", false);
 | 
					        m_settings->registerSetting("UseNativeOpenAL", false);
 | 
				
			||||||
@@ -936,6 +937,10 @@ bool Application::createSetupWizard()
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    bool javaRequired = [&]()
 | 
					    bool javaRequired = [&]()
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        bool ignoreJavaWizard = m_settings->get("IgnoreJavaWizard").toBool();
 | 
				
			||||||
 | 
					        if(ignoreJavaWizard) {
 | 
				
			||||||
 | 
					            return false;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        QString currentHostName = QHostInfo::localHostName();
 | 
					        QString currentHostName = QHostInfo::localHostName();
 | 
				
			||||||
        QString oldHostName = settings()->get("LastHostname").toString();
 | 
					        QString oldHostName = settings()->get("LastHostname").toString();
 | 
				
			||||||
        if (currentHostName != oldHostName)
 | 
					        if (currentHostName != oldHostName)
 | 
				
			||||||
@@ -966,6 +971,7 @@ bool Application::createSetupWizard()
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            m_setupWizard->addPage(new LanguageWizardPage(m_setupWizard));
 | 
					            m_setupWizard->addPage(new LanguageWizardPage(m_setupWizard));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (javaRequired)
 | 
					        if (javaRequired)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            m_setupWizard->addPage(new JavaWizardPage(m_setupWizard));
 | 
					            m_setupWizard->addPage(new JavaWizardPage(m_setupWizard));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,6 +97,7 @@ void JavaPage::applySettings()
 | 
				
			|||||||
    s->set("JavaPath", ui->javaPathTextBox->text());
 | 
					    s->set("JavaPath", ui->javaPathTextBox->text());
 | 
				
			||||||
    s->set("JvmArgs", ui->jvmArgsTextBox->text());
 | 
					    s->set("JvmArgs", ui->jvmArgsTextBox->text());
 | 
				
			||||||
    s->set("IgnoreJavaCompatibility", ui->skipCompatibilityCheckbox->isChecked());
 | 
					    s->set("IgnoreJavaCompatibility", ui->skipCompatibilityCheckbox->isChecked());
 | 
				
			||||||
 | 
					    s->set("IgnoreJavaWizard", ui->skipJavaWizardCheckbox->isChecked());
 | 
				
			||||||
    JavaCommon::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget());
 | 
					    JavaCommon::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
void JavaPage::loadSettings()
 | 
					void JavaPage::loadSettings()
 | 
				
			||||||
@@ -121,6 +122,7 @@ void JavaPage::loadSettings()
 | 
				
			|||||||
    ui->javaPathTextBox->setText(s->get("JavaPath").toString());
 | 
					    ui->javaPathTextBox->setText(s->get("JavaPath").toString());
 | 
				
			||||||
    ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString());
 | 
					    ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString());
 | 
				
			||||||
    ui->skipCompatibilityCheckbox->setChecked(s->get("IgnoreJavaCompatibility").toBool());
 | 
					    ui->skipCompatibilityCheckbox->setChecked(s->get("IgnoreJavaCompatibility").toBool());
 | 
				
			||||||
 | 
					    ui->skipJavaWizardCheckbox->setChecked(s->get("IgnoreJavaWizard").toBool());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void JavaPage::on_javaDetectBtn_clicked()
 | 
					void JavaPage::on_javaDetectBtn_clicked()
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -154,6 +154,48 @@
 | 
				
			|||||||
            </property>
 | 
					            </property>
 | 
				
			||||||
           </widget>
 | 
					           </widget>
 | 
				
			||||||
          </item>
 | 
					          </item>
 | 
				
			||||||
 | 
					          <item row="2" column="0">
 | 
				
			||||||
 | 
					           <widget class="QLabel" name="labelJVMArgs">
 | 
				
			||||||
 | 
					            <property name="sizePolicy">
 | 
				
			||||||
 | 
					             <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
 | 
				
			||||||
 | 
					              <horstretch>0</horstretch>
 | 
				
			||||||
 | 
					              <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					             </sizepolicy>
 | 
				
			||||||
 | 
					            </property>
 | 
				
			||||||
 | 
					            <property name="text">
 | 
				
			||||||
 | 
					             <string>J&VM arguments:</string>
 | 
				
			||||||
 | 
					            </property>
 | 
				
			||||||
 | 
					           </widget>
 | 
				
			||||||
 | 
					          </item>
 | 
				
			||||||
 | 
					          <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>&Skip Java compatibility checks</string>
 | 
				
			||||||
 | 
					            </property>
 | 
				
			||||||
 | 
					           </widget>
 | 
				
			||||||
 | 
					          </item>
 | 
				
			||||||
 | 
					          <item row="3" column="1">
 | 
				
			||||||
 | 
					           <widget class="QPushButton" name="javaDetectBtn">
 | 
				
			||||||
 | 
					            <property name="sizePolicy">
 | 
				
			||||||
 | 
					             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
 | 
				
			||||||
 | 
					              <horstretch>0</horstretch>
 | 
				
			||||||
 | 
					              <verstretch>0</verstretch>
 | 
				
			||||||
 | 
					             </sizepolicy>
 | 
				
			||||||
 | 
					            </property>
 | 
				
			||||||
 | 
					            <property name="text">
 | 
				
			||||||
 | 
					             <string>&Auto-detect...</string>
 | 
				
			||||||
 | 
					            </property>
 | 
				
			||||||
 | 
					           </widget>
 | 
				
			||||||
 | 
					          </item>
 | 
				
			||||||
          <item row="0" column="1" colspan="2">
 | 
					          <item row="0" column="1" colspan="2">
 | 
				
			||||||
           <layout class="QHBoxLayout" name="horizontalLayout">
 | 
					           <layout class="QHBoxLayout" name="horizontalLayout">
 | 
				
			||||||
            <item>
 | 
					            <item>
 | 
				
			||||||
@@ -180,35 +222,6 @@
 | 
				
			|||||||
            </item>
 | 
					            </item>
 | 
				
			||||||
           </layout>
 | 
					           </layout>
 | 
				
			||||||
          </item>
 | 
					          </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">
 | 
					 | 
				
			||||||
             <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
 | 
					 | 
				
			||||||
              <horstretch>0</horstretch>
 | 
					 | 
				
			||||||
              <verstretch>0</verstretch>
 | 
					 | 
				
			||||||
             </sizepolicy>
 | 
					 | 
				
			||||||
            </property>
 | 
					 | 
				
			||||||
            <property name="text">
 | 
					 | 
				
			||||||
             <string>J&VM arguments:</string>
 | 
					 | 
				
			||||||
            </property>
 | 
					 | 
				
			||||||
           </widget>
 | 
					 | 
				
			||||||
          </item>
 | 
					 | 
				
			||||||
          <item row="3" column="1">
 | 
					 | 
				
			||||||
           <widget class="QPushButton" name="javaDetectBtn">
 | 
					 | 
				
			||||||
            <property name="sizePolicy">
 | 
					 | 
				
			||||||
             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
 | 
					 | 
				
			||||||
              <horstretch>0</horstretch>
 | 
					 | 
				
			||||||
              <verstretch>0</verstretch>
 | 
					 | 
				
			||||||
             </sizepolicy>
 | 
					 | 
				
			||||||
            </property>
 | 
					 | 
				
			||||||
            <property name="text">
 | 
					 | 
				
			||||||
             <string>&Auto-detect...</string>
 | 
					 | 
				
			||||||
            </property>
 | 
					 | 
				
			||||||
           </widget>
 | 
					 | 
				
			||||||
          </item>
 | 
					 | 
				
			||||||
          <item row="3" column="2">
 | 
					          <item row="3" column="2">
 | 
				
			||||||
           <widget class="QPushButton" name="javaTestBtn">
 | 
					           <widget class="QPushButton" name="javaTestBtn">
 | 
				
			||||||
            <property name="sizePolicy">
 | 
					            <property name="sizePolicy">
 | 
				
			||||||
@@ -222,19 +235,16 @@
 | 
				
			|||||||
            </property>
 | 
					            </property>
 | 
				
			||||||
           </widget>
 | 
					           </widget>
 | 
				
			||||||
          </item>
 | 
					          </item>
 | 
				
			||||||
          <item row="4" column="1">
 | 
					          <item row="2" column="1" colspan="2">
 | 
				
			||||||
           <widget class="QCheckBox" name="skipCompatibilityCheckbox">
 | 
					           <widget class="QLineEdit" name="jvmArgsTextBox"/>
 | 
				
			||||||
            <property name="sizePolicy">
 | 
					          </item>
 | 
				
			||||||
             <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
 | 
					          <item row="5" column="1">
 | 
				
			||||||
              <horstretch>0</horstretch>
 | 
					           <widget class="QCheckBox" name="skipJavaWizardCheckbox">
 | 
				
			||||||
              <verstretch>0</verstretch>
 | 
					 | 
				
			||||||
             </sizepolicy>
 | 
					 | 
				
			||||||
            </property>
 | 
					 | 
				
			||||||
            <property name="toolTip">
 | 
					            <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>
 | 
				
			||||||
            <property name="text">
 | 
					            <property name="text">
 | 
				
			||||||
             <string>&Skip Java compatibility checks</string>
 | 
					             <string>Skip Java Wizard</string>
 | 
				
			||||||
            </property>
 | 
					            </property>
 | 
				
			||||||
           </widget>
 | 
					           </widget>
 | 
				
			||||||
          </item>
 | 
					          </item>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user