Diffstat (limited to 'noncore/settings/networksettings2/network/networkedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/networkedit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/settings/networksettings2/network/networkedit.cpp b/noncore/settings/networksettings2/network/networkedit.cpp index b17d745..182213b 100644 --- a/noncore/settings/networksettings2/network/networkedit.cpp +++ b/noncore/settings/networksettings2/network/networkedit.cpp @@ -31,55 +31,55 @@ NetworkEdit::NetworkEdit( QWidget * Parent ) : NetworkGUI( Parent ){ } QString NetworkEdit::acceptable( void ) { if( DHCP_CB->isChecked() ) { if( SendHostname_CB->isChecked() ) if( Hostname_LE->text().isEmpty() ) return tr("Hostname needed"); return QString(); } if( IPAddress_LE->text().isEmpty() ) return tr("IPAddress needed"); if( Broadcast_LE->text().isEmpty() ) return tr("Broadcast needed"); if( SubnetMask_LE->text().isEmpty() ) return tr("Subnet mask needed"); // valid IP ? if( ! validIP( IPAddress_LE->text() ) ) return tr("IPAddress not valid"); if( ! validIP( SubnetMask_LE->text() ) ) return tr("Subnet mask not valid"); if( ! validIP( Broadcast_LE->text() ) ) return tr("Broadcast address not valid"); - if( Gateway_LE->text().isEmpty() && + if( Gateway_LE->text().isEmpty() || ! validIP( Gateway_LE->text() ) ) return tr("Gateway address not valid"); - if( DNS1_LE->text().isEmpty() && + if( ! DNS1_LE->text().isEmpty() && ! validIP( DNS1_LE->text() ) ) return tr("DNS1 address not valid"); - if( DNS2_LE->text().isEmpty() && + if( ! DNS2_LE->text().isEmpty() && ! validIP( DNS2_LE->text() ) ) return tr("DNS2 address not valid"); return QString(); } bool NetworkEdit::commit( NetworkData_t & Data ) { bool SM = 0; CBM( Data.UseDHCP, DHCP_CB, SM ); TXTM( Data.IPAddress, IPAddress_LE, SM ); CBM( Data.SendHostname, SendHostname_CB, SM ); TXTM( Data.Hostname, Hostname_LE, SM ); TXTM( Data.Gateway, Gateway_LE, SM ); TXTM( Data.Broadcast, Broadcast_LE, SM ); TXTM( Data.NetMask, SubnetMask_LE, SM ); TXTM( Data.DNS1, DNS1_LE, SM ); TXTM( Data.DNS2, DNS2_LE, SM ); SM |= updateList( Data.PreUp_SL, PreUp_LB ); SM |= updateList( Data.PostUp_SL, PostUp_LB ); SM |= updateList( Data.PreDown_SL, PreDown_LB ); SM |= updateList( Data.PostDown_SL, PostDown_LB ); return SM; } |