diff options
author | janrupf <werbung.janrupf@t-online.de> | 2018-11-09 21:45:55 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2018-11-12 01:50:04 +0100 |
commit | 1648b34aedb5988c2ffb9076d031b7ff84c83ce9 (patch) | |
tree | 9c825bc8eb3ea31b79a73340b263212cadb45d2e /application/pages/instance/InstanceSettingsPage.cpp | |
parent | 4cc7329ce33e1d6441c9b43b217b003c0a78e985 (diff) | |
download | MultiMC-1648b34aedb5988c2ffb9076d031b7ff84c83ce9.tar MultiMC-1648b34aedb5988c2ffb9076d031b7ff84c83ce9.tar.gz MultiMC-1648b34aedb5988c2ffb9076d031b7ff84c83ce9.tar.lz MultiMC-1648b34aedb5988c2ffb9076d031b7ff84c83ce9.tar.xz MultiMC-1648b34aedb5988c2ffb9076d031b7ff84c83ce9.zip |
GH-1552 Hide PermGen when using an autodetected java version greater than 8
Diffstat (limited to 'application/pages/instance/InstanceSettingsPage.cpp')
-rw-r--r-- | application/pages/instance/InstanceSettingsPage.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/application/pages/instance/InstanceSettingsPage.cpp b/application/pages/instance/InstanceSettingsPage.cpp index 0704ffc5..61911f67 100644 --- a/application/pages/instance/InstanceSettingsPage.cpp +++ b/application/pages/instance/InstanceSettingsPage.cpp @@ -176,6 +176,11 @@ void InstanceSettingsPage::loadSettings() ui->maxMemSpinBox->setValue(min); } ui->permGenSpinBox->setValue(m_settings->get("PermGen").toInt()); + bool permGenVisible = m_settings->get("PermGenVisible").toBool(); + ui->permGenSpinBox->setVisible(permGenVisible); + ui->labelPermGen->setVisible(permGenVisible); + ui->labelPermgenNote->setVisible(permGenVisible); + // Java Settings bool overrideJava = m_settings->get("OverrideJava").toBool(); @@ -210,6 +215,11 @@ void InstanceSettingsPage::on_javaDetectBtn_clicked() { java = std::dynamic_pointer_cast<JavaInstall>(vselect.selectedVersion()); ui->javaPathTextBox->setText(java->path); + bool visible = java->id.requiresPermGen() && m_settings->get("OverrideMemory").toBool(); + ui->permGenSpinBox->setVisible(visible); + ui->labelPermGen->setVisible(visible); + ui->labelPermgenNote->setVisible(visible); + m_settings->set("PermGenVisible", visible); } } @@ -224,12 +234,18 @@ void InstanceSettingsPage::on_javaBrowseBtn_clicked() } QString cooked_path = FS::NormalizePath(raw_path); - QFileInfo javaInfo(cooked_path);; + QFileInfo javaInfo(cooked_path); if(!javaInfo.exists() || !javaInfo.isExecutable()) { return; } ui->javaPathTextBox->setText(cooked_path); + + // custom Java could be anything... enable perm gen option + ui->permGenSpinBox->setVisible(true); + ui->labelPermGen->setVisible(true); + ui->labelPermgenNote->setVisible(true); + m_settings->set("PermGenVisible", true); } void InstanceSettingsPage::on_javaTestBtn_clicked() |