Diffstat (limited to 'noncore/settings/networksettings2/ppp') (more/less context) (ignore whitespace changes)
19 files changed, 327 insertions, 363 deletions
diff --git a/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp index 450d560..9403694 100644 --- a/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp +++ b/noncore/settings/networksettings2/ppp/PPPAuthedit.cpp | |||
@@ -1,105 +1,105 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <qcombobox.h> | 2 | #include <qcombobox.h> |
3 | #include <qmessagebox.h> | 3 | #include <qmessagebox.h> |
4 | #include <qradiobutton.h> | 4 | #include <qradiobutton.h> |
5 | #include <qlineedit.h> | 5 | #include <qlineedit.h> |
6 | #include <GUIUtils.h> | 6 | #include <GUIUtils.h> |
7 | #include "PPPAuthedit.h" | 7 | #include "PPPAuthedit.h" |
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 ) { | 12 | bool PPPAuthEdit::PAP_Checked( void ) { |
13 | return ( Pap_RB->isChecked() || | 13 | return ( Pap_RB->isChecked() || |
14 | Chap_RB->isChecked() || | 14 | Chap_RB->isChecked() || |
15 | EAP_RB->isChecked() | 15 | EAP_RB->isChecked() |
16 | ); | 16 | ); |
17 | } | 17 | } |
18 | 18 | ||
19 | QString PPPAuthEdit::acceptable( void ) { | 19 | QString PPPAuthEdit::acceptable( void ) { |
20 | if( Login_RB->isChecked() ) { | 20 | if( Login_RB->isChecked() ) { |
21 | if( LoginSend_LE->text().isEmpty() ) | 21 | if( LoginSend_LE->text().isEmpty() ) |
22 | return tr("Login send missing"); | 22 | return tr("Login send missing"); |
23 | if( LoginExpect_LE->text().isEmpty() ) | 23 | if( LoginExpect_LE->text().isEmpty() ) |
24 | return tr("Login expect missing"); | 24 | return tr("Login expect missing"); |
25 | if( PasswordSend_LE->text().isEmpty() ) | 25 | if( PasswordSend_LE->text().isEmpty() ) |
26 | return tr("Password send missing"); | 26 | return tr("Password send missing"); |
27 | if( PasswordExpect_LE->text().isEmpty() ) | 27 | if( PasswordExpect_LE->text().isEmpty() ) |
28 | return tr("Password expect missing"); | 28 | return tr("Password expect missing"); |
29 | } else if( PAP_Checked() ) { | 29 | } else if( PAP_Checked() ) { |
30 | if( Client_LE->text().isEmpty() ) | 30 | if( Client_LE->text().isEmpty() ) |
31 | return tr("Pap/Chap/EAP client id missing"); | 31 | return tr("Pap/Chap/EAP client id missing"); |
32 | if( Server_LE->text().isEmpty() ) | 32 | if( Server_LE->text().isEmpty() ) |
33 | return tr("Pap/Chap/EAP server id missing"); | 33 | return tr("Pap/Chap/EAP server id missing"); |
34 | if( Secret_LE->text().isEmpty() ) | 34 | if( Secret_LE->text().isEmpty() ) |
35 | return tr("Pap/Chap/EAP secret id missing"); | 35 | return tr("Pap/Chap/EAP secret id missing"); |
36 | } | 36 | } |
37 | return QString(); | 37 | return QString(); |
38 | } | 38 | } |
39 | 39 | ||
40 | bool PPPAuthEdit::commit( PPPData_t & D ) { | 40 | bool PPPAuthEdit::commit( PPPData & D ) { |
41 | bool SM = 0; | 41 | bool SM = 0; |
42 | 42 | ||
43 | if( ( D.Auth.Mode == 0 && ! Login_RB->isChecked() ) || | 43 | if( ( D.Auth.Mode == 0 && ! Login_RB->isChecked() ) || |
44 | ( D.Auth.Mode == 1 && ! PAP_Checked() ) || | 44 | ( D.Auth.Mode == 1 && ! PAP_Checked() ) || |
45 | ( D.Auth.Mode == 2 && ! Terminal_RB->isChecked() ) ) { | 45 | ( D.Auth.Mode == 2 && ! Terminal_RB->isChecked() ) ) { |
46 | // mode modifed | 46 | // mode modifed |
47 | SM = 1; | 47 | SM = 1; |
48 | D.Auth.Mode = ( Login_RB->isChecked() ) ? | 48 | D.Auth.Mode = ( Login_RB->isChecked() ) ? |
49 | 0 : | 49 | 0 : |
50 | ( PAP_Checked() ) ? 1 : 2; | 50 | ( PAP_Checked() ) ? 1 : 2; |
51 | } | 51 | } |
52 | 52 | ||
53 | if( Login_RB->isChecked() ) { | 53 | if( Login_RB->isChecked() ) { |
54 | TXTM( D.Auth.Login.Expect, LoginExpect_LE, SM ); | 54 | TXTM( D.Auth.Login.Expect, LoginExpect_LE, SM ); |
55 | TXTM( D.Auth.Login.Send, LoginSend_LE, SM ); | 55 | TXTM( D.Auth.Login.Send, LoginSend_LE, SM ); |
56 | TXTM( D.Auth.Password.Expect, PasswordExpect_LE, SM ); | 56 | TXTM( D.Auth.Password.Expect, PasswordExpect_LE, SM ); |
57 | TXTM( D.Auth.Password.Send, PasswordSend_LE, SM ); | 57 | TXTM( D.Auth.Password.Send, PasswordSend_LE, SM ); |
58 | } else if( PAP_Checked() ) { | 58 | } else if( PAP_Checked() ) { |
59 | TXTM( D.Auth.Client, Client_LE, SM ); | 59 | TXTM( D.Auth.Client, Client_LE, SM ); |
60 | TXTM( D.Auth.Server, Server_LE, SM ); | 60 | TXTM( D.Auth.Server, Server_LE, SM ); |
61 | TXTM( D.Auth.Secret, Secret_LE, SM ); | 61 | TXTM( D.Auth.Secret, Secret_LE, SM ); |
62 | if( Pap_RB->isChecked() ) { | 62 | if( Pap_RB->isChecked() ) { |
63 | D.Auth.PCEMode = 0; | 63 | D.Auth.PCEMode = 0; |
64 | } else if( Chap_RB->isChecked() ) { | 64 | } else if( Chap_RB->isChecked() ) { |
65 | D.Auth.PCEMode = 1; | 65 | D.Auth.PCEMode = 1; |
66 | } else if( EAP_RB->isChecked() ) { | 66 | } else if( EAP_RB->isChecked() ) { |
67 | D.Auth.PCEMode = 2; | 67 | D.Auth.PCEMode = 2; |
68 | } | 68 | } |
69 | } | 69 | } |
70 | return SM; | 70 | return SM; |
71 | } | 71 | } |
72 | 72 | ||
73 | void PPPAuthEdit::showData( PPPData_t & D ) { | 73 | void PPPAuthEdit::showData( PPPData & D ) { |
74 | 74 | ||
75 | switch( D.Auth.Mode ) { | 75 | switch( D.Auth.Mode ) { |
76 | case 0 : | 76 | case 0 : |
77 | Login_RB->setChecked( TRUE ); | 77 | Login_RB->setChecked( TRUE ); |
78 | break; | 78 | break; |
79 | case 1 : | 79 | case 1 : |
80 | switch( D.Auth.PCEMode ) { | 80 | switch( D.Auth.PCEMode ) { |
81 | case 0 : | 81 | case 0 : |
82 | Pap_RB->setChecked( TRUE ); | 82 | Pap_RB->setChecked( TRUE ); |
83 | break; | 83 | break; |
84 | case 1 : | 84 | case 1 : |
85 | Chap_RB->setChecked( TRUE ); | 85 | Chap_RB->setChecked( TRUE ); |
86 | break; | 86 | break; |
87 | case 2 : | 87 | case 2 : |
88 | EAP_RB->setChecked( TRUE ); | 88 | EAP_RB->setChecked( TRUE ); |
89 | break; | 89 | break; |
90 | } | 90 | } |
91 | break; | 91 | break; |
92 | case 2 : | 92 | case 2 : |
93 | Terminal_RB->setChecked( TRUE ); | 93 | Terminal_RB->setChecked( TRUE ); |
94 | break; | 94 | break; |
95 | } | 95 | } |
96 | 96 | ||
97 | LoginExpect_LE->setText( D.Auth.Login.Expect ); | 97 | LoginExpect_LE->setText( D.Auth.Login.Expect ); |
98 | PasswordExpect_LE->setText( D.Auth.Password.Expect ); | 98 | PasswordExpect_LE->setText( D.Auth.Password.Expect ); |
99 | LoginSend_LE->setText( D.Auth.Login.Send ); | 99 | LoginSend_LE->setText( D.Auth.Login.Send ); |
100 | PasswordSend_LE->setText( D.Auth.Password.Send ); | 100 | PasswordSend_LE->setText( D.Auth.Password.Send ); |
101 | 101 | ||
102 | Client_LE->setText( D.Auth.Client ); | 102 | Client_LE->setText( D.Auth.Client ); |
103 | Server_LE->setText( D.Auth.Server ); | 103 | Server_LE->setText( D.Auth.Server ); |
104 | Secret_LE->setText( D.Auth.Secret ); | 104 | Secret_LE->setText( D.Auth.Secret ); |
105 | } | 105 | } |
diff --git a/noncore/settings/networksettings2/ppp/PPPAuthedit.h b/noncore/settings/networksettings2/ppp/PPPAuthedit.h index 2392569..7a06657 100644 --- a/noncore/settings/networksettings2/ppp/PPPAuthedit.h +++ b/noncore/settings/networksettings2/ppp/PPPAuthedit.h | |||
@@ -1,17 +1,17 @@ | |||
1 | #include "pppdata.h" | 1 | #include "pppdata.h" |
2 | #include "PPPAuthGUI.h" | 2 | #include "PPPAuthGUI.h" |
3 | 3 | ||
4 | class PPPAuthEdit : public PPPAuthGUI { | 4 | class PPPAuthEdit : public PPPAuthGUI { |
5 | 5 | ||
6 | public : | 6 | public : |
7 | 7 | ||
8 | PPPAuthEdit( QWidget * parent ); | 8 | PPPAuthEdit( QWidget * parent ); |
9 | QString acceptable( void ); | 9 | QString acceptable( void ); |
10 | bool commit( PPPData_t & Data ); | 10 | bool commit( PPPData & Data ); |
11 | void showData( PPPData_t & Data ); | 11 | void showData( PPPData & Data ); |
12 | bool PAP_Checked( void ); | 12 | bool PAP_Checked( void ); |
13 | 13 | ||
14 | 14 | ||
15 | private : | 15 | private : |
16 | 16 | ||
17 | }; | 17 | }; |
diff --git a/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp b/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp index 22f8e59..270f695 100644 --- a/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp +++ b/noncore/settings/networksettings2/ppp/PPPDNSedit.cpp | |||
@@ -1,108 +1,108 @@ | |||
1 | #include <qtoolbutton.h> | 1 | #include <qtoolbutton.h> |
2 | #include <qmessagebox.h> | 2 | #include <qmessagebox.h> |
3 | #include <qlistbox.h> | 3 | #include <qlistbox.h> |
4 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
5 | #include <qradiobutton.h> | 5 | #include <qradiobutton.h> |
6 | #include <resources.h> | 6 | #include <resources.h> |
7 | #include <GUIUtils.h> | 7 | #include <GUIUtils.h> |
8 | #include "PPPDNSedit.h" | 8 | #include "PPPDNSedit.h" |
9 | 9 | ||
10 | PPPDNSEdit::PPPDNSEdit( QWidget * Parent ) : PPPDNSGUI( Parent ){ | 10 | PPPDNSEdit::PPPDNSEdit( QWidget * Parent ) : PPPDNSGUI( Parent ){ |
11 | 11 | ||
12 | Add_TB->setPixmap( NSResources->getPixmap( "add" ) ); | 12 | Add_TB->setPixmap( NSResources->getPixmap( "add" ) ); |
13 | Remove_TB->setPixmap( NSResources->getPixmap( "remove" ) ); | 13 | Remove_TB->setPixmap( NSResources->getPixmap( "remove" ) ); |
14 | } | 14 | } |
15 | 15 | ||
16 | QString PPPDNSEdit::acceptable( void ) { | 16 | QString PPPDNSEdit::acceptable( void ) { |
17 | if( DNSFixed_RB->isChecked() ) { | 17 | if( DNSFixed_RB->isChecked() ) { |
18 | if( DomainName_LE->text().isEmpty() ) | 18 | if( DomainName_LE->text().isEmpty() ) |
19 | tr("Domainname needed"); | 19 | tr("Domainname needed"); |
20 | if( Servers_LB->count() == 0 ) | 20 | if( Servers_LB->count() == 0 ) |
21 | tr("DNS Servers needed"); | 21 | tr("DNS Servers needed"); |
22 | } | 22 | } |
23 | return QString(); | 23 | return QString(); |
24 | } | 24 | } |
25 | 25 | ||
26 | bool PPPDNSEdit::commit( PPPData_t & D ) { | 26 | bool PPPDNSEdit::commit( PPPData & D ) { |
27 | bool SM = 0; | 27 | bool SM = 0; |
28 | 28 | ||
29 | CBM( D.DNS.ServerAssigned, DNSServerAssigned_RB, SM ); | 29 | CBM( D.DNS.ServerAssigned, DNSServerAssigned_RB, SM ); |
30 | TXTM( D.DNS.DomainName, DomainName_LE, SM ); | 30 | TXTM( D.DNS.DomainName, DomainName_LE, SM ); |
31 | 31 | ||
32 | // new items in old ? | 32 | // new items in old ? |
33 | for ( unsigned i = 0; i < Servers_LB->count(); i++ ) { | 33 | for ( unsigned i = 0; i < Servers_LB->count(); i++ ) { |
34 | QString S; | 34 | QString S; |
35 | bool Found; | 35 | bool Found; |
36 | Found = 0; | 36 | Found = 0; |
37 | S = Servers_LB->text(i); | 37 | S = Servers_LB->text(i); |
38 | for ( unsigned j = 0; j < D.DNS.Servers.size(); j++ ) { | 38 | for ( unsigned j = 0; j < D.DNS.Servers.size(); j++ ) { |
39 | if( *(D.DNS.Servers[i]) == S ) { | 39 | if( *(D.DNS.Servers[i]) == S ) { |
40 | // still in list | 40 | // still in list |
41 | Found = 1; | 41 | Found = 1; |
42 | break; | 42 | break; |
43 | } | 43 | } |
44 | } | 44 | } |
45 | if( ! Found ) { | 45 | if( ! Found ) { |
46 | SM = 1; | 46 | SM = 1; |
47 | D.DNS.Servers.resize( D.DNS.Servers.size()+1 ); | 47 | D.DNS.Servers.resize( D.DNS.Servers.size()+1 ); |
48 | D.DNS.Servers[D.DNS.Servers.size()] = new QString( S ); | 48 | D.DNS.Servers[D.DNS.Servers.size()] = new QString( S ); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | // old in new ? | 52 | // old in new ? |
53 | for ( unsigned j = 0; j < D.DNS.Servers.size(); j++ ) { | 53 | for ( unsigned j = 0; j < D.DNS.Servers.size(); j++ ) { |
54 | bool Found; | 54 | bool Found; |
55 | Found = 0; | 55 | Found = 0; |
56 | for ( unsigned i = 0; i < Servers_LB->count(); i++ ) { | 56 | for ( unsigned i = 0; i < Servers_LB->count(); i++ ) { |
57 | if( *(D.DNS.Servers[j]) == Servers_LB->text(i) ) { | 57 | if( *(D.DNS.Servers[j]) == Servers_LB->text(i) ) { |
58 | // still in list | 58 | // still in list |
59 | Found = 1; | 59 | Found = 1; |
60 | break; | 60 | break; |
61 | } | 61 | } |
62 | } | 62 | } |
63 | if( ! Found ) { | 63 | if( ! Found ) { |
64 | // old obsolete | 64 | // old obsolete |
65 | SM = 1; | 65 | SM = 1; |
66 | delete D.DNS.Servers[j]; | 66 | delete D.DNS.Servers[j]; |
67 | for( unsigned i = j+1; i < D.DNS.Servers.size(); i ++ ) { | 67 | for( unsigned i = j+1; i < D.DNS.Servers.size(); i ++ ) { |
68 | // compress array | 68 | // compress array |
69 | D.DNS.Servers[i-1] = D.DNS.Servers[i]; | 69 | D.DNS.Servers[i-1] = D.DNS.Servers[i]; |
70 | } | 70 | } |
71 | // shrink | 71 | // shrink |
72 | D.DNS.Servers.resize( D.DNS.Servers.size()-1 ); | 72 | D.DNS.Servers.resize( D.DNS.Servers.size()-1 ); |
73 | } | 73 | } |
74 | } | 74 | } |
75 | return SM; | 75 | return SM; |
76 | } | 76 | } |
77 | 77 | ||
78 | void PPPDNSEdit::showData( PPPData_t & D) { | 78 | void PPPDNSEdit::showData( PPPData & D) { |
79 | 79 | ||
80 | DNSServerAssigned_RB->setChecked( D.DNS.ServerAssigned ); | 80 | DNSServerAssigned_RB->setChecked( D.DNS.ServerAssigned ); |
81 | 81 | ||
82 | DomainName_LE->setText( D.DNS.DomainName ); | 82 | DomainName_LE->setText( D.DNS.DomainName ); |
83 | for( unsigned i = 0; i < D.DNS.Servers.size(); i ++ ) { | 83 | for( unsigned i = 0; i < D.DNS.Servers.size(); i ++ ) { |
84 | Servers_LB->insertItem( *(D.DNS.Servers[i]) ); | 84 | Servers_LB->insertItem( *(D.DNS.Servers[i]) ); |
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
88 | void PPPDNSEdit::SLOT_AddServer( void ) { | 88 | void PPPDNSEdit::SLOT_AddServer( void ) { |
89 | if( ServerAddress_LE->text().isEmpty() ) | 89 | if( ServerAddress_LE->text().isEmpty() ) |
90 | return; | 90 | return; |
91 | 91 | ||
92 | Servers_LB->insertItem( ServerAddress_LE->text() ); | 92 | Servers_LB->insertItem( ServerAddress_LE->text() ); |
93 | ServerAddress_LE->setText( "" ); | 93 | ServerAddress_LE->setText( "" ); |
94 | } | 94 | } |
95 | 95 | ||
96 | void PPPDNSEdit::SLOT_RemoveServer( void ) { | 96 | void PPPDNSEdit::SLOT_RemoveServer( void ) { |
97 | long i = Servers_LB->currentItem(); | 97 | long i = Servers_LB->currentItem(); |
98 | if( i < 0 ) | 98 | if( i < 0 ) |
99 | return; | 99 | return; |
100 | Servers_LB->removeItem( i ); | 100 | Servers_LB->removeItem( i ); |
101 | if( (unsigned) i >= Servers_LB->count() ) { | 101 | if( (unsigned) i >= Servers_LB->count() ) { |
102 | i --; | 102 | i --; |
103 | } | 103 | } |
104 | if( i >= 0 ) { | 104 | if( i >= 0 ) { |
105 | Servers_LB->setCurrentItem( i ); | 105 | Servers_LB->setCurrentItem( i ); |
106 | } | 106 | } |
107 | 107 | ||
108 | } | 108 | } |
diff --git a/noncore/settings/networksettings2/ppp/PPPDNSedit.h b/noncore/settings/networksettings2/ppp/PPPDNSedit.h index 43e0067..1ca8c21 100644 --- a/noncore/settings/networksettings2/ppp/PPPDNSedit.h +++ b/noncore/settings/networksettings2/ppp/PPPDNSedit.h | |||
@@ -1,20 +1,20 @@ | |||
1 | #include "pppdata.h" | 1 | #include "pppdata.h" |
2 | #include "PPPDNSGUI.h" | 2 | #include "PPPDNSGUI.h" |
3 | 3 | ||
4 | class PPPDNSEdit : public PPPDNSGUI { | 4 | class PPPDNSEdit : public PPPDNSGUI { |
5 | 5 | ||
6 | public : | 6 | public : |
7 | 7 | ||
8 | PPPDNSEdit( QWidget * parent ); | 8 | PPPDNSEdit( QWidget * parent ); |
9 | QString acceptable( void ); | 9 | QString acceptable( void ); |
10 | bool commit( PPPData_t & Data ); | 10 | bool commit( PPPData & Data ); |
11 | void showData( PPPData_t & Data ); | 11 | void showData( PPPData & Data ); |
12 | 12 | ||
13 | public slots : | 13 | public slots : |
14 | 14 | ||
15 | void SLOT_AddServer( void ); | 15 | void SLOT_AddServer( void ); |
16 | void SLOT_RemoveServer( void ); | 16 | void SLOT_RemoveServer( void ); |
17 | 17 | ||
18 | private : | 18 | private : |
19 | 19 | ||
20 | }; | 20 | }; |
diff --git a/noncore/settings/networksettings2/ppp/PPPGUI.ui b/noncore/settings/networksettings2/ppp/PPPGUI.ui index 777e4a9..4c79fe3 100644 --- a/noncore/settings/networksettings2/ppp/PPPGUI.ui +++ b/noncore/settings/networksettings2/ppp/PPPGUI.ui | |||
@@ -1,103 +1,115 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>PPPGUI</class> | 2 | <class>PPPGUI</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QWidget</class> | 4 | <class>QWidget</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>PPPGUI</cstring> | 7 | <cstring>PPPGUI</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>124</width> | 14 | <width>528</width> |
15 | <height>29</height> | 15 | <height>345</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>PPP</string> | 20 | <string>PPP</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>2</number> | 31 | <number>0</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>2</number> | 35 | <number>2</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QComboBox</class> | 38 | <class>QComboBox</class> |
39 | <item> | 39 | <item> |
40 | <property> | 40 | <property> |
41 | <name>text</name> | 41 | <name>text</name> |
42 | <string>Authentication</string> | 42 | <string>Authentication</string> |
43 | </property> | 43 | </property> |
44 | </item> | 44 | </item> |
45 | <item> | 45 | <item> |
46 | <property> | 46 | <property> |
47 | <name>text</name> | 47 | <name>text</name> |
48 | <string>IP settings</string> | 48 | <string>IP settings</string> |
49 | </property> | 49 | </property> |
50 | </item> | 50 | </item> |
51 | <item> | 51 | <item> |
52 | <property> | 52 | <property> |
53 | <name>text</name> | 53 | <name>text</name> |
54 | <string>DNS Settings</string> | 54 | <string>DNS Settings</string> |
55 | </property> | 55 | </property> |
56 | </item> | 56 | </item> |
57 | <item> | ||
58 | <property> | ||
59 | <name>text</name> | ||
60 | <string>Commands</string> | ||
61 | </property> | ||
62 | </item> | ||
63 | <item> | ||
64 | <property> | ||
65 | <name>text</name> | ||
66 | <string>Dialing</string> | ||
67 | </property> | ||
68 | </item> | ||
57 | <property stdset="1"> | 69 | <property stdset="1"> |
58 | <name>name</name> | 70 | <name>name</name> |
59 | <cstring>PPPOptions_CB</cstring> | 71 | <cstring>PPPOptions_CB</cstring> |
60 | </property> | 72 | </property> |
61 | </widget> | 73 | </widget> |
62 | <widget> | 74 | <widget> |
63 | <class>QWidgetStack</class> | 75 | <class>QWidgetStack</class> |
64 | <property stdset="1"> | 76 | <property stdset="1"> |
65 | <name>name</name> | 77 | <name>name</name> |
66 | <cstring>Options_WS</cstring> | 78 | <cstring>Options_WS</cstring> |
67 | </property> | 79 | </property> |
68 | </widget> | 80 | </widget> |
69 | </vbox> | 81 | </vbox> |
70 | </widget> | 82 | </widget> |
71 | <customwidgets> | 83 | <customwidgets> |
72 | <customwidget> | 84 | <customwidget> |
73 | <class>QWidgetStack</class> | 85 | <class>QWidgetStack</class> |
74 | <header location="global">qwidgetstack.h</header> | 86 | <header location="global">qwidgetstack.h</header> |
75 | <sizehint> | 87 | <sizehint> |
76 | <width>-1</width> | 88 | <width>-1</width> |
77 | <height>-1</height> | 89 | <height>-1</height> |
78 | </sizehint> | 90 | </sizehint> |
79 | <container>0</container> | 91 | <container>1</container> |
80 | <sizepolicy> | 92 | <sizepolicy> |
81 | <hordata>7</hordata> | 93 | <hordata>7</hordata> |
82 | <verdata>7</verdata> | 94 | <verdata>7</verdata> |
83 | </sizepolicy> | 95 | </sizepolicy> |
84 | <pixmap>image0</pixmap> | 96 | <pixmap>image0</pixmap> |
85 | <slot access="public">raiseWidget( int )</slot> | 97 | <slot access="public">raiseWidget( int )</slot> |
86 | </customwidget> | 98 | </customwidget> |
87 | </customwidgets> | 99 | </customwidgets> |
88 | <images> | 100 | <images> |
89 | <image> | 101 | <image> |
90 | <name>image0</name> | 102 | <name>image0</name> |
91 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data> | 103 | <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data> |
92 | </image> | 104 | </image> |
93 | </images> | 105 | </images> |
94 | <connections> | 106 | <connections> |
95 | <connection> | 107 | <connection> |
96 | <sender>PPPOptions_CB</sender> | 108 | <sender>PPPOptions_CB</sender> |
97 | <signal>activated(int)</signal> | 109 | <signal>activated(int)</signal> |
98 | <receiver>PPPGUI</receiver> | 110 | <receiver>PPPGUI</receiver> |
99 | <slot>SLOT_SelectTopic( int )</slot> | 111 | <slot>SLOT_SelectTopic( int )</slot> |
100 | </connection> | 112 | </connection> |
101 | <slot access="public">SLOT_SelectTopic( int )</slot> | 113 | <slot access="public">SLOT_SelectTopic( int )</slot> |
102 | </connections> | 114 | </connections> |
103 | </UI> | 115 | </UI> |
diff --git a/noncore/settings/networksettings2/ppp/PPPIPGUI.ui b/noncore/settings/networksettings2/ppp/PPPIPGUI.ui index f3d5019..21bd29e 100644 --- a/noncore/settings/networksettings2/ppp/PPPIPGUI.ui +++ b/noncore/settings/networksettings2/ppp/PPPIPGUI.ui | |||
@@ -1,444 +1,399 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>PPPIPGUI</class> | 2 | <class>PPPIPGUI</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QWidget</class> | 4 | <class>QWidget</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>PPPIPGUI</cstring> | 7 | <cstring>PPPIPGUI</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>133</width> | 14 | <width>258</width> |
15 | <height>235</height> | 15 | <height>232</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>PPPIP</string> | 20 | <string>PPPIP</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>0</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>2</number> | 35 | <number>1</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QButtonGroup</class> | 38 | <class>QGroupBox</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>ButtonGroup4</cstring> | 41 | <cstring>GroupBox1</cstring> |
42 | </property> | ||
43 | <property stdset="1"> | ||
44 | <name>frameShape</name> | ||
45 | <enum>Box</enum> | ||
46 | </property> | 42 | </property> |
47 | <property stdset="1"> | 43 | <property stdset="1"> |
48 | <name>title</name> | 44 | <name>title</name> |
49 | <string>IP</string> | 45 | <string>IP</string> |
50 | </property> | 46 | </property> |
51 | <property> | 47 | <property> |
52 | <name>layoutMargin</name> | 48 | <name>layoutMargin</name> |
53 | </property> | 49 | </property> |
54 | <property> | 50 | <property> |
55 | <name>layoutSpacing</name> | 51 | <name>layoutSpacing</name> |
56 | </property> | 52 | </property> |
57 | <vbox> | 53 | <grid> |
58 | <property stdset="1"> | 54 | <property stdset="1"> |
59 | <name>margin</name> | 55 | <name>margin</name> |
60 | <number>2</number> | 56 | <number>3</number> |
61 | </property> | 57 | </property> |
62 | <property stdset="1"> | 58 | <property stdset="1"> |
63 | <name>spacing</name> | 59 | <name>spacing</name> |
64 | <number>2</number> | 60 | <number>2</number> |
65 | </property> | 61 | </property> |
66 | <widget> | 62 | <widget row="0" column="0" > |
67 | <class>QRadioButton</class> | 63 | <class>QLabel</class> |
68 | <property stdset="1"> | 64 | <property stdset="1"> |
69 | <name>name</name> | 65 | <name>name</name> |
70 | <cstring>IPServerAssigned_RB</cstring> | 66 | <cstring>TextLabel1</cstring> |
67 | </property> | ||
68 | <property stdset="1"> | ||
69 | <name>enabled</name> | ||
70 | <bool>true</bool> | ||
71 | </property> | 71 | </property> |
72 | <property stdset="1"> | 72 | <property stdset="1"> |
73 | <name>text</name> | 73 | <name>text</name> |
74 | <string>Server assigned</string> | 74 | <string>Local</string> |
75 | </property> | 75 | </property> |
76 | </widget> | ||
77 | <widget row="0" column="1" > | ||
78 | <class>QLineEdit</class> | ||
76 | <property stdset="1"> | 79 | <property stdset="1"> |
77 | <name>checked</name> | 80 | <name>name</name> |
81 | <cstring>LocalAddress_LE</cstring> | ||
82 | </property> | ||
83 | <property stdset="1"> | ||
84 | <name>enabled</name> | ||
78 | <bool>true</bool> | 85 | <bool>true</bool> |
79 | </property> | 86 | </property> |
80 | </widget> | 87 | </widget> |
81 | <widget> | 88 | <widget row="0" column="2" > |
82 | <class>QRadioButton</class> | 89 | <class>QCheckBox</class> |
83 | <property stdset="1"> | 90 | <property stdset="1"> |
84 | <name>name</name> | 91 | <name>name</name> |
85 | <cstring>IPFixed_RB</cstring> | 92 | <cstring>ServerOverrulesLocal_CB</cstring> |
86 | </property> | 93 | </property> |
87 | <property stdset="1"> | 94 | <property stdset="1"> |
88 | <name>text</name> | 95 | <name>text</name> |
89 | <string>Fixed</string> | 96 | <string>Server Overrules</string> |
90 | </property> | 97 | </property> |
91 | </widget> | 98 | </widget> |
92 | <widget> | 99 | <widget row="1" column="1" > |
93 | <class>QLayoutWidget</class> | 100 | <class>QLineEdit</class> |
94 | <property stdset="1"> | 101 | <property stdset="1"> |
95 | <name>name</name> | 102 | <name>name</name> |
96 | <cstring>Layout11</cstring> | 103 | <cstring>RemoteAddress_LE</cstring> |
104 | </property> | ||
105 | <property stdset="1"> | ||
106 | <name>enabled</name> | ||
107 | <bool>true</bool> | ||
97 | </property> | 108 | </property> |
98 | <hbox> | ||
99 | <property stdset="1"> | ||
100 | <name>margin</name> | ||
101 | <number>0</number> | ||
102 | </property> | ||
103 | <property stdset="1"> | ||
104 | <name>spacing</name> | ||
105 | <number>6</number> | ||
106 | </property> | ||
107 | <spacer> | ||
108 | <property> | ||
109 | <name>name</name> | ||
110 | <cstring>Spacer8</cstring> | ||
111 | </property> | ||
112 | <property stdset="1"> | ||
113 | <name>orientation</name> | ||
114 | <enum>Horizontal</enum> | ||
115 | </property> | ||
116 | <property stdset="1"> | ||
117 | <name>sizeType</name> | ||
118 | <enum>Fixed</enum> | ||
119 | </property> | ||
120 | <property> | ||
121 | <name>sizeHint</name> | ||
122 | <size> | ||
123 | <width>20</width> | ||
124 | <height>20</height> | ||
125 | </size> | ||
126 | </property> | ||
127 | <property> | ||
128 | <name>layoutMargin</name> | ||
129 | </property> | ||
130 | <property> | ||
131 | <name>layoutSpacing</name> | ||
132 | </property> | ||
133 | </spacer> | ||
134 | <widget> | ||
135 | <class>QFrame</class> | ||
136 | <property stdset="1"> | ||
137 | <name>name</name> | ||
138 | <cstring>Frame8</cstring> | ||
139 | </property> | ||
140 | <property stdset="1"> | ||
141 | <name>enabled</name> | ||
142 | <bool>false</bool> | ||
143 | </property> | ||
144 | <property stdset="1"> | ||
145 | <name>sizePolicy</name> | ||
146 | <sizepolicy> | ||
147 | <hsizetype>7</hsizetype> | ||
148 | <vsizetype>5</vsizetype> | ||
149 | </sizepolicy> | ||
150 | </property> | ||
151 | <property stdset="1"> | ||
152 | <name>frameShape</name> | ||
153 | <enum>NoFrame</enum> | ||
154 | </property> | ||
155 | <property stdset="1"> | ||
156 | <name>frameShadow</name> | ||
157 | <enum>Raised</enum> | ||
158 | </property> | ||
159 | <property> | ||
160 | <name>layoutMargin</name> | ||
161 | </property> | ||
162 | <property> | ||
163 | <name>layoutSpacing</name> | ||
164 | </property> | ||
165 | <grid> | ||
166 | <property stdset="1"> | ||
167 | <name>margin</name> | ||
168 | <number>2</number> | ||
169 | </property> | ||
170 | <property stdset="1"> | ||
171 | <name>spacing</name> | ||
172 | <number>2</number> | ||
173 | </property> | ||
174 | <widget row="0" column="1" > | ||
175 | <class>QLineEdit</class> | ||
176 | <property stdset="1"> | ||
177 | <name>name</name> | ||
178 | <cstring>IPAddress_LE</cstring> | ||
179 | </property> | ||
180 | </widget> | ||
181 | <widget row="1" column="0" > | ||
182 | <class>QLabel</class> | ||
183 | <property stdset="1"> | ||
184 | <name>name</name> | ||
185 | <cstring>TextLabel3</cstring> | ||
186 | </property> | ||
187 | <property stdset="1"> | ||
188 | <name>text</name> | ||
189 | <string>Subnetmask</string> | ||
190 | </property> | ||
191 | </widget> | ||
192 | <widget row="0" column="0" > | ||
193 | <class>QLabel</class> | ||
194 | <property stdset="1"> | ||
195 | <name>name</name> | ||
196 | <cstring>TextLabel2</cstring> | ||
197 | </property> | ||
198 | <property stdset="1"> | ||
199 | <name>text</name> | ||
200 | <string>Address</string> | ||
201 | </property> | ||
202 | </widget> | ||
203 | <widget row="1" column="1" > | ||
204 | <class>QLineEdit</class> | ||
205 | <property stdset="1"> | ||
206 | <name>name</name> | ||
207 | <cstring>IPSubMask_LE</cstring> | ||
208 | </property> | ||
209 | </widget> | ||
210 | </grid> | ||
211 | </widget> | ||
212 | </hbox> | ||
213 | </widget> | 109 | </widget> |
214 | </vbox> | 110 | <widget row="1" column="2" > |
111 | <class>QCheckBox</class> | ||
112 | <property stdset="1"> | ||
113 | <name>name</name> | ||
114 | <cstring>ServerOverrulesRemote_CB</cstring> | ||
115 | </property> | ||
116 | <property stdset="1"> | ||
117 | <name>text</name> | ||
118 | <string>Server Overrules</string> | ||
119 | </property> | ||
120 | </widget> | ||
121 | <widget row="1" column="0" > | ||
122 | <class>QLabel</class> | ||
123 | <property stdset="1"> | ||
124 | <name>name</name> | ||
125 | <cstring>TextLabel1_2</cstring> | ||
126 | </property> | ||
127 | <property stdset="1"> | ||
128 | <name>enabled</name> | ||
129 | <bool>true</bool> | ||
130 | </property> | ||
131 | <property stdset="1"> | ||
132 | <name>text</name> | ||
133 | <string>Remote</string> | ||
134 | </property> | ||
135 | </widget> | ||
136 | </grid> | ||
215 | </widget> | 137 | </widget> |
216 | <widget> | 138 | <widget> |
217 | <class>QButtonGroup</class> | 139 | <class>QButtonGroup</class> |
218 | <property stdset="1"> | 140 | <property stdset="1"> |
219 | <name>name</name> | 141 | <name>name</name> |
220 | <cstring>ButtonGroup5</cstring> | 142 | <cstring>ButtonGroup5</cstring> |
221 | </property> | 143 | </property> |
222 | <property stdset="1"> | 144 | <property stdset="1"> |
145 | <name>sizePolicy</name> | ||
146 | <sizepolicy> | ||
147 | <hsizetype>5</hsizetype> | ||
148 | <vsizetype>1</vsizetype> | ||
149 | </sizepolicy> | ||
150 | </property> | ||
151 | <property stdset="1"> | ||
223 | <name>title</name> | 152 | <name>title</name> |
224 | <string>Gateway</string> | 153 | <string>Gateway</string> |
225 | </property> | 154 | </property> |
226 | <property> | 155 | <property> |
227 | <name>layoutMargin</name> | 156 | <name>layoutMargin</name> |
228 | </property> | 157 | </property> |
229 | <property> | 158 | <property> |
230 | <name>layoutSpacing</name> | 159 | <name>layoutSpacing</name> |
231 | </property> | 160 | </property> |
232 | <vbox> | 161 | <vbox> |
233 | <property stdset="1"> | 162 | <property stdset="1"> |
234 | <name>margin</name> | 163 | <name>margin</name> |
235 | <number>2</number> | 164 | <number>3</number> |
236 | </property> | 165 | </property> |
237 | <property stdset="1"> | 166 | <property stdset="1"> |
238 | <name>spacing</name> | 167 | <name>spacing</name> |
239 | <number>2</number> | 168 | <number>2</number> |
240 | </property> | 169 | </property> |
241 | <widget> | 170 | <widget> |
242 | <class>QRadioButton</class> | 171 | <class>QRadioButton</class> |
243 | <property stdset="1"> | 172 | <property stdset="1"> |
244 | <name>name</name> | 173 | <name>name</name> |
245 | <cstring>GWServerAssigned_RB</cstring> | 174 | <cstring>GWServerAssigned_RB</cstring> |
246 | </property> | 175 | </property> |
247 | <property stdset="1"> | 176 | <property stdset="1"> |
248 | <name>text</name> | 177 | <name>text</name> |
249 | <string>Server assigned</string> | 178 | <string>Server assigned</string> |
250 | </property> | 179 | </property> |
251 | <property stdset="1"> | 180 | <property stdset="1"> |
252 | <name>checked</name> | 181 | <name>checked</name> |
253 | <bool>true</bool> | 182 | <bool>true</bool> |
254 | </property> | 183 | </property> |
255 | <property> | 184 | <property> |
256 | <name>layoutMargin</name> | 185 | <name>layoutMargin</name> |
257 | </property> | 186 | </property> |
258 | <property> | 187 | <property> |
259 | <name>layoutSpacing</name> | 188 | <name>layoutSpacing</name> |
260 | </property> | 189 | </property> |
261 | </widget> | 190 | </widget> |
262 | <widget> | 191 | <widget> |
263 | <class>QRadioButton</class> | 192 | <class>QRadioButton</class> |
264 | <property stdset="1"> | 193 | <property stdset="1"> |
265 | <name>name</name> | 194 | <name>name</name> |
266 | <cstring>GWFixed_RB</cstring> | 195 | <cstring>GWFixed_RB</cstring> |
267 | </property> | 196 | </property> |
268 | <property stdset="1"> | 197 | <property stdset="1"> |
269 | <name>text</name> | 198 | <name>text</name> |
270 | <string>Fixed</string> | 199 | <string>Fixed</string> |
271 | </property> | 200 | </property> |
272 | </widget> | 201 | </widget> |
273 | <widget> | 202 | <widget> |
274 | <class>QLayoutWidget</class> | 203 | <class>QLayoutWidget</class> |
275 | <property stdset="1"> | 204 | <property stdset="1"> |
276 | <name>name</name> | 205 | <name>name</name> |
277 | <cstring>Layout12</cstring> | 206 | <cstring>Layout12</cstring> |
278 | </property> | 207 | </property> |
279 | <property> | 208 | <property> |
280 | <name>layoutMargin</name> | 209 | <name>layoutMargin</name> |
281 | </property> | 210 | </property> |
282 | <property> | 211 | <property> |
283 | <name>layoutSpacing</name> | 212 | <name>layoutSpacing</name> |
284 | </property> | 213 | </property> |
285 | <hbox> | 214 | <hbox> |
286 | <property stdset="1"> | 215 | <property stdset="1"> |
287 | <name>margin</name> | 216 | <name>margin</name> |
288 | <number>0</number> | 217 | <number>0</number> |
289 | </property> | 218 | </property> |
290 | <property stdset="1"> | 219 | <property stdset="1"> |
291 | <name>spacing</name> | 220 | <name>spacing</name> |
292 | <number>6</number> | 221 | <number>6</number> |
293 | </property> | 222 | </property> |
294 | <spacer> | 223 | <spacer> |
295 | <property> | 224 | <property> |
296 | <name>name</name> | 225 | <name>name</name> |
297 | <cstring>Spacer9</cstring> | 226 | <cstring>Spacer9</cstring> |
298 | </property> | 227 | </property> |
299 | <property stdset="1"> | 228 | <property stdset="1"> |
300 | <name>orientation</name> | 229 | <name>orientation</name> |
301 | <enum>Horizontal</enum> | 230 | <enum>Horizontal</enum> |
302 | </property> | 231 | </property> |
303 | <property stdset="1"> | 232 | <property stdset="1"> |
304 | <name>sizeType</name> | 233 | <name>sizeType</name> |
305 | <enum>Fixed</enum> | 234 | <enum>Fixed</enum> |
306 | </property> | 235 | </property> |
307 | <property> | 236 | <property> |
308 | <name>sizeHint</name> | 237 | <name>sizeHint</name> |
309 | <size> | 238 | <size> |
310 | <width>20</width> | 239 | <width>20</width> |
311 | <height>20</height> | 240 | <height>20</height> |
312 | </size> | 241 | </size> |
313 | </property> | 242 | </property> |
314 | </spacer> | 243 | </spacer> |
315 | <widget> | 244 | <widget> |
316 | <class>QFrame</class> | 245 | <class>QFrame</class> |
317 | <property stdset="1"> | 246 | <property stdset="1"> |
318 | <name>name</name> | 247 | <name>name</name> |
319 | <cstring>Frame9</cstring> | 248 | <cstring>Frame9</cstring> |
320 | </property> | 249 | </property> |
321 | <property stdset="1"> | 250 | <property stdset="1"> |
322 | <name>enabled</name> | 251 | <name>enabled</name> |
323 | <bool>false</bool> | 252 | <bool>false</bool> |
324 | </property> | 253 | </property> |
325 | <property stdset="1"> | 254 | <property stdset="1"> |
326 | <name>sizePolicy</name> | 255 | <name>sizePolicy</name> |
327 | <sizepolicy> | 256 | <sizepolicy> |
328 | <hsizetype>7</hsizetype> | 257 | <hsizetype>7</hsizetype> |
329 | <vsizetype>5</vsizetype> | 258 | <vsizetype>5</vsizetype> |
330 | </sizepolicy> | 259 | </sizepolicy> |
331 | </property> | 260 | </property> |
332 | <property stdset="1"> | 261 | <property stdset="1"> |
333 | <name>frameShape</name> | 262 | <name>frameShape</name> |
334 | <enum>NoFrame</enum> | 263 | <enum>NoFrame</enum> |
335 | </property> | 264 | </property> |
336 | <property stdset="1"> | 265 | <property stdset="1"> |
337 | <name>frameShadow</name> | 266 | <name>frameShadow</name> |
338 | <enum>Raised</enum> | 267 | <enum>Raised</enum> |
339 | </property> | 268 | </property> |
340 | <property> | 269 | <property> |
341 | <name>layoutMargin</name> | 270 | <name>layoutMargin</name> |
342 | </property> | 271 | </property> |
343 | <property> | 272 | <property> |
344 | <name>layoutSpacing</name> | 273 | <name>layoutSpacing</name> |
345 | </property> | 274 | </property> |
346 | <grid> | 275 | <grid> |
347 | <property stdset="1"> | 276 | <property stdset="1"> |
348 | <name>margin</name> | 277 | <name>margin</name> |
349 | <number>2</number> | 278 | <number>2</number> |
350 | </property> | 279 | </property> |
351 | <property stdset="1"> | 280 | <property stdset="1"> |
352 | <name>spacing</name> | 281 | <name>spacing</name> |
353 | <number>2</number> | 282 | <number>2</number> |
354 | </property> | 283 | </property> |
355 | <widget row="0" column="0" > | 284 | <widget row="0" column="0" > |
356 | <class>QLabel</class> | 285 | <class>QLabel</class> |
357 | <property stdset="1"> | 286 | <property stdset="1"> |
358 | <name>name</name> | 287 | <name>name</name> |
359 | <cstring>TextLabel4</cstring> | 288 | <cstring>TextLabel4</cstring> |
360 | </property> | 289 | </property> |
361 | <property stdset="1"> | 290 | <property stdset="1"> |
362 | <name>text</name> | 291 | <name>text</name> |
363 | <string>Address</string> | 292 | <string>Address</string> |
364 | </property> | 293 | </property> |
365 | </widget> | 294 | </widget> |
366 | <widget row="0" column="1" > | 295 | <widget row="0" column="1" > |
367 | <class>QLineEdit</class> | 296 | <class>QLineEdit</class> |
368 | <property stdset="1"> | 297 | <property stdset="1"> |
369 | <name>name</name> | 298 | <name>name</name> |
370 | <cstring>GWAddress_LE</cstring> | 299 | <cstring>GWAddress_LE</cstring> |
371 | </property> | 300 | </property> |
372 | </widget> | 301 | </widget> |
373 | </grid> | 302 | </grid> |
374 | </widget> | 303 | </widget> |
375 | </hbox> | 304 | </hbox> |
376 | </widget> | 305 | </widget> |
377 | <widget> | 306 | <widget> |
378 | <class>QLayoutWidget</class> | 307 | <class>QLayoutWidget</class> |
379 | <property stdset="1"> | 308 | <property stdset="1"> |
380 | <name>name</name> | 309 | <name>name</name> |
381 | <cstring>Layout3</cstring> | 310 | <cstring>Layout4</cstring> |
382 | </property> | 311 | </property> |
383 | <hbox> | 312 | <hbox> |
384 | <property stdset="1"> | 313 | <property stdset="1"> |
385 | <name>margin</name> | 314 | <name>margin</name> |
386 | <number>0</number> | 315 | <number>0</number> |
387 | </property> | 316 | </property> |
388 | <property stdset="1"> | 317 | <property stdset="1"> |
389 | <name>spacing</name> | 318 | <name>spacing</name> |
390 | <number>6</number> | 319 | <number>6</number> |
391 | </property> | 320 | </property> |
321 | <widget> | ||
322 | <class>QCheckBox</class> | ||
323 | <property stdset="1"> | ||
324 | <name>name</name> | ||
325 | <cstring>GWIsDefault_CB</cstring> | ||
326 | </property> | ||
327 | <property stdset="1"> | ||
328 | <name>text</name> | ||
329 | <string>Set as default</string> | ||
330 | </property> | ||
331 | </widget> | ||
392 | <spacer> | 332 | <spacer> |
393 | <property> | 333 | <property> |
394 | <name>name</name> | 334 | <name>name</name> |
395 | <cstring>Spacer3</cstring> | 335 | <cstring>Spacer3</cstring> |
396 | </property> | 336 | </property> |
397 | <property stdset="1"> | 337 | <property stdset="1"> |
398 | <name>orientation</name> | 338 | <name>orientation</name> |
399 | <enum>Horizontal</enum> | 339 | <enum>Horizontal</enum> |
400 | </property> | 340 | </property> |
401 | <property stdset="1"> | 341 | <property stdset="1"> |
402 | <name>sizeType</name> | 342 | <name>sizeType</name> |
403 | <enum>Expanding</enum> | 343 | <enum>Expanding</enum> |
404 | </property> | 344 | </property> |
405 | <property> | 345 | <property> |
406 | <name>sizeHint</name> | 346 | <name>sizeHint</name> |
407 | <size> | 347 | <size> |
408 | <width>20</width> | 348 | <width>20</width> |
409 | <height>20</height> | 349 | <height>20</height> |
410 | </size> | 350 | </size> |
411 | </property> | 351 | </property> |
412 | </spacer> | 352 | </spacer> |
413 | <widget> | 353 | <widget> |
414 | <class>QCheckBox</class> | 354 | <class>QCheckBox</class> |
415 | <property stdset="1"> | 355 | <property stdset="1"> |
416 | <name>name</name> | 356 | <name>name</name> |
417 | <cstring>GWIsDefault_CB</cstring> | 357 | <cstring>GWIfNotSet_CB</cstring> |
418 | </property> | 358 | </property> |
419 | <property stdset="1"> | 359 | <property stdset="1"> |
420 | <name>text</name> | 360 | <name>text</name> |
421 | <string>Set as default</string> | 361 | <string>Only if not yet set</string> |
422 | </property> | 362 | </property> |
423 | </widget> | 363 | </widget> |
424 | </hbox> | 364 | </hbox> |
425 | </widget> | 365 | </widget> |
426 | </vbox> | 366 | </vbox> |
427 | </widget> | 367 | </widget> |
368 | <spacer> | ||
369 | <property> | ||
370 | <name>name</name> | ||
371 | <cstring>Spacer4</cstring> | ||
372 | </property> | ||
373 | <property stdset="1"> | ||
374 | <name>orientation</name> | ||
375 | <enum>Vertical</enum> | ||
376 | </property> | ||
377 | <property stdset="1"> | ||
378 | <name>sizeType</name> | ||
379 | <enum>Expanding</enum> | ||
380 | </property> | ||
381 | <property> | ||
382 | <name>sizeHint</name> | ||
383 | <size> | ||
384 | <width>20</width> | ||
385 | <height>20</height> | ||
386 | </size> | ||
387 | </property> | ||
388 | </spacer> | ||
428 | </vbox> | 389 | </vbox> |
429 | </widget> | 390 | </widget> |
430 | <connections> | 391 | <connections> |
431 | <connection> | 392 | <connection> |
432 | <sender>GWFixed_RB</sender> | 393 | <sender>GWFixed_RB</sender> |
433 | <signal>toggled(bool)</signal> | 394 | <signal>toggled(bool)</signal> |
434 | <receiver>Frame9</receiver> | 395 | <receiver>Frame9</receiver> |
435 | <slot>setEnabled(bool)</slot> | 396 | <slot>setEnabled(bool)</slot> |
436 | </connection> | 397 | </connection> |
437 | <connection> | ||
438 | <sender>IPFixed_RB</sender> | ||
439 | <signal>toggled(bool)</signal> | ||
440 | <receiver>Frame8</receiver> | ||
441 | <slot>setEnabled(bool)</slot> | ||
442 | </connection> | ||
443 | </connections> | 398 | </connections> |
444 | </UI> | 399 | </UI> |
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 | |||
@@ -1,57 +1,54 @@ | |||
1 | #include <qmessagebox.h> | 1 | #include <qmessagebox.h> |
2 | #include <qcheckbox.h> | 2 | #include <qcheckbox.h> |
3 | #include <qradiobutton.h> | 3 | #include <qradiobutton.h> |
4 | #include <qlineedit.h> | 4 | #include <qlineedit.h> |
5 | #include <GUIUtils.h> | 5 | #include <GUIUtils.h> |
6 | #include "PPPIPedit.h" | 6 | #include "PPPIPedit.h" |
7 | 7 | ||
8 | PPPIPEdit::PPPIPEdit( QWidget * Parent ) : PPPIPGUI( Parent ){ | 8 | PPPIPEdit::PPPIPEdit( QWidget * Parent ) : PPPIPGUI( Parent ){ |
9 | } | 9 | } |
10 | 10 | ||
11 | QString PPPIPEdit::acceptable( void ) { | 11 | QString 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() ) ) |
25 | return tr("Gateway address not valid" ); | 16 | return tr("Gateway address not valid" ); |
26 | }; | 17 | }; |
27 | 18 | ||
28 | return QString(); | 19 | return QString(); |
29 | } | 20 | } |
30 | 21 | ||
31 | bool PPPIPEdit::commit( PPPData_t & D ) { | 22 | bool 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 | ||
50 | void PPPIPEdit::showData( PPPData_t & D ) { | 44 | void 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 | } |
diff --git a/noncore/settings/networksettings2/ppp/PPPIPedit.h b/noncore/settings/networksettings2/ppp/PPPIPedit.h index 153ee68..5ca4326 100644 --- a/noncore/settings/networksettings2/ppp/PPPIPedit.h +++ b/noncore/settings/networksettings2/ppp/PPPIPedit.h | |||
@@ -1,15 +1,15 @@ | |||
1 | #include "pppdata.h" | 1 | #include "pppdata.h" |
2 | #include "PPPIPGUI.h" | 2 | #include "PPPIPGUI.h" |
3 | 3 | ||
4 | class PPPIPEdit : public PPPIPGUI { | 4 | class PPPIPEdit : public PPPIPGUI { |
5 | 5 | ||
6 | public : | 6 | public : |
7 | 7 | ||
8 | PPPIPEdit( QWidget * parent ); | 8 | PPPIPEdit( QWidget * parent ); |
9 | QString acceptable( void ); | 9 | QString acceptable( void ); |
10 | bool commit( PPPData_t & Data ); | 10 | bool commit( PPPData & Data ); |
11 | void showData( PPPData_t & Data ); | 11 | void showData( PPPData & Data ); |
12 | 12 | ||
13 | private : | 13 | private : |
14 | 14 | ||
15 | }; | 15 | }; |
diff --git a/noncore/settings/networksettings2/ppp/PPPedit.cpp b/noncore/settings/networksettings2/ppp/PPPedit.cpp index eb4fdbf..17889aa 100644 --- a/noncore/settings/networksettings2/ppp/PPPedit.cpp +++ b/noncore/settings/networksettings2/ppp/PPPedit.cpp | |||
@@ -1,48 +1,55 @@ | |||
1 | #include <qwidgetstack.h> | 1 | #include <qwidgetstack.h> |
2 | 2 | ||
3 | #include "PPPIPedit.h" | 3 | #include "PPPIPedit.h" |
4 | #include "PPPDNSedit.h" | 4 | #include "PPPDNSedit.h" |
5 | #include "PPPAuthedit.h" | 5 | #include "PPPAuthedit.h" |
6 | #include "PPPRunedit.h" | ||
7 | #include "PPPDialingedit.h" | ||
6 | #include "PPPedit.h" | 8 | #include "PPPedit.h" |
7 | 9 | ||
8 | PPPEdit::PPPEdit( QWidget * Parent ) : PPPGUI( Parent ){ | 10 | PPPEdit::PPPEdit( QWidget * Parent ) : PPPGUI( Parent ){ |
9 | 11 | ||
10 | Auth = new PPPAuthEdit( Options_WS ); | 12 | Auth = new PPPAuthEdit( Options_WS ); |
11 | IP = new PPPIPEdit( Options_WS ); | 13 | IP = new PPPIPEdit( Options_WS ); |
12 | DNS = new PPPDNSEdit( Options_WS ); | 14 | DNS = new PPPDNSEdit( Options_WS ); |
15 | Run = new PPPRunEdit( Options_WS ); | ||
16 | Dialing = new PPPDialingEdit( Options_WS ); | ||
17 | |||
13 | Options_WS->addWidget( Auth, 0 ); | 18 | Options_WS->addWidget( Auth, 0 ); |
14 | Options_WS->addWidget( IP, 1 ); | 19 | Options_WS->addWidget( IP, 1 ); |
15 | Options_WS->addWidget( DNS, 2 ); | 20 | Options_WS->addWidget( DNS, 2 ); |
21 | Options_WS->addWidget( Run, 3 ); | ||
22 | Options_WS->addWidget( Dialing, 4 ); | ||
16 | 23 | ||
17 | Options_WS->raiseWidget( 0 ); | 24 | Options_WS->raiseWidget( 0 ); |
18 | } | 25 | } |
19 | 26 | ||
20 | QString PPPEdit::acceptable( void ) { | 27 | QString PPPEdit::acceptable( void ) { |
21 | QString S; | 28 | QString S; |
22 | S = Auth->acceptable(); | 29 | S = Auth->acceptable(); |
23 | if( S.isEmpty() ) { | 30 | if( S.isEmpty() ) { |
24 | S = IP->acceptable(); | 31 | S = IP->acceptable(); |
25 | if( S.isEmpty() ) { | 32 | if( S.isEmpty() ) { |
26 | S = DNS->acceptable(); | 33 | S = DNS->acceptable(); |
27 | } | 34 | } |
28 | } | 35 | } |
29 | return S; | 36 | return S; |
30 | } | 37 | } |
31 | 38 | ||
32 | bool PPPEdit::commit( PPPData_t & Data ) { | 39 | bool PPPEdit::commit( PPPData & Data ) { |
33 | bool SM ; | 40 | bool SM ; |
34 | SM = Auth->commit( Data ); | 41 | SM = Auth->commit( Data ); |
35 | SM |= IP->commit( Data ); | 42 | SM |= IP->commit( Data ); |
36 | SM |= DNS->commit( Data ); | 43 | SM |= DNS->commit( Data ); |
37 | return SM; | 44 | return SM; |
38 | } | 45 | } |
39 | 46 | ||
40 | void PPPEdit::showData( PPPData_t & Data ) { | 47 | void PPPEdit::showData( PPPData & Data ) { |
41 | Auth->showData( Data ) ; | 48 | Auth->showData( Data ) ; |
42 | IP->showData( Data ); | 49 | IP->showData( Data ); |
43 | DNS->showData( Data ); | 50 | DNS->showData( Data ); |
44 | } | 51 | } |
45 | 52 | ||
46 | void PPPEdit::SLOT_SelectTopic( int v ) { | 53 | void PPPEdit::SLOT_SelectTopic( int v ) { |
47 | Options_WS->raiseWidget( v ); | 54 | Options_WS->raiseWidget( v ); |
48 | } | 55 | } |
diff --git a/noncore/settings/networksettings2/ppp/PPPedit.h b/noncore/settings/networksettings2/ppp/PPPedit.h index 57d38ee..f674b17 100644 --- a/noncore/settings/networksettings2/ppp/PPPedit.h +++ b/noncore/settings/networksettings2/ppp/PPPedit.h | |||
@@ -1,27 +1,31 @@ | |||
1 | #include "pppdata.h" | 1 | #include "pppdata.h" |
2 | #include "PPPGUI.h" | 2 | #include "PPPGUI.h" |
3 | 3 | ||
4 | class PPPAuthEdit; | 4 | class PPPAuthEdit; |
5 | class PPPIPEdit; | 5 | class PPPIPEdit; |
6 | class PPPDNSEdit; | 6 | class PPPDNSEdit; |
7 | class PPPRunEdit; | ||
8 | class PPPDialingEdit; | ||
7 | 9 | ||
8 | class PPPEdit : public PPPGUI { | 10 | class PPPEdit : public PPPGUI { |
9 | 11 | ||
10 | public : | 12 | public : |
11 | 13 | ||
12 | PPPEdit( QWidget * parent ); | 14 | PPPEdit( QWidget * parent ); |
13 | QString acceptable( void ); | 15 | QString acceptable( void ); |
14 | bool commit( PPPData_t & Data ); | 16 | bool commit( PPPData & Data ); |
15 | void showData( PPPData_t & Data ); | 17 | void showData( PPPData & Data ); |
16 | 18 | ||
17 | public slots : | 19 | public slots : |
18 | 20 | ||
19 | void SLOT_SelectTopic( int ); | 21 | void SLOT_SelectTopic( int ); |
20 | 22 | ||
21 | private : | 23 | private : |
22 | 24 | ||
23 | PPPAuthEdit * Auth; | 25 | PPPAuthEdit * Auth; |
24 | PPPDNSEdit * DNS; | 26 | PPPDNSEdit * DNS; |
25 | PPPIPEdit * IP; | 27 | PPPIPEdit * IP; |
28 | PPPRunEdit * Run; | ||
29 | PPPDialingEdit * Dialing; | ||
26 | 30 | ||
27 | }; | 31 | }; |
diff --git a/noncore/settings/networksettings2/ppp/opie-networksettings2plugin-ppp.control b/noncore/settings/networksettings2/ppp/opie-networksettings2plugin-ppp.control index 7dfde38..19d1c89 100644 --- a/noncore/settings/networksettings2/ppp/opie-networksettings2plugin-ppp.control +++ b/noncore/settings/networksettings2/ppp/opie-networksettings2plugin-ppp.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Package: opie-networksettingsplugin2-ppp | 1 | Package: opie-networksettings2plugin-ppp |
2 | Files: plugins/networksettings2/libppp.so* | 2 | Files: plugins/networksettings2/libppp.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/settings | 4 | Section: opie/settings |
5 | Maintainer: Wim Delvaux <wimpie@handhelds.org> | 5 | Maintainer: Wim Delvaux <wimpie@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: opie-networksettings2, libopiecore2, libopienet2 | 7 | Depends: opie-networksettings2, libopiecore2, libopienet2 |
8 | Description: Network settings ppp plugin. | 8 | Description: Network settings ppp plugin. |
9 | Version: $QPE_VERSION$EXTRAVERSION | 9 | Version: $QPE_VERSION$EXTRAVERSION |
diff --git a/noncore/settings/networksettings2/ppp/ppp.pro b/noncore/settings/networksettings2/ppp/ppp.pro index f866bee..dd3408c 100644 --- a/noncore/settings/networksettings2/ppp/ppp.pro +++ b/noncore/settings/networksettings2/ppp/ppp.pro | |||
@@ -1,24 +1,33 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on release | 2 | CONFIG += qt warn_on release |
3 | DESTDIR = $(OPIEDIR)/plugins/networksettings2 | 3 | DESTDIR = $(OPIEDIR)/plugins/networksettings2 |
4 | HEADERS = ppp_NN.h \ | 4 | HEADERS = ppp_NN.h \ |
5 | ppp_NNI.h \ | 5 | ppp_NNI.h \ |
6 | PPPedit.h \ | 6 | PPPedit.h \ |
7 | PPPAuthedit.h \ | 7 | PPPAuthedit.h \ |
8 | PPPDNSedit.h \ | 8 | PPPDNSedit.h \ |
9 | PPPRunedit.h \ | ||
10 | PPPDialingedit.h \ | ||
9 | PPPIPedit.h | 11 | PPPIPedit.h |
10 | SOURCES = ppp_NN.cpp \ | 12 | SOURCES = ppp_NN.cpp \ |
11 | ppp_NNI.cpp \ | 13 | ppp_NNI.cpp \ |
12 | PPPedit.cpp \ | 14 | PPPedit.cpp \ |
13 | PPPDNSedit.cpp \ | 15 | PPPDNSedit.cpp \ |
16 | PPPRunedit.cpp \ | ||
17 | PPPDialingedit.cpp \ | ||
14 | PPPAuthedit.cpp \ | 18 | PPPAuthedit.cpp \ |
15 | ppprun.cpp \ | 19 | ppprun.cpp \ |
16 | PPPIPedit.cpp | 20 | PPPIPedit.cpp |
17 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../networksettings2 | 21 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../networksettings2 |
18 | DEPENDPATH+= $(OPIEDIR)/include ../ ../networksettings2 | 22 | DEPENDPATH+= $(OPIEDIR)/include ../ ../networksettings2 |
19 | LIBS += -lqpe | 23 | LIBS += -lqpe |
20 | INTERFACES= PPPGUI.ui PPPAuthGUI.ui PPPIPGUI.ui PPPDNSGUI.ui | 24 | INTERFACES= PPPGUI.ui \ |
25 | PPPAuthGUI.ui \ | ||
26 | PPPIPGUI.ui \ | ||
27 | PPPDNSGUI.ui \ | ||
28 | PPPDialingGUI.ui \ | ||
29 | PPPRunGUI.ui | ||
21 | TARGET = ppp | 30 | TARGET = ppp |
22 | VERSION = 1.0.0 | 31 | VERSION = 1.0.0 |
23 | 32 | ||
24 | include( $(OPIEDIR)/include.pro ) | 33 | include( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp index ff4465c..51ba27d 100644 --- a/noncore/settings/networksettings2/ppp/ppp_NN.cpp +++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp | |||
@@ -1,85 +1,85 @@ | |||
1 | #include <qfile.h> | 1 | #include <qfile.h> |
2 | #include <resources.h> | ||
2 | #include <qtextstream.h> | 3 | #include <qtextstream.h> |
3 | #include "ppp_NN.h" | 4 | #include "ppp_NN.h" |
4 | #include "ppp_NNI.h" | 5 | #include "ppp_NNI.h" |
5 | 6 | ||
6 | QStringList * PPPNetNode::ProperFiles = 0; | 7 | QStringList * PPPNetNode::ProperFiles = 0; |
7 | 8 | ||
8 | static const char * PPPNeeds[] = | 9 | static const char * PPPNeeds[] = |
9 | { "line", | 10 | { "modem", |
10 | "modem", | 11 | 0 |
12 | }; | ||
13 | |||
14 | static const char * PPPProvides[] = | ||
15 | { "connection", | ||
11 | 0 | 16 | 0 |
12 | }; | 17 | }; |
13 | 18 | ||
14 | /** | 19 | /** |
15 | * Constructor, find all of the possible interfaces | 20 | * Constructor, find all of the possible interfaces |
16 | */ | 21 | */ |
17 | PPPNetNode::PPPNetNode() : ANetNode(tr("PPP Connection")) { | 22 | PPPNetNode::PPPNetNode() : ANetNode(tr("PPP Connection")) { |
18 | 23 | ||
19 | // proper files : will leak | ||
20 | ProperFiles =new QStringList; | ||
21 | *ProperFiles << "peers"; | ||
22 | *ProperFiles << "chatscript"; | ||
23 | |||
24 | // system files | ||
25 | NSResources->addSystemFile( | 24 | NSResources->addSystemFile( |
26 | "pap-secrets", "/tmp/pap-secrets", 0 ); | 25 | "pap-secrets", "/etc/ppp/pap-secrets", 0 ); |
27 | NSResources->addSystemFile( | 26 | NSResources->addSystemFile( |
28 | "chap-secrets", "/tmp/chap-secrets", 0 ); | 27 | "chap-secrets", "/etc/ppp/chap-secrets", 0 ); |
29 | } | 28 | } |
30 | 29 | ||
31 | /** | 30 | /** |
32 | * Delete any interfaces that we own. | 31 | * Delete any interfaces that we own. |
33 | */ | 32 | */ |
34 | PPPNetNode::~PPPNetNode(){ | 33 | PPPNetNode::~PPPNetNode(){ |
35 | } | 34 | } |
36 | 35 | ||
37 | const QString PPPNetNode::nodeDescription(){ | 36 | const QString PPPNetNode::nodeDescription(){ |
38 | return tr("\ | 37 | return tr("\ |
39 | <p>Sets up IP using PPP.</p>\ | 38 | <p>Sets up IP using PPP.</p>\ |
40 | <p>Use this for dialup devices or serial setups</p>\ | 39 | <p>Use this for dialup devices or serial setups</p>\ |
41 | " | 40 | " |
42 | ); | 41 | ); |
43 | } | 42 | } |
44 | 43 | ||
45 | ANetNodeInstance * PPPNetNode::createInstance( void ) { | 44 | ANetNodeInstance * PPPNetNode::createInstance( void ) { |
46 | return new APPP( this ); | 45 | return new APPP( this ); |
47 | } | 46 | } |
48 | 47 | ||
49 | const char ** PPPNetNode::needs( void ) { | 48 | const char ** PPPNetNode::needs( void ) { |
50 | return PPPNeeds; | 49 | return PPPNeeds; |
51 | } | 50 | } |
52 | 51 | ||
53 | const char * PPPNetNode::provides( void ) { | 52 | const char ** PPPNetNode::provides( void ) { |
54 | return "connection"; | 53 | return PPPProvides; |
55 | } | 54 | } |
56 | 55 | ||
57 | QStringList * PPPNetNode::properFiles( void ) { | 56 | QStringList PPPNetNode::properFiles( void ) { |
58 | return ProperFiles; | 57 | QStringList SL; |
59 | 58 | SL << "peers" << "chatscripts"; | |
59 | return SL; | ||
60 | } | 60 | } |
61 | 61 | ||
62 | // need to generate : | 62 | // need to generate : |
63 | // /etc/ppp/pap-secrets | 63 | // /etc/ppp/pap-secrets |
64 | // /etc/ppp/pap-secrets | 64 | // /etc/ppp/pap-secrets |
65 | bool PPPNetNode::hasDataForFile( const QString & S ) { | 65 | bool PPPNetNode::hasDataForFile( SystemFile & S ) { |
66 | return S == "pap-secrets" || | 66 | return S.name() == "pap-secrets" || |
67 | S == "chap-secrets" ; | 67 | S.name() == "chap-secrets" ; |
68 | } | 68 | } |
69 | 69 | ||
70 | QString PPPNetNode::genNic( long NicNr ) { | 70 | QString PPPNetNode::genNic( long NicNr ) { |
71 | QString S; | 71 | QString S; |
72 | return S.sprintf( "ppp%ld", NicNr ); | 72 | return S.sprintf( "ppp%ld", NicNr ); |
73 | } | 73 | } |
74 | 74 | ||
75 | void PPPNetNode::setSpecificAttribute( QString & , QString & ) { | 75 | void PPPNetNode::setSpecificAttribute( QString & , QString & ) { |
76 | } | 76 | } |
77 | 77 | ||
78 | void PPPNetNode::saveSpecificAttribute( QTextStream & ) { | 78 | void PPPNetNode::saveSpecificAttribute( QTextStream & ) { |
79 | } | 79 | } |
80 | 80 | ||
81 | extern "C" { | 81 | extern "C" { |
82 | void create_plugin( QList<ANetNode> & PNN ) { | 82 | void create_plugin( QList<ANetNode> & PNN ) { |
83 | PNN.append( new PPPNetNode() ); | 83 | PNN.append( new PPPNetNode() ); |
84 | } | 84 | } |
85 | } | 85 | } |
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h index 249be5a..3ead10e 100644 --- a/noncore/settings/networksettings2/ppp/ppp_NN.h +++ b/noncore/settings/networksettings2/ppp/ppp_NN.h | |||
@@ -1,43 +1,43 @@ | |||
1 | #ifndef PPP_NETNODE_H | 1 | #ifndef PPP_NETNODE_H |
2 | #define PPP_NETNODE_H | 2 | #define PPP_NETNODE_H |
3 | 3 | ||
4 | #include "netnode.h" | 4 | #include "netnode.h" |
5 | 5 | ||
6 | class APPP; | 6 | class APPP; |
7 | 7 | ||
8 | class PPPNetNode : public ANetNode{ | 8 | class PPPNetNode : public ANetNode{ |
9 | 9 | ||
10 | Q_OBJECT | 10 | Q_OBJECT |
11 | 11 | ||
12 | public: | 12 | public: |
13 | 13 | ||
14 | PPPNetNode(); | 14 | PPPNetNode(); |
15 | virtual ~PPPNetNode(); | 15 | virtual ~PPPNetNode(); |
16 | 16 | ||
17 | virtual const QString pixmapName() | 17 | virtual const QString pixmapName() |
18 | { return "Devices/ppp"; } | 18 | { return "Devices/ppp"; } |
19 | 19 | ||
20 | virtual bool hasDataForFile( const QString & S ); | 20 | virtual bool hasDataForFile( SystemFile & S ); |
21 | 21 | ||
22 | virtual const QString nodeDescription() ; | 22 | virtual const QString nodeDescription() ; |
23 | virtual ANetNodeInstance * createInstance( void ); | 23 | virtual ANetNodeInstance * createInstance( void ); |
24 | virtual const char ** needs( void ); | 24 | virtual const char ** needs( void ); |
25 | virtual const char * provides( void ); | 25 | virtual const char ** provides( void ); |
26 | 26 | ||
27 | virtual QString genNic( long NicNr ); | 27 | virtual QString genNic( long NicNr ); |
28 | virtual QStringList * properFiles( void ); | 28 | virtual QStringList properFiles( void ); |
29 | 29 | ||
30 | private: | 30 | private: |
31 | 31 | ||
32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 32 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
33 | virtual void saveSpecificAttribute( QTextStream & TS ); | 33 | virtual void saveSpecificAttribute( QTextStream & TS ); |
34 | 34 | ||
35 | static QStringList * ProperFiles; | 35 | static QStringList * ProperFiles; |
36 | }; | 36 | }; |
37 | 37 | ||
38 | extern "C" | 38 | extern "C" |
39 | { | 39 | { |
40 | void create_plugin( QList<ANetNode> & PNN ); | 40 | void create_plugin( QList<ANetNode> & PNN ); |
41 | }; | 41 | }; |
42 | 42 | ||
43 | #endif | 43 | #endif |
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp index ba639de..9e3bb64 100644 --- a/noncore/settings/networksettings2/ppp/ppp_NNI.cpp +++ b/noncore/settings/networksettings2/ppp/ppp_NNI.cpp | |||
@@ -1,221 +1,235 @@ | |||
1 | #include <qfile.h> | 1 | #include <qfile.h> |
2 | #include <qfileinfo.h> | 2 | #include <qfileinfo.h> |
3 | #include "PPPedit.h" | 3 | #include "PPPedit.h" |
4 | #include "ppp_NNI.h" | 4 | #include "ppp_NNI.h" |
5 | #include "ppp_NN.h" | 5 | #include "ppp_NN.h" |
6 | 6 | ||
7 | APPP::APPP( PPPNetNode * PNN ) : ANetNodeInstance( PNN ) { | 7 | APPP::APPP( PPPNetNode * PNN ) : ANetNodeInstance( PNN ) { |
8 | Data.DNS.ServerAssigned = 1; | 8 | Data.DNS.ServerAssigned = 1; |
9 | Data.DNS.DomainName = ""; | 9 | Data.DNS.DomainName = ""; |
10 | 10 | ||
11 | Data.Auth.Mode = 0; | 11 | Data.Auth.Mode = 0; |
12 | Data.Auth.Login.Expect = "ogin:"; | 12 | Data.Auth.Login.Expect = "ogin:"; |
13 | Data.Auth.Password.Expect = "assword:"; | 13 | Data.Auth.Password.Expect = "assword:"; |
14 | Data.Auth.PCEMode = 0; | 14 | Data.Auth.PCEMode = 0; |
15 | Data.Auth.Client = "*"; | 15 | Data.Auth.Client = "*"; |
16 | Data.Auth.Server = "*"; | 16 | Data.Auth.Server = "*"; |
17 | Data.Auth.Secret = ""; | 17 | Data.Auth.Secret = ""; |
18 | 18 | ||
19 | Data.IP.IPAutomatic = 1; | 19 | Data.IP.LocalAddress = "10.0.0.1"; |
20 | Data.IP.IPAddress = ""; | 20 | Data.IP.RemoteAddress = "10.0.0.2"; |
21 | Data.IP.IPSubMask = ""; | 21 | Data.IP.LocalOverrule = 1; |
22 | Data.IP.RemoteOverrule = 1; | ||
23 | |||
22 | Data.IP.GWAutomatic = 1; | 24 | Data.IP.GWAutomatic = 1; |
23 | Data.IP.GWAddress = ""; | 25 | Data.IP.GWAddress = ""; |
24 | Data.IP.GWIsDefault = 1; | 26 | Data.IP.GWIsDefault = 1; |
27 | Data.IP.GWIfNotSet = 1; | ||
28 | |||
29 | Data.Run.PreConnect = ""; | ||
30 | Data.Run.PostConnect = ""; | ||
31 | Data.Run.PreDisconnect = ""; | ||
32 | Data.Run.PostDisconnect = ""; | ||
33 | |||
25 | GUI = 0; | 34 | GUI = 0; |
26 | RT = 0; | 35 | RT = 0; |
27 | 36 | ||
28 | } | 37 | } |
29 | 38 | ||
30 | void APPP::setSpecificAttribute( QString & A, QString & V ) { | 39 | void APPP::setSpecificAttribute( QString & A, QString & V ) { |
31 | if( A.startsWith( "dns" ) ) { | 40 | if( A.startsWith( "dns" ) ) { |
32 | if( A == "dnsserverassigned" ) { | 41 | if( A == "dnsserverassigned" ) { |
33 | Data.DNS.ServerAssigned = (V == "yes"); | 42 | Data.DNS.ServerAssigned = (V == "yes"); |
34 | } else if( A == "dnsdomainname" ) { | 43 | } else if( A == "dnsdomainname" ) { |
35 | Data.DNS.DomainName = V; | 44 | Data.DNS.DomainName = V; |
36 | } else if( A == "dnsserver" ) { | 45 | } else if( A == "dnsserver" ) { |
37 | Data.DNS.Servers.resize( Data.DNS.Servers.size()+1 ); | 46 | Data.DNS.Servers.resize( Data.DNS.Servers.size()+1 ); |
38 | Data.DNS.Servers[Data.DNS.Servers.size()-1] = | 47 | Data.DNS.Servers[Data.DNS.Servers.size()-1] = |
39 | new QString( V ); | 48 | new QString( V ); |
40 | } | 49 | } |
41 | } else if( A.startsWith( "auth" ) ) { | 50 | } else if( A.startsWith( "auth" ) ) { |
42 | if( A == "authmode" ) { | 51 | if( A == "authmode" ) { |
43 | Data.Auth.Mode = V.toShort(); | 52 | Data.Auth.Mode = V.toShort(); |
44 | } else if( A == "authloginexpect" ) { | 53 | } else if( A == "authloginexpect" ) { |
45 | Data.Auth.Login.Expect = V; | 54 | Data.Auth.Login.Expect = V; |
46 | } else if( A == "authloginsend" ) { | 55 | } else if( A == "authloginsend" ) { |
47 | Data.Auth.Login.Send = V; | 56 | Data.Auth.Login.Send = V; |
48 | } else if( A == "authpasswordexpect" ) { | 57 | } else if( A == "authpasswordexpect" ) { |
49 | Data.Auth.Password.Expect = V; | 58 | Data.Auth.Password.Expect = V; |
50 | } else if( A == "authpasswordsend" ) { | 59 | } else if( A == "authpasswordsend" ) { |
51 | Data.Auth.Password.Send = V; | 60 | Data.Auth.Password.Send = V; |
52 | } else if( A == "authpcemode" ) { | 61 | } else if( A == "authpcemode" ) { |
53 | Data.Auth.PCEMode = V.toShort(); | 62 | Data.Auth.PCEMode = V.toShort(); |
54 | } else if( A == "authclient" ) { | 63 | } else if( A == "authclient" ) { |
55 | Data.Auth.Client = V; | 64 | Data.Auth.Client = V; |
56 | } else if( A == "authserver" ) { | 65 | } else if( A == "authserver" ) { |
57 | Data.Auth.Server = V; | 66 | Data.Auth.Server = V; |
58 | } else if( A == "authsecret" ) { | 67 | } else if( A == "authsecret" ) { |
59 | Data.Auth.Secret = V; | 68 | Data.Auth.Secret = V; |
60 | } | 69 | } |
61 | } else if( A.startsWith( "ip" ) ) { | 70 | } else if( A.startsWith( "ip" ) ) { |
62 | if( A == "ipautomatic" ) { | 71 | if( A == "iplocaloverrule" ) { |
63 | Data.IP.IPAutomatic = (V == "yes"); | 72 | Data.IP.LocalOverrule = (V == "yes"); |
64 | } else if( A == "gwautomatic" ) { | 73 | } else if( A == "ipremoteoverrule" ) { |
74 | Data.IP.RemoteOverrule = (V == "yes"); | ||
75 | } else if( A == "ipgwautomatic" ) { | ||
65 | Data.IP.GWAutomatic = (V == "yes"); | 76 | Data.IP.GWAutomatic = (V == "yes"); |
66 | } else if( A == "gwisdefault" ) { | 77 | } else if( A == "ipgwisdefault" ) { |
67 | Data.IP.GWIsDefault = (V == "yes"); | 78 | Data.IP.GWIsDefault = (V == "yes"); |
68 | } else if( A == "ipaddress" ) { | 79 | } else if( A == "ipgwifnotset" ) { |
69 | Data.IP.IPAddress = V; | 80 | Data.IP.GWIfNotSet = (V == "yes"); |
70 | } else if( A == "ipsubmask" ) { | 81 | } else if( A == "iplocaladdress" ) { |
71 | Data.IP.IPSubMask = V; | 82 | Data.IP.LocalAddress = V; |
72 | } else if( A == "gwaddress" ) { | 83 | } else if( A == "ipremoteaddress" ) { |
84 | Data.IP.RemoteAddress = V; | ||
85 | } else if( A == "ipgwaddress" ) { | ||
73 | Data.IP.GWAddress = V; | 86 | Data.IP.GWAddress = V; |
74 | } | 87 | } |
88 | } else if( A.startsWith( "run" ) ) { | ||
89 | if( A == "runpreconnect" ) { | ||
90 | Data.Run.PreConnect = V; | ||
91 | } else if( A == "runpostconnect" ) { | ||
92 | Data.Run.PostConnect = V; | ||
93 | } else if( A == "runpredisconnect" ) { | ||
94 | Data.Run.PreDisconnect = V; | ||
95 | } else if( A == "runpostdisconnect" ) { | ||
96 | Data.Run.PostDisconnect = V; | ||
97 | } | ||
75 | } | 98 | } |
76 | } | 99 | } |
77 | 100 | ||
78 | void APPP::saveSpecificAttribute( QTextStream & TS ) { | 101 | void APPP::saveSpecificAttribute( QTextStream & TS ) { |
79 | TS << "dnsserverassigned=" << | 102 | TS << "dnsserverassigned=" << |
80 | ( ( Data.DNS.ServerAssigned ) ? "yes" : "no" ) << endl; | 103 | ( ( Data.DNS.ServerAssigned ) ? "yes" : "no" ) << endl; |
81 | TS << "dnsdomainname=" << Data.DNS.DomainName << endl; | 104 | TS << "dnsdomainname=" << Data.DNS.DomainName << endl; |
82 | for( unsigned int i = 0; i < Data.DNS.Servers.size(); i ++ ) { | 105 | for( unsigned int i = 0; i < Data.DNS.Servers.size(); i ++ ) { |
83 | TS << "dnsserver=" << *(Data.DNS.Servers[i]) << endl; | 106 | TS << "dnsserver=" << *(Data.DNS.Servers[i]) << endl; |
84 | } | 107 | } |
85 | TS << "authmode=" << Data.Auth.Mode << endl; | 108 | TS << "authmode=" << Data.Auth.Mode << endl; |
86 | TS << "authloginexpect=" << quote( Data.Auth.Login.Expect ) << endl; | 109 | TS << "authloginexpect=" << quote( Data.Auth.Login.Expect ) << endl; |
87 | TS << "authloginsend=" << quote( Data.Auth.Login.Send ) << endl; | 110 | TS << "authloginsend=" << quote( Data.Auth.Login.Send ) << endl; |
88 | TS << "authpasswordexpect=" << quote( Data.Auth.Password.Expect ) << endl; | 111 | TS << "authpasswordexpect=" << quote( Data.Auth.Password.Expect ) << endl; |
89 | TS << "authpasswordsend=" << quote( Data.Auth.Password.Send ) << endl; | 112 | TS << "authpasswordsend=" << quote( Data.Auth.Password.Send ) << endl; |
90 | TS << "authpcemode=" << Data.Auth.PCEMode << endl; | 113 | TS << "authpcemode=" << Data.Auth.PCEMode << endl; |
91 | TS << "authclient=" << Data.Auth.Client << endl; | 114 | TS << "authclient=" << Data.Auth.Client << endl; |
92 | TS << "authserver=" << Data.Auth.Server << endl; | 115 | TS << "authserver=" << Data.Auth.Server << endl; |
93 | TS << "authsecret=" << quote( Data.Auth.Secret ) << endl; | 116 | TS << "authsecret=" << quote( Data.Auth.Secret ) << endl; |
94 | TS << "ipautomatic=" << ( ( Data.IP.IPAutomatic ) ? "yes" : "no" ) << endl; | 117 | TS << "ipgwautomatic=" << ( ( Data.IP.GWAutomatic ) ? "yes" : "no" ) << endl; |
95 | TS << "gwautomatic=" << ( ( Data.IP.GWAutomatic ) ? "yes" : "no" ) << endl; | 118 | TS << "ipgwisdefault=" << ( ( Data.IP.GWIsDefault ) ? "yes" : "no" ) << endl; |
96 | TS << "gwisdefault=" << ( ( Data.IP.GWIsDefault ) ? "yes" : "no" ) << endl; | 119 | TS << "ipgwifnotset=" << ( ( Data.IP.GWIfNotSet ) ? "yes" : "no" ) << endl; |
97 | TS << "ipaddress=" << Data.IP.IPAddress << endl; | 120 | TS << "iplocaloverrule=" << ( ( Data.IP.LocalOverrule ) ? "yes" : "no" ) << endl; |
98 | TS << "ipsubmask=" << Data.IP.IPSubMask << endl; | 121 | TS << "ipremoteoverrule=" << ( ( Data.IP.RemoteOverrule ) ? "yes" : "no" ) << endl; |
99 | TS << "gwaddress=" << Data.IP.GWAddress << endl; | 122 | TS << "iplocaladdress=" << Data.IP.LocalAddress << endl; |
123 | TS << "ipremoteaddress=" << Data.IP.RemoteAddress << endl; | ||
124 | TS << "ipgwaddress=" << Data.IP.GWAddress << endl; | ||
125 | |||
126 | TS << "runpreconnect=" << Data.Run.PreConnect << endl; | ||
127 | TS << "runpostconnect=" << Data.Run.PostConnect << endl; | ||
128 | TS << "runpredisconnect=" << Data.Run.PreDisconnect << endl; | ||
129 | TS << "runpostdisconnect=" << Data.Run.PostDisconnect << endl; | ||
130 | |||
100 | } | 131 | } |
101 | 132 | ||
102 | QWidget * APPP::edit( QWidget * parent ) { | 133 | QWidget * APPP::edit( QWidget * parent ) { |
103 | GUI = new PPPEdit( parent ); | 134 | GUI = new PPPEdit( parent ); |
104 | GUI->showData( Data ); | 135 | GUI->showData( Data ); |
105 | return GUI; | 136 | return GUI; |
106 | } | 137 | } |
107 | 138 | ||
108 | QString APPP::acceptable( void ) { | 139 | QString APPP::acceptable( void ) { |
109 | return ( GUI ) ? GUI->acceptable( ) : QString(); | 140 | return ( GUI ) ? GUI->acceptable( ) : QString(); |
110 | } | 141 | } |
111 | 142 | ||
112 | void APPP::commit( void ) { | 143 | void APPP::commit( void ) { |
113 | if( GUI && GUI->commit( Data ) ) { | 144 | if( GUI && GUI->commit( Data ) ) { |
114 | setModified( 1 ); | 145 | setModified( 1 ); |
115 | } | 146 | } |
116 | } | 147 | } |
117 | 148 | ||
118 | QFile * APPP::openFile( const QString & ID ) { | 149 | bool APPP::openFile( SystemFile & SF ) { |
119 | QFile * F = 0; | 150 | if( SF.name() == "peers" ) { |
120 | QString S; | 151 | SF.setPath( removeSpaces( |
121 | 152 | QString( "/tmp/ppp/peers/" ) + connection()->name() ) ); | |
122 | if( ID == "peers" ) { | 153 | return 1; |
123 | S = removeSpaces( QString("/tmp/") + connection()->name() ); | 154 | } else if ( SF.name() == "chatscripts" ) { |
124 | 155 | SF.setPath( removeSpaces( | |
125 | F = new QFile( S ); | 156 | QString( "/tmp/chatscripts/" ) + connection()->name() ) ); |
126 | 157 | return 1; | |
127 | if( ! F->open( IO_WriteOnly ) ) { | ||
128 | Log(("Cannot open file %s\n", S.latin1() )); | ||
129 | return 0; | ||
130 | } | ||
131 | } else if ( ID == "chatscripts" ) { | ||
132 | S = removeSpaces( QString("/tmp/") + connection()->name() + ".chat" ); | ||
133 | F = new QFile( S ); | ||
134 | |||
135 | if( ! F->open( IO_WriteOnly ) ) { | ||
136 | Log(("Cannot open file %s\n", S.latin1() )); | ||
137 | return 0; | ||
138 | } | ||
139 | } | 158 | } |
140 | if( F ) { | 159 | return 0; |
141 | Log(("Generate proper file %s = %s\n", | ||
142 | ID.latin1(), F->name().latin1())); | ||
143 | } | ||
144 | return F; | ||
145 | } | 160 | } |
146 | 161 | ||
147 | short APPP::generateFile( const QString & ID, | 162 | short APPP::generateFile( SystemFile & SF, long DevNr ) { |
148 | const QString & Path, | ||
149 | QTextStream & TS, | ||
150 | long DevNr ) { | ||
151 | short rvl, rvd; | 163 | short rvl, rvd; |
152 | 164 | ||
153 | rvl = 1; | 165 | rvl = 1; |
154 | rvd = 1; | 166 | rvd = 1; |
155 | 167 | ||
156 | if( ID == "pap-secrets" ) { | 168 | if( SF.name() == "pap-secrets" ) { |
157 | Log(("Generate PPP for %s\n", ID.latin1() )); | 169 | Log(("Generate PPP for %s\n", SF.name().latin1() )); |
170 | |||
158 | if( Data.Auth.Mode == 1 && Data.Auth.PCEMode == 0 ) { | 171 | if( Data.Auth.Mode == 1 && Data.Auth.PCEMode == 0 ) { |
159 | TS << "# secrets for " | 172 | SF << "# secrets for " |
160 | << connection()->name().latin1() | 173 | << connection()->name().latin1() |
161 | << endl; | 174 | << endl; |
162 | TS << Data.Auth.Client | 175 | SF << Data.Auth.Client |
163 | << " " | 176 | << " " |
164 | << Data.Auth.Server | 177 | << Data.Auth.Server |
165 | << " " | 178 | << " " |
166 | << Data.Auth.Secret | 179 | << Data.Auth.Secret |
167 | << endl; | 180 | << endl; |
168 | rvl = 0; | 181 | rvl = 0; |
169 | rvd = connection()->getToplevel()->generateFileEmbedded( | 182 | rvd = connection()->getToplevel()->generateFileEmbedded( |
170 | ID, Path, TS, DevNr ); | 183 | SF, DevNr ); |
171 | } | 184 | } |
172 | } else if( ID == "chap-secrets" ) { | 185 | } else if( SF.name() == "chap-secrets" ) { |
173 | Log(("Generate PPP for %s\n", ID.latin1() )); | 186 | Log(("Generate PPP for %s\n", SF.name().latin1() )); |
174 | if( Data.Auth.Mode == 1 && Data.Auth.PCEMode != 0 ) { | 187 | if( Data.Auth.Mode == 1 && Data.Auth.PCEMode != 0 ) { |
175 | // used for both EAP and Chap | 188 | // used for both EAP and Chap |
176 | TS << "# secrets for " | 189 | SF << "# secrets for " |
177 | << connection()->name().latin1() | 190 | << connection()->name().latin1() |
178 | << endl; | 191 | << endl; |
179 | TS << Data.Auth.Client | 192 | SF << Data.Auth.Client |
180 | << " " | 193 | << " " |
181 | << Data.Auth.Server | 194 | << Data.Auth.Server |
182 | << " " | 195 | << " " |
183 | << Data.Auth.Secret | 196 | << Data.Auth.Secret |
184 | << endl; | 197 | << endl; |
185 | 198 | ||
186 | rvl = 0; | 199 | rvl = 0; |
187 | rvd = connection()->getToplevel()->generateFileEmbedded( | 200 | rvd = connection()->getToplevel()->generateFileEmbedded( |
188 | ID, Path, TS, DevNr ); | 201 | SF, DevNr ); |
189 | } | 202 | } |
190 | } else if ( ID == "peers" ) { | 203 | } else if ( SF.name() == "peers" ) { |
191 | QFileInfo FI(Path); | 204 | |
192 | Log(("Generate PPP for %s\n", ID.latin1() )); | 205 | QFileInfo FI(SF.path()); |
206 | Log(("Generate PPP for %s\n", SF.name().latin1() )); | ||
193 | 207 | ||
194 | TS << "connect \"/usr/sbin/chat -v -f /etc/ppp/" | 208 | SF << "connect \"/usr/sbin/chat -v -f /etc/chatscripts/" |
195 | << FI.baseName() | 209 | << FI.baseName() |
196 | << ".chat\"" | 210 | << "\"" |
197 | << endl; | 211 | << endl; |
198 | 212 | ||
199 | if( Data.IP.GWIsDefault ) { | 213 | if( Data.IP.GWIsDefault ) { |
200 | TS << "defaultroute" | 214 | SF << "defaultroute" |
201 | << endl; | 215 | << endl; |
202 | } | 216 | } |
203 | 217 | ||
204 | TS << "linkname " | 218 | SF << "linkname " |
205 | << removeSpaces( ID.latin1() ) | 219 | << removeSpaces( SF.name().latin1() ) |
206 | << endl; | 220 | << endl; |
207 | 221 | ||
208 | // insert other data here | 222 | // insert other data here |
209 | rvl = 0; | 223 | rvl = 0; |
210 | rvd = connection()->getToplevel()->generateFileEmbedded( | 224 | rvd = connection()->getToplevel()->generateFileEmbedded( |
211 | ID, Path, TS, DevNr ); | 225 | SF, DevNr ); |
212 | } else if ( ID == "chatscripts" ) { | 226 | } else if ( SF.name() == "chatscripts" ) { |
213 | Log(("Generate PPP for %s\n", ID.latin1() )); | 227 | Log(("Generate PPP for %s\n", SF.name().latin1() )); |
214 | rvl = 0; | 228 | rvl = 0; |
215 | rvd = connection()->getToplevel()->generateFileEmbedded( | 229 | rvd = connection()->getToplevel()->generateFileEmbedded( |
216 | ID, Path, TS, DevNr ); | 230 | SF, DevNr ); |
217 | } | 231 | } |
218 | 232 | ||
219 | return (rvd == 2 || rvl == 2 ) ? 2 : | 233 | return (rvd == 2 || rvl == 2 ) ? 2 : |
220 | (rvd == 0 || rvl == 0 ) ? 0 : 1; | 234 | (rvd == 0 || rvl == 0 ) ? 0 : 1; |
221 | } | 235 | } |
diff --git a/noncore/settings/networksettings2/ppp/ppp_NNI.h b/noncore/settings/networksettings2/ppp/ppp_NNI.h index 0bf8fa9..76afb21 100644 --- a/noncore/settings/networksettings2/ppp/ppp_NNI.h +++ b/noncore/settings/networksettings2/ppp/ppp_NNI.h | |||
@@ -1,51 +1,45 @@ | |||
1 | #ifndef PPP_H | 1 | #ifndef PPP_H |
2 | #define PPP_H | 2 | #define PPP_H |
3 | 3 | ||
4 | #include <netnode.h> | 4 | #include <netnode.h> |
5 | #include "pppdata.h" | 5 | #include "pppdata.h" |
6 | #include "ppprun.h" | 6 | #include "ppprun.h" |
7 | 7 | ||
8 | class PPPNetNode; | 8 | class PPPNetNode; |
9 | class PPPEdit; | 9 | class PPPEdit; |
10 | class QTextStream; | 10 | class QTextStream; |
11 | 11 | ||
12 | class APPP : public ANetNodeInstance { | 12 | class APPP : public ANetNodeInstance { |
13 | 13 | ||
14 | public : | 14 | public : |
15 | 15 | ||
16 | APPP( PPPNetNode * PNN ); | 16 | APPP( PPPNetNode * PNN ); |
17 | 17 | ||
18 | RuntimeInfo * runtime( void ) | 18 | RuntimeInfo * runtime( void ) |
19 | { if( RT == 0 ) { | 19 | { return (RT) ? RT : (RT = new PPPRun( this, Data ) ); } |
20 | RT = new PPPRun( this, Data ); | ||
21 | } | ||
22 | return RT->runtimeInfo(); | ||
23 | } | ||
24 | 20 | ||
25 | QWidget * edit( QWidget * parent ); | 21 | QWidget * edit( QWidget * parent ); |
26 | QString acceptable( void ); | 22 | QString acceptable( void ); |
27 | void commit( void ); | 23 | void commit( void ); |
28 | 24 | ||
29 | virtual void * data( void ) | 25 | virtual void * data( void ) |
30 | { return (void *)&Data; } | 26 | { return (void *)&Data; } |
31 | 27 | ||
32 | virtual QFile * openFile( const QString & ID ); | 28 | virtual bool openFile( SystemFile & Sf ); |
33 | short generateFile( const QString & ID, | 29 | short generateFile( SystemFile & TS, |
34 | const QString & Path, | ||
35 | QTextStream & TS, | ||
36 | long DevNr ); | 30 | long DevNr ); |
37 | 31 | ||
38 | protected : | 32 | protected : |
39 | 33 | ||
40 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); | 34 | virtual void setSpecificAttribute( QString & Attr, QString & Value ); |
41 | virtual void saveSpecificAttribute( QTextStream & TS ); | 35 | virtual void saveSpecificAttribute( QTextStream & TS ); |
42 | 36 | ||
43 | private : | 37 | private : |
44 | 38 | ||
45 | PPPEdit * GUI; | 39 | PPPEdit * GUI; |
46 | PPPData Data; | 40 | PPPData Data; |
47 | PPPRun * RT; | 41 | PPPRun * RT; |
48 | 42 | ||
49 | }; | 43 | }; |
50 | 44 | ||
51 | #endif | 45 | #endif |
diff --git a/noncore/settings/networksettings2/ppp/pppdata.h b/noncore/settings/networksettings2/ppp/pppdata.h index 9e8543c..68666f8 100644 --- a/noncore/settings/networksettings2/ppp/pppdata.h +++ b/noncore/settings/networksettings2/ppp/pppdata.h | |||
@@ -1,38 +1,50 @@ | |||
1 | #ifndef PPP_DATA_H | 1 | #ifndef PPP_DATA_H |
2 | #define PPP_DATA_H | 2 | #define PPP_DATA_H |
3 | 3 | ||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | #include <qarray.h> | 5 | #include <qarray.h> |
6 | 6 | ||
7 | typedef struct PPPData { | 7 | class PPPData { |
8 | |||
9 | public : | ||
10 | |||
8 | struct { | 11 | struct { |
9 | bool IPAutomatic; | 12 | bool LocalOverrule; |
10 | QString IPAddress; | 13 | bool RemoteOverrule; |
11 | QString IPSubMask; | 14 | QString LocalAddress; |
15 | QString RemoteAddress; | ||
12 | bool GWAutomatic; | 16 | bool GWAutomatic; |
13 | QString GWAddress; | 17 | QString GWAddress; |
14 | bool GWIsDefault; | 18 | bool GWIsDefault; |
19 | bool GWIfNotSet; | ||
15 | } IP; | 20 | } IP; |
21 | |||
16 | struct { | 22 | struct { |
17 | short Mode; // 0 login, 1 chap/pap, 2 Terminal | 23 | short Mode; // 0 login, 1 chap/pap, 2 Terminal |
18 | struct { | 24 | struct { |
19 | QString Expect; | 25 | QString Expect; |
20 | QString Send; | 26 | QString Send; |
21 | } Login; | 27 | } Login; |
22 | struct { | 28 | struct { |
23 | QString Expect; | 29 | QString Expect; |
24 | QString Send; | 30 | QString Send; |
25 | } Password; | 31 | } Password; |
26 | short PCEMode; // 0 pap, 1, chap 2, EAP | 32 | short PCEMode; // 0 pap, 1, chap 2, EAP |
27 | QString Server; | 33 | QString Server; |
28 | QString Client; | 34 | QString Client; |
29 | QString Secret; | 35 | QString Secret; |
30 | } Auth; | 36 | } Auth; |
31 | struct { | 37 | struct { |
32 | bool ServerAssigned; | 38 | bool ServerAssigned; |
33 | QString DomainName; | 39 | QString DomainName; |
34 | QArray<QString *> Servers; | 40 | QArray<QString *> Servers; |
35 | } DNS; | 41 | } DNS; |
36 | } PPPData_t; | 42 | struct { |
43 | QString PreConnect; | ||
44 | QString PostConnect; | ||
45 | QString PreDisconnect; | ||
46 | QString PostDisconnect; | ||
47 | } Run; | ||
48 | }; | ||
37 | 49 | ||
38 | #endif | 50 | #endif |
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp index a8abc50..8403e6d 100644 --- a/noncore/settings/networksettings2/ppp/ppprun.cpp +++ b/noncore/settings/networksettings2/ppp/ppprun.cpp | |||
@@ -1,82 +1,52 @@ | |||
1 | #include <resources.h> | 1 | #include <resources.h> |
2 | #include "ppprun.h" | 2 | #include "ppprun.h" |
3 | 3 | ||
4 | PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) : | 4 | PPPRun::PPPRun( ANetNodeInstance * NNI, PPPData & Data ) : |
5 | AsConnection( NNI ), AsDevice( NNI ), Pat( "eth[0-9]" ) { | 5 | RuntimeInfo( NNI ), Pat( "eth[0-9]" ) { |
6 | D = &Data; | 6 | D = &Data; |
7 | } | 7 | } |
8 | 8 | ||
9 | void PPPRun::detectState( NodeCollection * NC ) { | 9 | State_t PPPRun::detectState( void ) { |
10 | if( isMyPPPDRunning( ) ) { | 10 | if( isMyPPPDRunning( ) ) { |
11 | if( isMyPPPUp() ) { | 11 | return ( isMyPPPUp() ) ? IsUp : Available; |
12 | NC->setCurrentState( IsUp ); | 12 | } |
13 | } else { | 13 | return Off; |
14 | NC->setCurrentState( Available ); | ||
15 | } | ||
16 | } else { | ||
17 | NC->setCurrentState( Off ); // at least this | ||
18 | // but could also be unavailable | ||
19 | AsDevice::netNode()->nextNode()->runtime()->detectState( NC ); | ||
20 | } | ||
21 | } | 14 | } |
22 | 15 | ||
23 | bool PPPRun::setState( NodeCollection * NC, Action_t A, bool ) { | 16 | QString PPPRun::setMyState( NodeCollection * NC, Action_t A, bool ) { |
24 | switch( A ) { | 17 | return QString(); |
25 | case Activate : | ||
26 | NC->setCurrentState( Available ); | ||
27 | // no | ||
28 | break; | ||
29 | case Deactivate : | ||
30 | if( NC->currentState() == IsUp ) { | ||
31 | NC->state( Down ); | ||
32 | } | ||
33 | // cannot really disable | ||
34 | NC->setCurrentState( Available ); | ||
35 | break; | ||
36 | case Up : | ||
37 | if( NC->currentState() != IsUp ) { | ||
38 | // start my PPPD | ||
39 | NC->setCurrentState( IsUp ); | ||
40 | } | ||
41 | break; | ||
42 | case Down : | ||
43 | if( NC->currentState() == IsUp ) { | ||
44 | // stop my PPPD | ||
45 | NC->setCurrentState( Available ); | ||
46 | } | ||
47 | break; | ||
48 | default : // FT | ||
49 | break; | ||
50 | } | ||
51 | return 1; | ||
52 | } | 18 | } |
53 | 19 | ||
54 | bool PPPRun::isMyPPPDRunning( void ) { | 20 | bool PPPRun::isMyPPPDRunning( void ) { |
55 | return 0; | 21 | return 0; |
56 | } | 22 | } |
57 | 23 | ||
58 | bool PPPRun::isMyPPPUp( void ) { | 24 | bool PPPRun::isMyPPPUp( void ) { |
59 | System & S = NSResources->system(); | 25 | System & S = NSResources->system(); |
60 | InterfaceInfo * Run; | 26 | InterfaceInfo * Run; |
61 | QRegExp R( "ppp[0-9]" ); | 27 | QRegExp R( "ppp[0-9]" ); |
62 | 28 | ||
63 | for( QDictIterator<InterfaceInfo> It(S.interfaces()); | 29 | for( QDictIterator<InterfaceInfo> It(S.interfaces()); |
64 | It.current(); | 30 | It.current(); |
65 | ++It ) { | 31 | ++It ) { |
66 | Run = It.current(); | 32 | Run = It.current(); |
67 | if( R.match( Run->Name ) >= 0 && | 33 | if( R.match( Run->Name ) >= 0 && |
68 | Run->IsPointToPoint | 34 | Run->IsPointToPoint |
69 | ) { | 35 | ) { |
70 | // this is a LAN card | 36 | // this is a LAN card |
71 | if( Run->assignedNode() == AsDevice::netNode() ) { | 37 | if( Run->assignedConnection() == netNode()->connection() ) { |
72 | // assigned to us | 38 | // assigned to us |
73 | return 1; | 39 | return 1; |
74 | } | 40 | } |
75 | } | 41 | } |
76 | } | 42 | } |
77 | return 0; | 43 | return 0; |
78 | } | 44 | } |
79 | 45 | ||
80 | bool PPPRun::handlesInterface( const QString & S ) { | 46 | bool PPPRun::handlesInterface( const QString & S ) { |
81 | return Pat.match( S ) >= 0; | 47 | return Pat.match( S ) >= 0; |
82 | } | 48 | } |
49 | |||
50 | bool PPPRun::handlesInterface( InterfaceInfo * I ) { | ||
51 | return handlesInterface( I->Name ); | ||
52 | } | ||
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h index 90a3f25..2990a96 100644 --- a/noncore/settings/networksettings2/ppp/ppprun.h +++ b/noncore/settings/networksettings2/ppp/ppprun.h | |||
@@ -1,47 +1,37 @@ | |||
1 | #ifndef PPPRUN_H | 1 | #ifndef PPPRUN_H |
2 | #define PPPRUN_H | 2 | #define PPPRUN_H |
3 | 3 | ||
4 | #include <qregexp.h> | 4 | #include <qregexp.h> |
5 | #include <asconnection.h> | 5 | #include <netnode.h> |
6 | #include <asdevice.h> | ||
7 | #include "pppdata.h" | 6 | #include "pppdata.h" |
8 | 7 | ||
9 | class PPPRun : public AsConnection, public AsDevice { | 8 | class PPPRun : public RuntimeInfo { |
10 | 9 | ||
11 | public : | 10 | public : |
12 | 11 | ||
13 | PPPRun( ANetNodeInstance * NNI, | 12 | PPPRun( ANetNodeInstance * NNI, |
14 | PPPData & Data ); | 13 | PPPData & Data ); |
15 | 14 | ||
16 | virtual AsDevice * asDevice( void ) | 15 | bool handlesInterface( const QString & I ); |
17 | { return (AsDevice *)this; } | 16 | bool handlesInterface( InterfaceInfo * ); |
18 | virtual AsConnection * asConnection( void ) | ||
19 | { return (AsConnection *)this; } | ||
20 | |||
21 | virtual AsDevice * device( void ) | ||
22 | { return (AsDevice *)this; } | ||
23 | 17 | ||
24 | virtual RuntimeInfo * runtimeInfo( void ) | 18 | State_t detectState( void ); |
25 | { return ( AsConnection *)this; } | 19 | virtual RuntimeInfo * device( void ) |
20 | { return this; } | ||
21 | virtual RuntimeInfo * connection( void ) | ||
22 | { return this; } | ||
26 | 23 | ||
27 | protected : | 24 | protected : |
28 | 25 | ||
29 | void detectState( NodeCollection * NC ); | 26 | QString setMyState( NodeCollection * , Action_t, bool ); |
30 | bool setState( NodeCollection * NC, Action_t A, bool ); | ||
31 | bool canSetState( State_t S, Action_t A ) | ||
32 | { return AsDevice::connection()->findNext( | ||
33 | AsDevice::netNode() )->runtime()->canSetState( S,A ); } | ||
34 | |||
35 | bool handlesInterface( const QString & I ); | ||
36 | 27 | ||
37 | private : | 28 | private : |
38 | 29 | ||
39 | bool isMyPPPDRunning( void ); | 30 | bool isMyPPPDRunning( void ); |
40 | bool isMyPPPUp( void ); | 31 | bool isMyPPPUp( void ); |
41 | 32 | ||
42 | PPPData_t * D; | 33 | PPPData * D; |
43 | QRegExp Pat; | 34 | QRegExp Pat; |
44 | |||
45 | }; | 35 | }; |
46 | 36 | ||
47 | #endif | 37 | #endif |