Diffstat (limited to 'noncore/settings/networksettings2/ppp/PPPAuthedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/ppp/PPPAuthedit.cpp | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp index f305cc4..450d560 100644 --- a/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp +++ b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp | |||
@@ -10,4 +10,11 @@ PPPAuthEdit::PPPAuthEdit( QWidget * Parent ) : PPPAuthGUI( Parent ){ | |||
10 | } | 10 | } |
11 | 11 | ||
12 | bool PPPAuthEdit::PAP_Checked( void ) { | ||
13 | return ( Pap_RB->isChecked() || | ||
14 | Chap_RB->isChecked() || | ||
15 | EAP_RB->isChecked() | ||
16 | ); | ||
17 | } | ||
18 | |||
12 | QString PPPAuthEdit::acceptable( void ) { | 19 | QString PPPAuthEdit::acceptable( void ) { |
13 | if( Login_RB->isChecked() ) { | 20 | if( Login_RB->isChecked() ) { |
@@ -20,5 +27,5 @@ QString PPPAuthEdit::acceptable( void ) { | |||
20 | if( PasswordExpect_LE->text().isEmpty() ) | 27 | if( PasswordExpect_LE->text().isEmpty() ) |
21 | return tr("Password expect missing"); | 28 | return tr("Password expect missing"); |
22 | } else if( PapChap_RB->isChecked() ) { | 29 | } else if( PAP_Checked() ) { |
23 | if( Client_LE->text().isEmpty() ) | 30 | if( Client_LE->text().isEmpty() ) |
24 | return tr("Pap/Chap/EAP client id missing"); | 31 | return tr("Pap/Chap/EAP client id missing"); |
@@ -35,5 +42,5 @@ bool PPPAuthEdit::commit( PPPData_t & D ) { | |||
35 | 42 | ||
36 | if( ( D.Auth.Mode == 0 && ! Login_RB->isChecked() ) || | 43 | if( ( D.Auth.Mode == 0 && ! Login_RB->isChecked() ) || |
37 | ( D.Auth.Mode == 1 && ! PapChap_RB->isChecked() ) || | 44 | ( D.Auth.Mode == 1 && ! PAP_Checked() ) || |
38 | ( D.Auth.Mode == 2 && ! Terminal_RB->isChecked() ) ) { | 45 | ( D.Auth.Mode == 2 && ! Terminal_RB->isChecked() ) ) { |
39 | // mode modifed | 46 | // mode modifed |
@@ -41,6 +48,5 @@ bool PPPAuthEdit::commit( PPPData_t & D ) { | |||
41 | D.Auth.Mode = ( Login_RB->isChecked() ) ? | 48 | D.Auth.Mode = ( Login_RB->isChecked() ) ? |
42 | 0 : | 49 | 0 : |
43 | ( ( PapChap_RB->isChecked() ) ? | 50 | ( PAP_Checked() ) ? 1 : 2; |
44 | 1 : 2 ); | ||
45 | } | 51 | } |
46 | 52 | ||
@@ -50,9 +56,15 @@ bool PPPAuthEdit::commit( PPPData_t & D ) { | |||
50 | TXTM( D.Auth.Password.Expect, PasswordExpect_LE, SM ); | 56 | TXTM( D.Auth.Password.Expect, PasswordExpect_LE, SM ); |
51 | TXTM( D.Auth.Password.Send, PasswordSend_LE, SM ); | 57 | TXTM( D.Auth.Password.Send, PasswordSend_LE, SM ); |
52 | } else if( PapChap_RB->isChecked() ) { | 58 | } else if( PAP_Checked() ) { |
53 | TXTM( D.Auth.Client, Client_LE, SM ); | 59 | TXTM( D.Auth.Client, Client_LE, SM ); |
54 | TXTM( D.Auth.Server, Server_LE, SM ); | 60 | TXTM( D.Auth.Server, Server_LE, SM ); |
55 | TXTM( D.Auth.Secret, Secret_LE, SM ); | 61 | TXTM( D.Auth.Secret, Secret_LE, SM ); |
56 | CIM( D.Auth.PCEMode, AuthMethod_CB, SM ); | 62 | if( Pap_RB->isChecked() ) { |
63 | D.Auth.PCEMode = 0; | ||
64 | } else if( Chap_RB->isChecked() ) { | ||
65 | D.Auth.PCEMode = 1; | ||
66 | } else if( EAP_RB->isChecked() ) { | ||
67 | D.Auth.PCEMode = 2; | ||
68 | } | ||
57 | } | 69 | } |
58 | return SM; | 70 | return SM; |
@@ -63,11 +75,21 @@ void PPPAuthEdit::showData( PPPData_t & D ) { | |||
63 | switch( D.Auth.Mode ) { | 75 | switch( D.Auth.Mode ) { |
64 | case 0 : | 76 | case 0 : |
65 | Login_RB->isChecked(); | 77 | Login_RB->setChecked( TRUE ); |
78 | break; | ||
79 | case 1 : | ||
80 | switch( D.Auth.PCEMode ) { | ||
81 | case 0 : | ||
82 | Pap_RB->setChecked( TRUE ); | ||
66 | break; | 83 | break; |
67 | case 1 : | 84 | case 1 : |
68 | PapChap_RB->isChecked(); | 85 | Chap_RB->setChecked( TRUE ); |
69 | break; | 86 | break; |
70 | case 2 : | 87 | case 2 : |
71 | Terminal_RB->isChecked(); | 88 | EAP_RB->setChecked( TRUE ); |
89 | break; | ||
90 | } | ||
91 | break; | ||
92 | case 2 : | ||
93 | Terminal_RB->setChecked( TRUE ); | ||
72 | break; | 94 | break; |
73 | } | 95 | } |
@@ -81,5 +103,3 @@ void PPPAuthEdit::showData( PPPData_t & D ) { | |||
81 | Server_LE->setText( D.Auth.Server ); | 103 | Server_LE->setText( D.Auth.Server ); |
82 | Secret_LE->setText( D.Auth.Secret ); | 104 | Secret_LE->setText( D.Auth.Secret ); |
83 | |||
84 | AuthMethod_CB->setCurrentItem( D.Auth.PCEMode ); | ||
85 | } | 105 | } |