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 | |||
@@ -39,3 +39,3 @@ QString PPPAuthEdit::acceptable( void ) { | |||
39 | 39 | ||
40 | bool PPPAuthEdit::commit( PPPData_t & D ) { | 40 | bool PPPAuthEdit::commit( PPPData & D ) { |
41 | bool SM = 0; | 41 | bool SM = 0; |
@@ -72,3 +72,3 @@ bool PPPAuthEdit::commit( PPPData_t & D ) { | |||
72 | 72 | ||
73 | void PPPAuthEdit::showData( PPPData_t & D ) { | 73 | void PPPAuthEdit::showData( PPPData & D ) { |
74 | 74 | ||
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 | |||
@@ -9,4 +9,4 @@ public : | |||
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 ); |
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 | |||
@@ -25,3 +25,3 @@ QString PPPDNSEdit::acceptable( void ) { | |||
25 | 25 | ||
26 | bool PPPDNSEdit::commit( PPPData_t & D ) { | 26 | bool PPPDNSEdit::commit( PPPData & D ) { |
27 | bool SM = 0; | 27 | bool SM = 0; |
@@ -77,3 +77,3 @@ bool PPPDNSEdit::commit( PPPData_t & D ) { | |||
77 | 77 | ||
78 | void PPPDNSEdit::showData( PPPData_t & D) { | 78 | void PPPDNSEdit::showData( PPPData & D) { |
79 | 79 | ||
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 | |||
@@ -9,4 +9,4 @@ public : | |||
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 | ||
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 | |||
@@ -13,4 +13,4 @@ | |||
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> |
@@ -30,3 +30,3 @@ | |||
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>2</number> | 31 | <number>0</number> |
32 | </property> | 32 | </property> |
@@ -56,2 +56,14 @@ | |||
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"> |
@@ -78,3 +90,3 @@ | |||
78 | </sizehint> | 90 | </sizehint> |
79 | <container>0</container> | 91 | <container>1</container> |
80 | <sizepolicy> | 92 | <sizepolicy> |
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 | |||
@@ -13,4 +13,4 @@ | |||
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> |
@@ -30,3 +30,3 @@ | |||
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>0</number> |
32 | </property> | 32 | </property> |
@@ -34,13 +34,9 @@ | |||
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> |
@@ -56,6 +52,6 @@ | |||
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> |
@@ -65,7 +61,11 @@ | |||
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> |
@@ -73,6 +73,13 @@ | |||
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> |
@@ -80,7 +87,7 @@ | |||
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> |
@@ -88,128 +95,43 @@ | |||
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> |
@@ -222,2 +144,9 @@ | |||
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> |
@@ -234,3 +163,3 @@ | |||
234 | <name>margin</name> | 163 | <name>margin</name> |
235 | <number>2</number> | 164 | <number>3</number> |
236 | </property> | 165 | </property> |
@@ -380,3 +309,3 @@ | |||
380 | <name>name</name> | 309 | <name>name</name> |
381 | <cstring>Layout3</cstring> | 310 | <cstring>Layout4</cstring> |
382 | </property> | 311 | </property> |
@@ -391,2 +320,13 @@ | |||
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> |
@@ -416,3 +356,3 @@ | |||
416 | <name>name</name> | 356 | <name>name</name> |
417 | <cstring>GWIsDefault_CB</cstring> | 357 | <cstring>GWIfNotSet_CB</cstring> |
418 | </property> | 358 | </property> |
@@ -420,3 +360,3 @@ | |||
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> |
@@ -427,2 +367,23 @@ | |||
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> |
@@ -436,8 +397,2 @@ | |||
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> |
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 | |||
@@ -11,12 +11,3 @@ PPPIPEdit::PPPIPEdit( QWidget * Parent ) : PPPIPGUI( Parent ){ | |||
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() ) |
@@ -30,3 +21,3 @@ QString PPPIPEdit::acceptable( void ) { | |||
30 | 21 | ||
31 | bool PPPIPEdit::commit( PPPData_t & D ) { | 22 | bool PPPIPEdit::commit( PPPData & D ) { |
32 | 23 | ||
@@ -34,9 +25,10 @@ bool PPPIPEdit::commit( PPPData_t & D ) { | |||
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 ) { |
@@ -46,2 +38,4 @@ bool PPPIPEdit::commit( PPPData_t & D ) { | |||
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; |
@@ -49,6 +43,8 @@ bool PPPIPEdit::commit( PPPData_t & D ) { | |||
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 ); |
@@ -56,2 +52,3 @@ void PPPIPEdit::showData( PPPData_t & D ) { | |||
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 | |||
@@ -9,4 +9,4 @@ public : | |||
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 | ||
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 | |||
@@ -5,2 +5,4 @@ | |||
5 | #include "PPPAuthedit.h" | 5 | #include "PPPAuthedit.h" |
6 | #include "PPPRunedit.h" | ||
7 | #include "PPPDialingedit.h" | ||
6 | #include "PPPedit.h" | 8 | #include "PPPedit.h" |
@@ -12,2 +14,5 @@ PPPEdit::PPPEdit( QWidget * Parent ) : PPPGUI( Parent ){ | |||
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 ); |
@@ -15,2 +20,4 @@ PPPEdit::PPPEdit( QWidget * Parent ) : PPPGUI( Parent ){ | |||
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 | ||
@@ -31,3 +38,3 @@ QString PPPEdit::acceptable( void ) { | |||
31 | 38 | ||
32 | bool PPPEdit::commit( PPPData_t & Data ) { | 39 | bool PPPEdit::commit( PPPData & Data ) { |
33 | bool SM ; | 40 | bool SM ; |
@@ -39,3 +46,3 @@ bool PPPEdit::commit( PPPData_t & Data ) { | |||
39 | 46 | ||
40 | void PPPEdit::showData( PPPData_t & Data ) { | 47 | void PPPEdit::showData( PPPData & Data ) { |
41 | Auth->showData( Data ) ; | 48 | Auth->showData( Data ) ; |
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 | |||
@@ -6,2 +6,4 @@ class PPPIPEdit; | |||
6 | class PPPDNSEdit; | 6 | class PPPDNSEdit; |
7 | class PPPRunEdit; | ||
8 | class PPPDialingEdit; | ||
7 | 9 | ||
@@ -13,4 +15,4 @@ public : | |||
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 | ||
@@ -22,5 +24,7 @@ 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 | ||
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,2 +1,2 @@ | |||
1 | Package: opie-networksettingsplugin2-ppp | 1 | Package: opie-networksettings2plugin-ppp |
2 | Files: plugins/networksettings2/libppp.so* | 2 | Files: plugins/networksettings2/libppp.so* |
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 | |||
@@ -8,2 +8,4 @@ HEADERS = ppp_NN.h \ | |||
8 | PPPDNSedit.h \ | 8 | PPPDNSedit.h \ |
9 | PPPRunedit.h \ | ||
10 | PPPDialingedit.h \ | ||
9 | PPPIPedit.h | 11 | PPPIPedit.h |
@@ -13,2 +15,4 @@ SOURCES = ppp_NN.cpp \ | |||
13 | PPPDNSedit.cpp \ | 15 | PPPDNSedit.cpp \ |
16 | PPPRunedit.cpp \ | ||
17 | PPPDialingedit.cpp \ | ||
14 | PPPAuthedit.cpp \ | 18 | PPPAuthedit.cpp \ |
@@ -19,3 +23,8 @@ 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 |
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,2 +1,3 @@ | |||
1 | #include <qfile.h> | 1 | #include <qfile.h> |
2 | #include <resources.h> | ||
2 | #include <qtextstream.h> | 3 | #include <qtextstream.h> |
@@ -8,4 +9,8 @@ QStringList * PPPNetNode::ProperFiles = 0; | |||
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 |
@@ -18,12 +23,6 @@ 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 | } |
@@ -52,9 +51,10 @@ const char ** PPPNetNode::needs( void ) { | |||
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 | } |
@@ -64,5 +64,5 @@ QStringList * PPPNetNode::properFiles( void ) { | |||
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 | } |
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 | |||
@@ -19,3 +19,3 @@ public: | |||
19 | 19 | ||
20 | virtual bool hasDataForFile( const QString & S ); | 20 | virtual bool hasDataForFile( SystemFile & S ); |
21 | 21 | ||
@@ -24,6 +24,6 @@ public: | |||
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 | ||
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 | |||
@@ -18,5 +18,7 @@ APPP::APPP( PPPNetNode * PNN ) : ANetNodeInstance( PNN ) { | |||
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; |
@@ -24,2 +26,9 @@ APPP::APPP( PPPNetNode * PNN ) : ANetNodeInstance( PNN ) { | |||
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; |
@@ -61,15 +70,29 @@ void APPP::setSpecificAttribute( QString & A, QString & V ) { | |||
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 | } |
@@ -93,8 +116,16 @@ void APPP::saveSpecificAttribute( QTextStream & TS ) { | |||
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 | } |
@@ -117,35 +148,16 @@ void APPP::commit( void ) { | |||
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; |
@@ -155,9 +167,10 @@ short APPP::generateFile( const QString & ID, | |||
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 | << " " |
@@ -169,12 +182,12 @@ short APPP::generateFile( const QString & ID, | |||
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 | << " " |
@@ -187,11 +200,12 @@ short APPP::generateFile( const QString & ID, | |||
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; |
@@ -199,3 +213,3 @@ short APPP::generateFile( const QString & ID, | |||
199 | if( Data.IP.GWIsDefault ) { | 213 | if( Data.IP.GWIsDefault ) { |
200 | TS << "defaultroute" | 214 | SF << "defaultroute" |
201 | << endl; | 215 | << endl; |
@@ -203,4 +217,4 @@ short APPP::generateFile( const QString & ID, | |||
203 | 217 | ||
204 | TS << "linkname " | 218 | SF << "linkname " |
205 | << removeSpaces( ID.latin1() ) | 219 | << removeSpaces( SF.name().latin1() ) |
206 | << endl; | 220 | << endl; |
@@ -210,8 +224,8 @@ short APPP::generateFile( const QString & ID, | |||
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 | } |
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 | |||
@@ -18,7 +18,3 @@ public : | |||
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 | ||
@@ -31,6 +27,4 @@ public : | |||
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 ); |
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 | |||
@@ -6,7 +6,11 @@ | |||
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; |
@@ -14,3 +18,5 @@ typedef struct PPPData { | |||
14 | bool GWIsDefault; | 18 | bool GWIsDefault; |
19 | bool GWIfNotSet; | ||
15 | } IP; | 20 | } IP; |
21 | |||
16 | struct { | 22 | struct { |
@@ -35,3 +41,9 @@ typedef struct PPPData { | |||
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 | ||
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 | |||
@@ -4,49 +4,15 @@ | |||
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 | } |
@@ -70,3 +36,3 @@ bool PPPRun::isMyPPPUp( void ) { | |||
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 |
@@ -82 +48,5 @@ bool PPPRun::handlesInterface( const QString & S ) { | |||
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 | |||
@@ -4,7 +4,6 @@ | |||
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 | ||
@@ -15,22 +14,14 @@ public : | |||
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 | ||
@@ -41,5 +32,4 @@ private : | |||
41 | 32 | ||
42 | PPPData_t * D; | 33 | PPPData * D; |
43 | QRegExp Pat; | 34 | QRegExp Pat; |
44 | |||
45 | }; | 35 | }; |