refactor: SettingsDialog remove duplicate code by calling updateTlsControlsEnabled inside updateTlsControls
This commit is contained in:
parent
6f8b3f481d
commit
9268fef89d
1 changed files with 3 additions and 8 deletions
|
|
@ -191,19 +191,14 @@ void SettingsDialog::updateTlsControls()
|
||||||
ui->comboTlsKeyLength->setCurrentText(Settings::value(Settings::Security::KeySize).toString());
|
ui->comboTlsKeyLength->setCurrentText(Settings::value(Settings::Security::KeySize).toString());
|
||||||
|
|
||||||
const auto tlsEnabled = Settings::value(Settings::Security::TlsEnabled).toBool();
|
const auto tlsEnabled = Settings::value(Settings::Security::TlsEnabled).toBool();
|
||||||
const auto writable = Settings::isWritable();
|
|
||||||
const auto enabled = writable && tlsEnabled;
|
|
||||||
|
|
||||||
ui->lineTlsCertPath->setText(certificate);
|
ui->lineTlsCertPath->setText(certificate);
|
||||||
ui->cbRequireClientCert->setChecked(Settings::value(Settings::Security::CheckPeers).toBool());
|
ui->cbRequireClientCert->setChecked(Settings::value(Settings::Security::CheckPeers).toBool());
|
||||||
ui->groupSecurity->setChecked(tlsEnabled);
|
ui->groupSecurity->setChecked(tlsEnabled);
|
||||||
|
|
||||||
ui->groupSecurity->setEnabled(writable);
|
ui->groupSecurity->setEnabled(Settings::isWritable());
|
||||||
ui->comboTlsKeyLength->setEnabled(enabled);
|
|
||||||
ui->widgetTlsCert->setEnabled(enabled);
|
updateTlsControlsEnabled();
|
||||||
ui->lblTlsKeyLength->setEnabled(enabled);
|
|
||||||
ui->btnTlsRegenCert->setEnabled(enabled);
|
|
||||||
ui->cbRequireClientCert->setEnabled(enabled);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SettingsDialog::updateTlsControlsEnabled()
|
void SettingsDialog::updateTlsControlsEnabled()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue