Properly lock IP address editing tables and buttons when needed

main
Aaron Rainbolt 1 year ago
parent d69935679c
commit 9f2438711a

@ -119,8 +119,12 @@ void Ipv4SettingsTab::onMethodComboBoxCurrentIndexChanged(int index)
{
if (index == 3) { // manual
ui->manualIpv4ConfigurationTable->setEnabled(true);
ui->manualIpv4ConfigurationAddButton->setEnabled(true);
ui->manualIpv4ConfigurationRemoveButton->setEnabled(true);
} else {
ui->manualIpv4ConfigurationTable->setEnabled(false);
ui->manualIpv4ConfigurationAddButton->setEnabled(false);
ui->manualIpv4ConfigurationRemoveButton->setEnabled(false);
}
}

@ -85,6 +85,7 @@ QVariantMap Ipv6SettingsTab::readSettings()
void Ipv6SettingsTab::loadSettings(QVariantMap settings)
{
origSettings = settings; // We may need to restore these if something about the settings the user puts in is invalid.
if (settings["ipv6Method"].isValid()) {
switch (settings["ipv6Method"].toInt()) {
case ConnectionSettingsEngine::Ipv6Automatic:
@ -111,6 +112,8 @@ void Ipv6SettingsTab::loadSettings(QVariantMap settings)
}
}
onMethodComboBoxCurrentIndexChanged(ui->methodComboBox->currentIndex());
if (settings["ipv6DnsServers"].isValid()) {
ui->dnsServersLineEdit->setText(settings["ipv6DnsServers"].toString());
}
@ -156,8 +159,12 @@ void Ipv6SettingsTab::onMethodComboBoxCurrentIndexChanged(int index)
{
if (index == 4) { // manual
ui->manualIpv6ConfigurationTable->setEnabled(true);
ui->manualIpv6ConfigurationAddButton->setEnabled(true);
ui->manualIpv6ConfigurationRemoveButton->setEnabled(true);
} else {
ui->manualIpv6ConfigurationTable->setEnabled(false);
ui->manualIpv6ConfigurationAddButton->setEnabled(false);
ui->manualIpv6ConfigurationRemoveButton->setEnabled(false);
}
}

Loading…
Cancel
Save