summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/ppp/PPPIPedit.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/ppp/PPPIPedit.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/ppp/PPPIPedit.cpp37
1 files changed, 17 insertions, 20 deletions
diff --git a/noncore/settings/networksettings2/ppp/PPPIPedit.cpp b/noncore/settings/networksettings2/ppp/PPPIPedit.cpp
index 6965e5a..ef1b7c0 100644
--- a/noncore/settings/networksettings2/ppp/PPPIPedit.cpp
+++ b/noncore/settings/networksettings2/ppp/PPPIPedit.cpp
@@ -9,16 +9,7 @@ PPPIPEdit::PPPIPEdit( QWidget * Parent ) : PPPIPGUI( Parent ){
9} 9}
10 10
11QString PPPIPEdit::acceptable( void ) { 11QString PPPIPEdit::acceptable( void ) {
12 if( IPFixed_RB->isChecked() ) { 12 if( GWFixed_RB->isChecked() ) {
13 if( IPAddress_LE->text().isEmpty() )
14 return tr("IPAddress needed" );
15 if( ! validIP( IPAddress_LE->text() ) )
16 return tr("IPAddress not valid" );
17 if( IPSubMask_LE->text().isEmpty() )
18 return tr("Subnet mask needed" );
19 if( ! validIP( IPSubMask_LE->text() ) )
20 return tr("Subnet mask not valid" );
21 } else if( GWFixed_RB->isChecked() ) {
22 if( GWAddress_LE->text().isEmpty() ) 13 if( GWAddress_LE->text().isEmpty() )
23 return tr("Gateway address needed" ); 14 return tr("Gateway address needed" );
24 if( ! validIP( GWAddress_LE->text() ) ) 15 if( ! validIP( GWAddress_LE->text() ) )
@@ -28,30 +19,36 @@ QString PPPIPEdit::acceptable( void ) {
28 return QString(); 19 return QString();
29} 20}
30 21
31bool PPPIPEdit::commit( PPPData_t & D ) { 22bool PPPIPEdit::commit( PPPData & D ) {
32 23
33 bool SM = 0; 24 bool SM = 0;
34 25
35 CBM( D.IP.IPAutomatic, IPServerAssigned_RB, SM ); 26 CBM( D.IP.LocalOverrule, ServerOverrulesLocal_CB, SM );
36 if( ! D.IP.IPAutomatic ) { 27 CBM( D.IP.RemoteOverrule, ServerOverrulesRemote_CB, SM );
37 TXTM( D.IP.IPAddress, IPAddress_LE, SM ); 28
38 TXTM( D.IP.IPSubMask, IPSubMask_LE, SM ); 29 TXTM( D.IP.LocalAddress, LocalAddress_LE, SM );
39 } 30 TXTM( D.IP.RemoteAddress, RemoteAddress_LE, SM );
40 31
41 CBM( D.IP.GWAutomatic, GWServerAssigned_RB, SM ); 32 CBM( D.IP.GWAutomatic, GWServerAssigned_RB, SM );
33
42 if( ! D.IP.GWAutomatic ) { 34 if( ! D.IP.GWAutomatic ) {
43 TXTM( D.IP.GWAddress, GWAddress_LE, SM ); 35 TXTM( D.IP.GWAddress, GWAddress_LE, SM );
44 } 36 }
45 37
46 CBM( D.IP.GWIsDefault, GWIsDefault_CB, SM ); 38 CBM( D.IP.GWIsDefault, GWIsDefault_CB, SM );
39 CBM( D.IP.GWIfNotSet, GWIfNotSet_CB, SM );
40
47 return SM; 41 return SM;
48} 42}
49 43
50void PPPIPEdit::showData( PPPData_t & D ) { 44void PPPIPEdit::showData( PPPData & D ) {
51 IPServerAssigned_RB->setChecked( D.IP.IPAutomatic ); 45 ServerOverrulesLocal_CB->setChecked( D.IP.LocalOverrule );
52 IPAddress_LE->setText( D.IP.IPAddress ); 46 ServerOverrulesRemote_CB->setChecked( D.IP.RemoteOverrule );
53 IPSubMask_LE->setText( D.IP.IPSubMask ); 47 LocalAddress_LE->setText( D.IP.LocalAddress );
48 RemoteAddress_LE->setText( D.IP.RemoteAddress );
49
54 GWServerAssigned_RB->setChecked( D.IP.GWAutomatic ); 50 GWServerAssigned_RB->setChecked( D.IP.GWAutomatic );
55 GWAddress_LE->setText( D.IP.GWAddress ); 51 GWAddress_LE->setText( D.IP.GWAddress );
56 GWIsDefault_CB->setChecked( D.IP.GWIsDefault ); 52 GWIsDefault_CB->setChecked( D.IP.GWIsDefault );
53 GWIfNotSet_CB->setChecked( D.IP.GWIfNotSet );
57} 54}