Reset path when unchecked (still keeps it in UI in case you recheck)

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2025-03-26 23:41:47 +00:00
parent 9c942c6894
commit ccef855f06
No known key found for this signature in database
GPG Key ID: 5E39D70B4C93C38E

View File

@ -101,8 +101,11 @@ MinecraftSettingsWidget::MinecraftSettingsWidget(MinecraftInstancePtr instance,
connect(m_ui->serverJoinAddressButton, &QAbstractButton::toggled, m_ui->serverJoinAddress, &QWidget::setEnabled);
connect(m_ui->worldJoinButton, &QAbstractButton::toggled, m_ui->worldsCb, &QWidget::setEnabled);
connect(m_ui->globalDataPacksGroupBox, &QGroupBox::toggled, this,
[this](bool value) { m_instance->settings()->set("GlobalDataPacksEnabled", value); });
connect(m_ui->globalDataPacksGroupBox, &QGroupBox::toggled, this, [this](bool value) {
m_instance->settings()->set("GlobalDataPacksEnabled", value);
if (!value)
m_instance->settings()->reset("GlobalDataPacksPath");
});
connect(m_ui->dataPacksPathEdit, &QLineEdit::editingFinished, this,
[this] { m_instance->settings()->set("GlobalDataPacksPath", m_ui->dataPacksPathEdit->text()); });
connect(m_ui->dataPacksPathBrowse, &QPushButton::clicked, this, &MinecraftSettingsWidget::selectDataPacksFolder);