Diffstat (limited to 'noncore/settings/networksettings2/ppp/PPPAuthedit.cpp') (more/less context) (ignore 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 | |||
@@ -8,8 +8,15 @@ | |||
8 | 8 | ||
9 | PPPAuthEdit::PPPAuthEdit( QWidget * Parent ) : PPPAuthGUI( Parent ){ | 9 | 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() ) { |
14 | if( LoginSend_LE->text().isEmpty() ) | 21 | if( LoginSend_LE->text().isEmpty() ) |
15 | return tr("Login send missing"); | 22 | return tr("Login send missing"); |
@@ -18,9 +25,9 @@ QString PPPAuthEdit::acceptable( void ) { | |||
18 | if( PasswordSend_LE->text().isEmpty() ) | 25 | if( PasswordSend_LE->text().isEmpty() ) |
19 | return tr("Password send missing"); | 26 | return tr("Password send missing"); |
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"); |
25 | if( Server_LE->text().isEmpty() ) | 32 | if( Server_LE->text().isEmpty() ) |
26 | return tr("Pap/Chap/EAP server id missing"); | 33 | return tr("Pap/Chap/EAP server id missing"); |
@@ -33,43 +40,58 @@ QString PPPAuthEdit::acceptable( void ) { | |||
33 | bool PPPAuthEdit::commit( PPPData_t & D ) { | 40 | bool PPPAuthEdit::commit( PPPData_t & D ) { |
34 | bool SM = 0; | 41 | bool SM = 0; |
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 |
40 | SM = 1; | 47 | SM = 1; |
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 | ||
47 | if( Login_RB->isChecked() ) { | 53 | if( Login_RB->isChecked() ) { |
48 | TXTM( D.Auth.Login.Expect, LoginExpect_LE, SM ); | 54 | TXTM( D.Auth.Login.Expect, LoginExpect_LE, SM ); |
49 | TXTM( D.Auth.Login.Send, LoginSend_LE, SM ); | 55 | TXTM( D.Auth.Login.Send, LoginSend_LE, SM ); |
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; |
59 | } | 71 | } |
60 | 72 | ||
61 | void PPPAuthEdit::showData( PPPData_t & D ) { | 73 | void PPPAuthEdit::showData( PPPData_t & D ) { |
62 | 74 | ||
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 ); |
66 | break; | 78 | break; |
67 | case 1 : | 79 | case 1 : |
68 | PapChap_RB->isChecked(); | 80 | switch( D.Auth.PCEMode ) { |
81 | case 0 : | ||
82 | Pap_RB->setChecked( TRUE ); | ||
83 | break; | ||
84 | case 1 : | ||
85 | Chap_RB->setChecked( TRUE ); | ||
86 | break; | ||
87 | case 2 : | ||
88 | EAP_RB->setChecked( TRUE ); | ||
89 | break; | ||
90 | } | ||
69 | break; | 91 | break; |
70 | case 2 : | 92 | case 2 : |
71 | Terminal_RB->isChecked(); | 93 | Terminal_RB->setChecked( TRUE ); |
72 | break; | 94 | break; |
73 | } | 95 | } |
74 | 96 | ||
75 | LoginExpect_LE->setText( D.Auth.Login.Expect ); | 97 | LoginExpect_LE->setText( D.Auth.Login.Expect ); |
@@ -79,7 +101,5 @@ void PPPAuthEdit::showData( PPPData_t & D ) { | |||
79 | 101 | ||
80 | Client_LE->setText( D.Auth.Client ); | 102 | Client_LE->setText( D.Auth.Client ); |
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 | } |