@ -7,6 +7,7 @@ Ipv4SettingsTab::Ipv4SettingsTab(QWidget *parent) :
{
ui - > setupUi ( this ) ;
ui - > methodComboBox - > addItems ( QStringList ( ) < < tr ( " Automatic " ) < < tr ( " Automatic (address-only) " ) < < tr ( " Link-Local " ) < < tr ( " Manual " ) < < tr ( " Shared to other computers " ) < < tr ( " Disabled " ) ) ;
connect ( ui - > methodComboBox , QOverload < int > : : of ( & QComboBox : : currentIndexChanged ) , this , & Ipv4SettingsTab : : onMethodComboBoxCurrentIndexChanged ) ;
connect ( ui - > editDnsServersButton , & QPushButton : : clicked , this , & Ipv4SettingsTab : : onEditDnsServersButtonClicked ) ;
connect ( ui - > editSearchDomainsButton , & QPushButton : : clicked , this , & Ipv4SettingsTab : : onEditSearchDomainsButtonClicked ) ;
connect ( ui - > manualIpv4ConfigurationAddButton , & QPushButton : : clicked , this , & Ipv4SettingsTab : : onManualIpv4ConfigurationAddButtonClicked ) ;
@ -84,6 +85,8 @@ void Ipv4SettingsTab::loadSettings(QVariantMap settings)
}
}
onMethodComboBoxCurrentIndexChanged ( ui - > methodComboBox - > currentIndex ( ) ) ;
if ( settings [ " ipv4DnsServers " ] . isValid ( ) ) {
ui - > dnsServersLineEdit - > setText ( settings [ " ipv4DnsServers " ] . toString ( ) ) ;
}
@ -112,6 +115,15 @@ void Ipv4SettingsTab::loadSettings(QVariantMap settings)
}
}
void Ipv4SettingsTab : : onMethodComboBoxCurrentIndexChanged ( int index )
{
if ( index = = 3 ) { // manual
ui - > manualIpv4ConfigurationTable - > setEnabled ( true ) ;
} else {
ui - > manualIpv4ConfigurationTable - > setEnabled ( false ) ;
}
}
void Ipv4SettingsTab : : onEditDnsServersButtonClicked ( )
{
ListEditorDialog led ( this , ui - > dnsServersLineEdit - > text ( ) , ' , ' ) ;