Made auto java checkbox dependent
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
a7dad96a70
commit
4c76f7afe0
@ -41,6 +41,7 @@
|
|||||||
#include "ui/java/JavaDownloader.h"
|
#include "ui/java/JavaDownloader.h"
|
||||||
#include "ui_JavaPage.h"
|
#include "ui_JavaPage.h"
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
@ -65,6 +66,11 @@ JavaPage::JavaPage(QWidget* parent) : QWidget(parent), ui(new Ui::JavaPage)
|
|||||||
ui->managedJavaList->selectCurrent();
|
ui->managedJavaList->selectCurrent();
|
||||||
ui->managedJavaList->setEmptyString(tr("No java versions are currently available in the meta"));
|
ui->managedJavaList->setEmptyString(tr("No java versions are currently available in the meta"));
|
||||||
ui->managedJavaList->setEmptyErrorString(tr("Couldn't load or download the java version lists!"));
|
ui->managedJavaList->setEmptyErrorString(tr("Couldn't load or download the java version lists!"));
|
||||||
|
connect(ui->autodetectJavaCheckBox, &QCheckBox::stateChanged, this, [this] {
|
||||||
|
ui->autodownloadCheckBox->setEnabled(ui->autodetectJavaCheckBox->isChecked());
|
||||||
|
if (!ui->autodetectJavaCheckBox->isChecked())
|
||||||
|
ui->autodownloadCheckBox->setChecked(false);
|
||||||
|
});
|
||||||
|
|
||||||
loadSettings();
|
loadSettings();
|
||||||
updateThresholds();
|
updateThresholds();
|
||||||
@ -128,7 +134,7 @@ void JavaPage::loadSettings()
|
|||||||
ui->skipCompatibilityCheckbox->setChecked(s->get("IgnoreJavaCompatibility").toBool());
|
ui->skipCompatibilityCheckbox->setChecked(s->get("IgnoreJavaCompatibility").toBool());
|
||||||
ui->skipJavaWizardCheckbox->setChecked(s->get("IgnoreJavaWizard").toBool());
|
ui->skipJavaWizardCheckbox->setChecked(s->get("IgnoreJavaWizard").toBool());
|
||||||
ui->autodetectJavaCheckBox->setChecked(s->get("AutomaticJavaSwitch").toBool());
|
ui->autodetectJavaCheckBox->setChecked(s->get("AutomaticJavaSwitch").toBool());
|
||||||
ui->autodownloadCheckBox->setChecked(s->get("AutomaticJavaDownload").toBool());
|
ui->autodownloadCheckBox->setChecked(s->get("AutomaticJavaSwitch").toBool() && s->get("AutomaticJavaDownload").toBool());
|
||||||
m_extra_paths = new QStringListModel(s->get("JavaExtraSearchPaths").toStringList());
|
m_extra_paths = new QStringListModel(s->get("JavaExtraSearchPaths").toStringList());
|
||||||
ui->extraJavaPathsList->setModel(m_extra_paths);
|
ui->extraJavaPathsList->setModel(m_extra_paths);
|
||||||
}
|
}
|
||||||
|
@ -303,6 +303,9 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="7" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QCheckBox" name="autodownloadCheckBox">
|
<widget class="QCheckBox" name="autodownloadCheckBox">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Autodownload Mojang Java</string>
|
<string>Autodownload Mojang Java</string>
|
||||||
</property>
|
</property>
|
||||||
|
Loading…
Reference in New Issue
Block a user