Diffstat (limited to 'noncore/settings/networksettings/wlan') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/wlan/keyedit.cpp | 1 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlan.ui | 96 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 35 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanmodule.cpp | 2 |
4 files changed, 74 insertions, 60 deletions
diff --git a/noncore/settings/networksettings/wlan/keyedit.cpp b/noncore/settings/networksettings/wlan/keyedit.cpp index ad9ecae..13a1c3b 100644 --- a/noncore/settings/networksettings/wlan/keyedit.cpp +++ b/noncore/settings/networksettings/wlan/keyedit.cpp | |||
@@ -1,21 +1,22 @@ | |||
1 | #include "keyedit.h" | 1 | #include "keyedit.h" |
2 | #include <qlineedit.h> | 2 | #include <qlineedit.h> |
3 | 3 | ||
4 | KeyEdit::KeyEdit(QWidget* parent, const char* name) : | 4 | KeyEdit::KeyEdit(QWidget* parent, const char* name) : |
5 | QLineEdit(parent, name) | 5 | QLineEdit(parent, name) |
6 | { | 6 | { |
7 | setEchoMode(Password); | ||
7 | } | 8 | } |
8 | 9 | ||
9 | KeyEdit::~KeyEdit() | 10 | KeyEdit::~KeyEdit() |
10 | { | 11 | { |
11 | } | 12 | } |
12 | 13 | ||
13 | void KeyEdit::focusInEvent(QFocusEvent *event) | 14 | void KeyEdit::focusInEvent(QFocusEvent *event) |
14 | { | 15 | { |
15 | setEchoMode(Normal); | 16 | setEchoMode(Normal); |
16 | } | 17 | } |
17 | 18 | ||
18 | void KeyEdit::focusOutEvent(QFocusEvent *event) | 19 | void KeyEdit::focusOutEvent(QFocusEvent *event) |
19 | { | 20 | { |
20 | setEchoMode(Password); | 21 | setEchoMode(Password); |
21 | } | 22 | } |
diff --git a/noncore/settings/networksettings/wlan/wlan.ui b/noncore/settings/networksettings/wlan/wlan.ui index 7932445..7e39e23 100644 --- a/noncore/settings/networksettings/wlan/wlan.ui +++ b/noncore/settings/networksettings/wlan/wlan.ui | |||
@@ -1,110 +1,110 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>WLAN</class> | 2 | <class>WLAN</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>WLAN</cstring> | 7 | <cstring>WLAN</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>251</width> | 14 | <width>247</width> |
15 | <height>299</height> | 15 | <height>299</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>Wireless Configuration</string> | 20 | <string>Wireless Configuration</string> |
21 | </property> | 21 | </property> |
22 | <property stdset="1"> | 22 | <property stdset="1"> |
23 | <name>sizeGripEnabled</name> | 23 | <name>sizeGripEnabled</name> |
24 | <bool>true</bool> | 24 | <bool>true</bool> |
25 | </property> | 25 | </property> |
26 | <property> | 26 | <property> |
27 | <name>layoutMargin</name> | 27 | <name>layoutMargin</name> |
28 | </property> | 28 | </property> |
29 | <vbox> | 29 | <vbox> |
30 | <property stdset="1"> | 30 | <property stdset="1"> |
31 | <name>margin</name> | 31 | <name>margin</name> |
32 | <number>0</number> | 32 | <number>0</number> |
33 | </property> | 33 | </property> |
34 | <property stdset="1"> | 34 | <property stdset="1"> |
35 | <name>spacing</name> | 35 | <name>spacing</name> |
36 | <number>6</number> | 36 | <number>6</number> |
37 | </property> | 37 | </property> |
38 | <widget> | 38 | <widget> |
39 | <class>QTabWidget</class> | 39 | <class>QTabWidget</class> |
40 | <property stdset="1"> | 40 | <property stdset="1"> |
41 | <name>name</name> | 41 | <name>name</name> |
42 | <cstring>tabWidget</cstring> | 42 | <cstring>tabWidget</cstring> |
43 | </property> | 43 | </property> |
44 | <property stdset="1"> | 44 | <property stdset="1"> |
45 | <name>enabled</name> | 45 | <name>enabled</name> |
46 | <bool>true</bool> | 46 | <bool>true</bool> |
47 | </property> | 47 | </property> |
48 | <widget> | 48 | <widget> |
49 | <class>QWidget</class> | 49 | <class>QWidget</class> |
50 | <property stdset="1"> | 50 | <property stdset="1"> |
51 | <name>name</name> | 51 | <name>name</name> |
52 | <cstring>ConfigPage</cstring> | 52 | <cstring>ConfigPage</cstring> |
53 | </property> | 53 | </property> |
54 | <attribute> | 54 | <attribute> |
55 | <name>title</name> | 55 | <name>title</name> |
56 | <string>General</string> | 56 | <string>General</string> |
57 | </attribute> | 57 | </attribute> |
58 | <spacer> | 58 | <spacer> |
59 | <property> | 59 | <property> |
60 | <name>name</name> | 60 | <name>name</name> |
61 | <cstring>Spacer31</cstring> | 61 | <cstring>Spacer31</cstring> |
62 | </property> | 62 | </property> |
63 | <property stdset="1"> | 63 | <property stdset="1"> |
64 | <name>orientation</name> | 64 | <name>orientation</name> |
65 | <enum>Vertical</enum> | 65 | <enum>Vertical</enum> |
66 | </property> | 66 | </property> |
67 | <property stdset="1"> | 67 | <property stdset="1"> |
68 | <name>sizeType</name> | 68 | <name>sizeType</name> |
69 | <enum>Expanding</enum> | 69 | <enum>Expanding</enum> |
70 | </property> | 70 | </property> |
71 | <property> | 71 | <property> |
72 | <name>sizeHint</name> | 72 | <name>sizeHint</name> |
73 | <size> | 73 | <size> |
74 | <width>20</width> | 74 | <width>20</width> |
75 | <height>20</height> | 75 | <height>20</height> |
76 | </size> | 76 | </size> |
77 | </property> | 77 | </property> |
78 | </spacer> | 78 | </spacer> |
79 | <widget> | 79 | <widget> |
80 | <class>QLabel</class> | 80 | <class>QLabel</class> |
81 | <property stdset="1"> | 81 | <property stdset="1"> |
82 | <name>name</name> | 82 | <name>name</name> |
83 | <cstring>modeLabel</cstring> | 83 | <cstring>modeLabel</cstring> |
84 | </property> | 84 | </property> |
85 | <property stdset="1"> | 85 | <property stdset="1"> |
86 | <name>enabled</name> | 86 | <name>enabled</name> |
87 | <bool>true</bool> | 87 | <bool>true</bool> |
88 | </property> | 88 | </property> |
89 | <property stdset="1"> | 89 | <property stdset="1"> |
90 | <name>geometry</name> | 90 | <name>geometry</name> |
91 | <rect> | 91 | <rect> |
92 | <x>11</x> | 92 | <x>11</x> |
93 | <y>11</y> | 93 | <y>11</y> |
94 | <width>84</width> | 94 | <width>84</width> |
95 | <height>29</height> | 95 | <height>29</height> |
96 | </rect> | 96 | </rect> |
97 | </property> | 97 | </property> |
98 | <property stdset="1"> | 98 | <property stdset="1"> |
99 | <name>sizePolicy</name> | 99 | <name>sizePolicy</name> |
100 | <sizepolicy> | 100 | <sizepolicy> |
101 | <hsizetype>1</hsizetype> | 101 | <hsizetype>1</hsizetype> |
102 | <vsizetype>1</vsizetype> | 102 | <vsizetype>1</vsizetype> |
103 | </sizepolicy> | 103 | </sizepolicy> |
104 | </property> | 104 | </property> |
105 | <property stdset="1"> | 105 | <property stdset="1"> |
106 | <name>text</name> | 106 | <name>text</name> |
107 | <string>Mode</string> | 107 | <string>Mode</string> |
108 | </property> | 108 | </property> |
109 | </widget> | 109 | </widget> |
110 | <widget> | 110 | <widget> |
@@ -194,280 +194,286 @@ | |||
194 | <sizepolicy> | 194 | <sizepolicy> |
195 | <hsizetype>5</hsizetype> | 195 | <hsizetype>5</hsizetype> |
196 | <vsizetype>1</vsizetype> | 196 | <vsizetype>1</vsizetype> |
197 | </sizepolicy> | 197 | </sizepolicy> |
198 | </property> | 198 | </property> |
199 | </widget> | 199 | </widget> |
200 | <widget> | 200 | <widget> |
201 | <class>QLabel</class> | 201 | <class>QLabel</class> |
202 | <property stdset="1"> | 202 | <property stdset="1"> |
203 | <name>name</name> | 203 | <name>name</name> |
204 | <cstring>macLabel</cstring> | 204 | <cstring>macLabel</cstring> |
205 | </property> | 205 | </property> |
206 | <property stdset="1"> | 206 | <property stdset="1"> |
207 | <name>enabled</name> | 207 | <name>enabled</name> |
208 | <bool>false</bool> | 208 | <bool>false</bool> |
209 | </property> | 209 | </property> |
210 | <property stdset="1"> | 210 | <property stdset="1"> |
211 | <name>geometry</name> | 211 | <name>geometry</name> |
212 | <rect> | 212 | <rect> |
213 | <x>11</x> | 213 | <x>11</x> |
214 | <y>108</y> | 214 | <y>108</y> |
215 | <width>39</width> | 215 | <width>39</width> |
216 | <height>25</height> | 216 | <height>25</height> |
217 | </rect> | 217 | </rect> |
218 | </property> | 218 | </property> |
219 | <property stdset="1"> | 219 | <property stdset="1"> |
220 | <name>text</name> | 220 | <name>text</name> |
221 | <string>MAC</string> | 221 | <string>MAC</string> |
222 | </property> | 222 | </property> |
223 | </widget> | 223 | </widget> |
224 | <widget> | 224 | <widget> |
225 | <class>QCheckBox</class> | 225 | <class>QCheckBox</class> |
226 | <property stdset="1"> | 226 | <property stdset="1"> |
227 | <name>name</name> | 227 | <name>name</name> |
228 | <cstring>specifyAp</cstring> | 228 | <cstring>specifyAp</cstring> |
229 | </property> | 229 | </property> |
230 | <property stdset="1"> | 230 | <property stdset="1"> |
231 | <name>geometry</name> | 231 | <name>geometry</name> |
232 | <rect> | 232 | <rect> |
233 | <x>11</x> | 233 | <x>11</x> |
234 | <y>81</y> | 234 | <y>81</y> |
235 | <width>227</width> | 235 | <width>227</width> |
236 | <height>21</height> | 236 | <height>21</height> |
237 | </rect> | 237 | </rect> |
238 | </property> | 238 | </property> |
239 | <property stdset="1"> | 239 | <property stdset="1"> |
240 | <name>text</name> | 240 | <name>text</name> |
241 | <string>Specify &Access Point</string> | 241 | <string>Specify &Access Point</string> |
242 | </property> | 242 | </property> |
243 | </widget> | 243 | </widget> |
244 | <widget> | 244 | <widget> |
245 | <class>QCheckBox</class> | 245 | <class>QCheckBox</class> |
246 | <property stdset="1"> | 246 | <property stdset="1"> |
247 | <name>name</name> | 247 | <name>name</name> |
248 | <cstring>specifyChan</cstring> | 248 | <cstring>specifyChan</cstring> |
249 | </property> | 249 | </property> |
250 | <property stdset="1"> | 250 | <property stdset="1"> |
251 | <name>geometry</name> | 251 | <name>geometry</name> |
252 | <rect> | 252 | <rect> |
253 | <x>11</x> | 253 | <x>11</x> |
254 | <y>141</y> | 254 | <y>141</y> |
255 | <width>129</width> | 255 | <width>129</width> |
256 | <height>21</height> | 256 | <height>21</height> |
257 | </rect> | 257 | </rect> |
258 | </property> | 258 | </property> |
259 | <property stdset="1"> | 259 | <property stdset="1"> |
260 | <name>text</name> | 260 | <name>text</name> |
261 | <string>Specify &Channel</string> | 261 | <string>Specify &Channel</string> |
262 | </property> | 262 | </property> |
263 | </widget> | 263 | </widget> |
264 | <spacer> | 264 | <spacer> |
265 | <property> | 265 | <property> |
266 | <name>name</name> | 266 | <name>name</name> |
267 | <cstring>Spacer10</cstring> | 267 | <cstring>Spacer10</cstring> |
268 | </property> | 268 | </property> |
269 | <property stdset="1"> | 269 | <property stdset="1"> |
270 | <name>orientation</name> | 270 | <name>orientation</name> |
271 | <enum>Horizontal</enum> | 271 | <enum>Horizontal</enum> |
272 | </property> | 272 | </property> |
273 | <property stdset="1"> | 273 | <property stdset="1"> |
274 | <name>sizeType</name> | 274 | <name>sizeType</name> |
275 | <enum>Expanding</enum> | 275 | <enum>Expanding</enum> |
276 | </property> | 276 | </property> |
277 | <property> | 277 | <property> |
278 | <name>sizeHint</name> | 278 | <name>sizeHint</name> |
279 | <size> | 279 | <size> |
280 | <width>20</width> | 280 | <width>20</width> |
281 | <height>20</height> | 281 | <height>20</height> |
282 | </size> | 282 | </size> |
283 | </property> | 283 | </property> |
284 | </spacer> | 284 | </spacer> |
285 | <widget> | 285 | <widget> |
286 | <class>QComboBox</class> | 286 | <class>QComboBox</class> |
287 | <item> | 287 | <item> |
288 | <property> | 288 | <property> |
289 | <name>text</name> | 289 | <name>text</name> |
290 | <string>Auto</string> | 290 | <string>any</string> |
291 | </property> | ||
292 | </item> | ||
293 | <item> | ||
294 | <property> | ||
295 | <name>text</name> | ||
296 | <string>Managed</string> | ||
297 | </property> | ||
298 | </item> | ||
299 | <item> | ||
300 | <property> | ||
301 | <name>text</name> | ||
302 | <string>Ad-Hoc</string> | ||
303 | </property> | 291 | </property> |
304 | </item> | 292 | </item> |
305 | <property stdset="1"> | 293 | <property stdset="1"> |
306 | <name>name</name> | 294 | <name>name</name> |
307 | <cstring>mode</cstring> | 295 | <cstring>essid</cstring> |
308 | </property> | ||
309 | <property stdset="1"> | ||
310 | <name>enabled</name> | ||
311 | <bool>true</bool> | ||
312 | </property> | 296 | </property> |
313 | <property stdset="1"> | 297 | <property stdset="1"> |
314 | <name>geometry</name> | 298 | <name>geometry</name> |
315 | <rect> | 299 | <rect> |
316 | <x>101</x> | 300 | <x>101</x> |
317 | <y>11</y> | 301 | <y>46</y> |
318 | <width>103</width> | 302 | <width>103</width> |
319 | <height>29</height> | 303 | <height>29</height> |
320 | </rect> | 304 | </rect> |
321 | </property> | 305 | </property> |
322 | <property stdset="1"> | 306 | <property stdset="1"> |
323 | <name>sizePolicy</name> | 307 | <name>sizePolicy</name> |
324 | <sizepolicy> | 308 | <sizepolicy> |
325 | <hsizetype>1</hsizetype> | 309 | <hsizetype>7</hsizetype> |
326 | <vsizetype>0</vsizetype> | 310 | <vsizetype>0</vsizetype> |
327 | </sizepolicy> | 311 | </sizepolicy> |
328 | </property> | 312 | </property> |
313 | <property stdset="1"> | ||
314 | <name>editable</name> | ||
315 | <bool>true</bool> | ||
316 | </property> | ||
317 | <property stdset="1"> | ||
318 | <name>currentItem</name> | ||
319 | <number>0</number> | ||
320 | </property> | ||
321 | <property stdset="1"> | ||
322 | <name>sizeLimit</name> | ||
323 | <number>5</number> | ||
324 | </property> | ||
325 | <property stdset="1"> | ||
326 | <name>autoCompletion</name> | ||
327 | <bool>true</bool> | ||
328 | </property> | ||
329 | <property stdset="1"> | ||
330 | <name>duplicatesEnabled</name> | ||
331 | <bool>false</bool> | ||
332 | </property> | ||
329 | </widget> | 333 | </widget> |
330 | <widget> | 334 | <widget> |
331 | <class>QComboBox</class> | 335 | <class>QComboBox</class> |
332 | <item> | 336 | <item> |
333 | <property> | 337 | <property> |
334 | <name>text</name> | 338 | <name>text</name> |
335 | <string>any</string> | 339 | <string>Infrastructure</string> |
340 | </property> | ||
341 | </item> | ||
342 | <item> | ||
343 | <property> | ||
344 | <name>text</name> | ||
345 | <string>Auto</string> | ||
346 | </property> | ||
347 | </item> | ||
348 | <item> | ||
349 | <property> | ||
350 | <name>text</name> | ||
351 | <string>Managed</string> | ||
352 | </property> | ||
353 | </item> | ||
354 | <item> | ||
355 | <property> | ||
356 | <name>text</name> | ||
357 | <string>Ad-Hoc</string> | ||
336 | </property> | 358 | </property> |
337 | </item> | 359 | </item> |
338 | <property stdset="1"> | 360 | <property stdset="1"> |
339 | <name>name</name> | 361 | <name>name</name> |
340 | <cstring>essid</cstring> | 362 | <cstring>mode</cstring> |
363 | </property> | ||
364 | <property stdset="1"> | ||
365 | <name>enabled</name> | ||
366 | <bool>true</bool> | ||
341 | </property> | 367 | </property> |
342 | <property stdset="1"> | 368 | <property stdset="1"> |
343 | <name>geometry</name> | 369 | <name>geometry</name> |
344 | <rect> | 370 | <rect> |
345 | <x>101</x> | 371 | <x>101</x> |
346 | <y>46</y> | 372 | <y>11</y> |
347 | <width>103</width> | 373 | <width>103</width> |
348 | <height>29</height> | 374 | <height>29</height> |
349 | </rect> | 375 | </rect> |
350 | </property> | 376 | </property> |
351 | <property stdset="1"> | 377 | <property stdset="1"> |
352 | <name>sizePolicy</name> | 378 | <name>sizePolicy</name> |
353 | <sizepolicy> | 379 | <sizepolicy> |
354 | <hsizetype>7</hsizetype> | 380 | <hsizetype>1</hsizetype> |
355 | <vsizetype>0</vsizetype> | 381 | <vsizetype>0</vsizetype> |
356 | </sizepolicy> | 382 | </sizepolicy> |
357 | </property> | 383 | </property> |
358 | <property stdset="1"> | ||
359 | <name>editable</name> | ||
360 | <bool>true</bool> | ||
361 | </property> | ||
362 | <property stdset="1"> | ||
363 | <name>currentItem</name> | ||
364 | <number>0</number> | ||
365 | </property> | ||
366 | <property stdset="1"> | ||
367 | <name>sizeLimit</name> | ||
368 | <number>5</number> | ||
369 | </property> | ||
370 | <property stdset="1"> | ||
371 | <name>autoCompletion</name> | ||
372 | <bool>true</bool> | ||
373 | </property> | ||
374 | <property stdset="1"> | ||
375 | <name>duplicatesEnabled</name> | ||
376 | <bool>false</bool> | ||
377 | </property> | ||
378 | </widget> | 384 | </widget> |
379 | </widget> | 385 | </widget> |
380 | <widget> | 386 | <widget> |
381 | <class>QWidget</class> | 387 | <class>QWidget</class> |
382 | <property stdset="1"> | 388 | <property stdset="1"> |
383 | <name>name</name> | 389 | <name>name</name> |
384 | <cstring>WepPage</cstring> | 390 | <cstring>WepPage</cstring> |
385 | </property> | 391 | </property> |
386 | <attribute> | 392 | <attribute> |
387 | <name>title</name> | 393 | <name>title</name> |
388 | <string>Encryption</string> | 394 | <string>Encryption</string> |
389 | </attribute> | 395 | </attribute> |
390 | <grid> | 396 | <grid> |
391 | <property stdset="1"> | 397 | <property stdset="1"> |
392 | <name>margin</name> | 398 | <name>margin</name> |
393 | <number>11</number> | 399 | <number>11</number> |
394 | </property> | 400 | </property> |
395 | <property stdset="1"> | 401 | <property stdset="1"> |
396 | <name>spacing</name> | 402 | <name>spacing</name> |
397 | <number>6</number> | 403 | <number>6</number> |
398 | </property> | 404 | </property> |
399 | <widget row="0" column="0" > | 405 | <widget row="0" column="0" > |
400 | <class>QCheckBox</class> | 406 | <class>QCheckBox</class> |
401 | <property stdset="1"> | 407 | <property stdset="1"> |
402 | <name>name</name> | 408 | <name>name</name> |
403 | <cstring>wepEnabled</cstring> | 409 | <cstring>wepEnabled</cstring> |
404 | </property> | 410 | </property> |
405 | <property stdset="1"> | 411 | <property stdset="1"> |
406 | <name>text</name> | 412 | <name>text</name> |
407 | <string>&Enable Encryption</string> | 413 | <string>&Enable Encryption</string> |
408 | </property> | 414 | </property> |
409 | </widget> | 415 | </widget> |
410 | <widget row="1" column="0" > | 416 | <widget row="1" column="0" > |
411 | <class>QButtonGroup</class> | 417 | <class>QButtonGroup</class> |
412 | <property stdset="1"> | 418 | <property stdset="1"> |
413 | <name>name</name> | 419 | <name>name</name> |
414 | <cstring>KeyButtonGroup</cstring> | 420 | <cstring>KeyButtonGroup</cstring> |
415 | </property> | 421 | </property> |
416 | <property stdset="1"> | 422 | <property stdset="1"> |
417 | <name>enabled</name> | 423 | <name>enabled</name> |
418 | <bool>false</bool> | 424 | <bool>false</bool> |
419 | </property> | 425 | </property> |
420 | <property stdset="1"> | 426 | <property stdset="1"> |
421 | <name>title</name> | 427 | <name>title</name> |
422 | <string>&Key Setting</string> | 428 | <string>&Key Setting</string> |
423 | </property> | 429 | </property> |
424 | <grid> | 430 | <grid> |
425 | <property stdset="1"> | 431 | <property stdset="1"> |
426 | <name>margin</name> | 432 | <name>margin</name> |
427 | <number>11</number> | 433 | <number>11</number> |
428 | </property> | 434 | </property> |
429 | <property stdset="1"> | 435 | <property stdset="1"> |
430 | <name>spacing</name> | 436 | <name>spacing</name> |
431 | <number>6</number> | 437 | <number>6</number> |
432 | </property> | 438 | </property> |
433 | <widget row="0" column="0" > | 439 | <widget row="0" column="0" > |
434 | <class>QRadioButton</class> | 440 | <class>QRadioButton</class> |
435 | <property stdset="1"> | 441 | <property stdset="1"> |
436 | <name>name</name> | 442 | <name>name</name> |
437 | <cstring>keyRadio0</cstring> | 443 | <cstring>keyRadio0</cstring> |
438 | </property> | 444 | </property> |
439 | <property stdset="1"> | 445 | <property stdset="1"> |
440 | <name>text</name> | 446 | <name>text</name> |
441 | <string>Key &1</string> | 447 | <string>Key &1</string> |
442 | </property> | 448 | </property> |
443 | <property stdset="1"> | 449 | <property stdset="1"> |
444 | <name>checked</name> | 450 | <name>checked</name> |
445 | <bool>true</bool> | 451 | <bool>true</bool> |
446 | </property> | 452 | </property> |
447 | </widget> | 453 | </widget> |
448 | <widget row="1" column="0" > | 454 | <widget row="1" column="0" > |
449 | <class>QRadioButton</class> | 455 | <class>QRadioButton</class> |
450 | <property stdset="1"> | 456 | <property stdset="1"> |
451 | <name>name</name> | 457 | <name>name</name> |
452 | <cstring>keyRadio1</cstring> | 458 | <cstring>keyRadio1</cstring> |
453 | </property> | 459 | </property> |
454 | <property stdset="1"> | 460 | <property stdset="1"> |
455 | <name>text</name> | 461 | <name>text</name> |
456 | <string>Key &2</string> | 462 | <string>Key &2</string> |
457 | </property> | 463 | </property> |
458 | </widget> | 464 | </widget> |
459 | <widget row="2" column="0" > | 465 | <widget row="2" column="0" > |
460 | <class>QRadioButton</class> | 466 | <class>QRadioButton</class> |
461 | <property stdset="1"> | 467 | <property stdset="1"> |
462 | <name>name</name> | 468 | <name>name</name> |
463 | <cstring>keyRadio2</cstring> | 469 | <cstring>keyRadio2</cstring> |
464 | </property> | 470 | </property> |
465 | <property stdset="1"> | 471 | <property stdset="1"> |
466 | <name>text</name> | 472 | <name>text</name> |
467 | <string>Key &3</string> | 473 | <string>Key &3</string> |
468 | </property> | 474 | </property> |
469 | </widget> | 475 | </widget> |
470 | <widget row="3" column="0" > | 476 | <widget row="3" column="0" > |
471 | <class>QRadioButton</class> | 477 | <class>QRadioButton</class> |
472 | <property stdset="1"> | 478 | <property stdset="1"> |
473 | <name>name</name> | 479 | <name>name</name> |
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index cdafb4d..26e3aa9 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp | |||
@@ -1,269 +1,276 @@ | |||
1 | #include "wlanimp2.h" | 1 | #include "wlanimp2.h" |
2 | #include "keyedit.h" | 2 | #include "keyedit.h" |
3 | #include "interfacesetupimp.h" | 3 | #include "interfacesetupimp.h" |
4 | 4 | ||
5 | #include <qfile.h> | 5 | #include <qfile.h> |
6 | #include <qdir.h> | 6 | #include <qdir.h> |
7 | #include <qtextstream.h> | 7 | #include <qtextstream.h> |
8 | #include <qmessagebox.h> | 8 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
10 | #include <qlabel.h> | 10 | #include <qlabel.h> |
11 | #include <qspinbox.h> | 11 | #include <qspinbox.h> |
12 | #include <qradiobutton.h> | 12 | #include <qradiobutton.h> |
13 | #include <qcheckbox.h> | 13 | #include <qcheckbox.h> |
14 | #include <qtabwidget.h> | 14 | #include <qtabwidget.h> |
15 | #include <qcombobox.h> | 15 | #include <qcombobox.h> |
16 | 16 | ||
17 | #ifdef QWS | 17 | #ifdef QWS |
18 | #include <opie/oprocess.h> | 18 | #include <opie/oprocess.h> |
19 | #else | 19 | #else |
20 | #define OProcess KProcess | 20 | #define OProcess KProcess |
21 | #include <kprocess.h> | 21 | #include <kprocess.h> |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" | 24 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" |
25 | #define PREUP "/etc/netwrok/if-pre-up.d/wireless-tools" | 25 | #define PREUP "/etc/netwrok/if-pre-up.d/wireless-tools" |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * Constructor, read in the wireless.opts file for parsing later. | 28 | * Constructor, read in the wireless.opts file for parsing later. |
29 | */ | 29 | */ |
30 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) { | 30 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") { |
31 | interfaces = new Interfaces(); | 31 | interfaces = new Interfaces(); |
32 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); | 32 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); |
33 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); | 33 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); |
34 | 34 | ||
35 | // Check sanity - the existance of the wireless-tools if-pre-up script | 35 | // Check sanity - the existance of the wireless-tools if-pre-up script |
36 | QFile file(QString(PREUP)); | 36 | QFile file(QString(PREUP)); |
37 | if (file.exists()) { | 37 | if (file.exists()) { |
38 | qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); | 38 | qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); |
39 | } | 39 | } |
40 | } | 40 | } |
41 | 41 | ||
42 | WLANImp::~WLANImp() { | 42 | WLANImp::~WLANImp() { |
43 | //FIXME: delete interfaces; | 43 | //FIXME: delete interfaces; |
44 | } | 44 | } |
45 | 45 | ||
46 | /** | 46 | /** |
47 | * Change the profile for both wireless settings and network settings. | 47 | * Change the profile for both wireless settings and network settings. |
48 | */ | 48 | */ |
49 | void WLANImp::setProfile(const QString &profile){ | 49 | void WLANImp::setProfile(const QString &profile){ |
50 | interfaceSetup->setProfile(profile); | 50 | interfaceSetup->setProfile(profile); |
51 | parseOpts(); | 51 | parseOpts(); |
52 | } | 52 | } |
53 | 53 | ||
54 | void WLANImp::parseOpts() { | 54 | void WLANImp::parseOpts() { |
55 | bool error; | 55 | bool error; |
56 | QString opt; | 56 | QString opt; |
57 | 57 | ||
58 | if (! interfaces->isInterfaceSet()) | 58 | if (! interfaces->isInterfaceSet()) |
59 | return; | 59 | return; |
60 | 60 | ||
61 | 61 | ||
62 | opt = interfaces->getInterfaceOption("wireless_essid", error); | 62 | opt = interfaces->getInterfaceOption("wireless_essid", error); |
63 | if(opt == "any" || opt == "off" || opt.isNull()){ | 63 | if(opt == "any" || opt == "off" || opt.isNull()){ |
64 | essid->setEditText("any"); | 64 | essid->setEditText("any"); |
65 | } else { | 65 | } else { |
66 | essid->setEditText(opt); | 66 | essid->setEditText(opt); |
67 | } | 67 | } |
68 | 68 | ||
69 | opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace(); | 69 | opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace(); |
70 | if (opt == "Auto") { | 70 | |
71 | mode->setCurrentItem(0); | 71 | for ( int i = 0; i < mode->count(); i++) |
72 | } else if (opt == "Ad-Hoc") { | 72 | if ( mode->text( i ) == opt ) mode->setCurrentItem( i ); |
73 | mode->setCurrentItem(2); | ||
74 | } else { | ||
75 | // Managed/Infrastructure mode | ||
76 | mode->setCurrentItem(1); | ||
77 | } | ||
78 | 73 | ||
79 | opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); | 74 | opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); |
80 | if (! opt.isNull()) { | 75 | if (! opt.isNull()) { |
81 | specifyAp->setChecked(true); | 76 | specifyAp->setChecked(true); |
82 | macEdit->setText(opt); | 77 | macEdit->setText(opt); |
83 | } | 78 | } |
84 | 79 | ||
85 | opt = interfaces->getInterfaceOption("wireless_channel", error).simplifyWhiteSpace(); | 80 | opt = interfaces->getInterfaceOption("wireless_channel", error).simplifyWhiteSpace(); |
86 | if (! opt.isNull()) { | 81 | if (! opt.isNull()) { |
87 | specifyChan->setChecked(true); | 82 | specifyChan->setChecked(true); |
88 | networkChannel->setValue(opt.toInt()); | 83 | networkChannel->setValue(opt.toInt()); |
89 | } | 84 | } |
90 | 85 | ||
91 | opt = interfaces->getInterfaceOption("wireless_key", error).simplifyWhiteSpace(); | 86 | opt = interfaces->getInterfaceOption("wireless_key", error).simplifyWhiteSpace(); |
92 | if (opt.isNull()) | 87 | if (opt.isNull()) |
93 | opt = interfaces->getInterfaceOption("wireless_enc", error).simplifyWhiteSpace(); | 88 | opt = interfaces->getInterfaceOption("wireless_enc", error).simplifyWhiteSpace(); |
94 | parseKeyStr(opt); | 89 | parseKeyStr(opt); |
95 | } | 90 | } |
96 | 91 | ||
97 | void WLANImp::parseKeyStr(QString keystr) { | 92 | void WLANImp::parseKeyStr(QString keystr) { |
98 | int loc = 0; | 93 | int loc = 0; |
99 | int index = 1; | 94 | int index = 1; |
100 | QString key; | 95 | QString key; |
101 | QStringList keys = QStringList::split(QRegExp("\\s+"), keystr); | 96 | QStringList keys = QStringList::split(QRegExp("\\s+"), keystr); |
102 | int enc = -1; // encryption state | 97 | int enc = -1; // encryption state |
103 | 98 | ||
104 | for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) { | 99 | for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) { |
105 | if ((*it).left(3) == "off") { | 100 | if ((*it).left(3) == "off") { |
106 | // encryption disabled | 101 | // encryption disabled |
107 | enc = 0; | 102 | enc = 0; |
108 | } else if ((*it).left(2) == "on") { | 103 | } else if ((*it).left(2) == "on") { |
109 | // encryption enabled | 104 | // encryption enabled |
110 | enc = 1; | 105 | enc = 1; |
111 | } else if ((*it).left(4) == "open") { | 106 | } else if ((*it).left(4) == "open") { |
112 | // open mode, accept non encrypted packets | 107 | // open mode, accept non encrypted packets |
113 | acceptNonEnc->setChecked(true); | 108 | acceptNonEnc->setChecked(true); |
114 | } else if ((*it).left(10) == "restricted") { | 109 | } else if ((*it).left(10) == "restricted") { |
115 | // restricted mode, only accept encrypted packets | 110 | // restricted mode, only accept encrypted packets |
116 | rejectNonEnc->setChecked(true); | 111 | rejectNonEnc->setChecked(true); |
117 | } else if ((*it).left(3) == "key") { | 112 | } else if ((*it).left(3) == "key") { |
118 | // new set of options | 113 | // new set of options |
119 | } else if ((*it).left(1) == "[") { | 114 | } else if ((*it).left(1) == "[") { |
120 | index = (*it).mid(1, 1).toInt(); | 115 | index = (*it).mid(1, 1).toInt(); |
121 | // switch current key to index | 116 | // switch current key to index |
122 | switch (index) { | 117 | switch (index) { |
123 | case 1: | 118 | case 1: |
124 | keyRadio0->setChecked(true); | 119 | keyRadio0->setChecked(true); |
125 | break; | 120 | break; |
126 | case 2: | 121 | case 2: |
127 | keyRadio1->setChecked(true); | 122 | keyRadio1->setChecked(true); |
128 | break; | 123 | break; |
129 | case 3: | 124 | case 3: |
130 | keyRadio2->setChecked(true); | 125 | keyRadio2->setChecked(true); |
131 | break; | 126 | break; |
132 | case 4: | 127 | case 4: |
133 | keyRadio3->setChecked(true); | 128 | keyRadio3->setChecked(true); |
134 | break; | 129 | break; |
135 | } | 130 | } |
136 | } else { | 131 | } else { |
137 | // key | 132 | // key |
138 | key = (*it); | 133 | key = (*it); |
139 | } | 134 | } |
140 | if (! key.isNull()) { | 135 | if (! key.isNull()) { |
141 | if (enc == -1) | 136 | if (enc == -1) |
142 | enc = 1; | 137 | enc = 1; |
143 | QStringList::Iterator next = ++it; | 138 | QStringList::Iterator next = ++it; |
144 | if (it == keys.end()) { | 139 | if (it == keys.end()) { |
145 | break; | 140 | break; |
146 | } | 141 | } |
147 | if ((*(next)).left(1) == "[") { | 142 | if ((*(next)).left(1) == "[") { |
148 | // set key at index | 143 | // set key at index |
149 | index = (*(next)).mid(1, 1).toInt(); | 144 | index = (*(next)).mid(1, 1).toInt(); |
150 | } else { | 145 | } else { |
151 | index = 1; | 146 | index = 1; |
152 | } | 147 | } |
153 | switch (index) { | 148 | switch (index) { |
154 | case 1: | 149 | case 1: |
155 | keyLineEdit0->setText(key); | 150 | keyLineEdit0->setText(key); |
156 | break; | 151 | break; |
157 | case 2: | 152 | case 2: |
158 | keyLineEdit1->setText(key); | 153 | keyLineEdit1->setText(key); |
159 | break; | 154 | break; |
160 | case 3: | 155 | case 3: |
161 | keyLineEdit2->setText(key); | 156 | keyLineEdit2->setText(key); |
162 | break; | 157 | break; |
163 | case 4: | 158 | case 4: |
164 | keyLineEdit3->setText(key); | 159 | keyLineEdit3->setText(key); |
165 | break; | 160 | break; |
166 | } | 161 | } |
167 | key = QString::null; | 162 | key = QString::null; |
168 | } | 163 | } |
169 | } | 164 | } |
170 | if (enc == 1) { | 165 | if (enc == 1) { |
171 | wepEnabled->setChecked(true); | 166 | wepEnabled->setChecked(true); |
172 | } else { | 167 | } else { |
173 | wepEnabled->setChecked(false); | 168 | wepEnabled->setChecked(false); |
174 | } | 169 | } |
175 | } | 170 | } |
176 | 171 | ||
177 | /** | 172 | /** |
178 | * Check to see if the current config is valid | 173 | * Check to see if the current config is valid |
179 | * Save interfaces | 174 | * Save interfaces |
180 | */ | 175 | */ |
181 | void WLANImp::accept() { | 176 | void WLANImp::accept() { |
182 | if (wepEnabled->isChecked()) { | 177 | if (wepEnabled->isChecked()) { |
183 | if ((keyRadio0->isChecked() && keyLineEdit0->text().isEmpty()) || | 178 | if ((keyRadio0->isChecked() && keyLineEdit0->text().isEmpty()) || |
184 | (keyRadio1->isChecked() && keyLineEdit1->text().isEmpty()) || | 179 | (keyRadio1->isChecked() && keyLineEdit1->text().isEmpty()) || |
185 | (keyRadio2->isChecked() && keyLineEdit2->text().isEmpty()) || | 180 | (keyRadio2->isChecked() && keyLineEdit2->text().isEmpty()) || |
186 | (keyRadio3->isChecked() && keyLineEdit3->text().isEmpty())) { | 181 | (keyRadio3->isChecked() && keyLineEdit3->text().isEmpty())) { |
187 | QMessageBox::information(this, "Error", "Please enter a WEP key.", QMessageBox::Ok); | 182 | QMessageBox::information(this, "Error", "Please enter a WEP key.", QMessageBox::Ok); |
188 | return; | 183 | return; |
189 | } | 184 | } |
190 | } | 185 | } |
191 | 186 | ||
192 | if (essid->currentText().isEmpty()) { | 187 | if (essid->currentText().isEmpty()) { |
193 | QMessageBox::information(this, "Error", "Please select/enter an ESSID.", QMessageBox::Ok); | 188 | QMessageBox::information(this, "Error", "Please select/enter an ESSID.", QMessageBox::Ok); |
194 | return; | 189 | return; |
195 | } | 190 | } |
196 | 191 | ||
197 | if (specifyAp->isChecked() && macEdit->text().isEmpty()) { | 192 | if (specifyAp->isChecked() && macEdit->text().isEmpty()) { |
198 | QMessageBox::information(this, "Error", "Please enter the MAC address of the Access Point.", QMessageBox::Ok); | 193 | QMessageBox::information(this, "Error", "Please enter the MAC address of the Access Point.", QMessageBox::Ok); |
199 | return; | 194 | return; |
200 | } | 195 | } |
201 | 196 | ||
202 | // Try to save the interfaces settings. | 197 | // Try to save the interfaces settings. |
203 | writeOpts(); | 198 | writeOpts(); |
204 | 199 | ||
205 | // Close out the dialog | 200 | // Close out the dialog |
206 | QDialog::accept(); | 201 | // FIXME: QDialog::accept(); |
207 | } | 202 | } |
208 | 203 | ||
209 | void WLANImp::writeOpts() { | 204 | void WLANImp::writeOpts() { |
210 | bool error = false; | 205 | // eh can't really do anything about it other then return. :-D |
206 | if(!interfaces->isInterfaceSet()){ | ||
207 | QMessageBox::warning(0,"Inface not set","should not happen!!!"); | ||
208 | return; | ||
209 | } | ||
210 | bool error = false; | ||
211 | |||
212 | qDebug("setting wlan interface %s", interfaces->getInterfaceName( error ).latin1() ); | ||
213 | |||
214 | if (error) QMessageBox::warning(0,"Inface not set","should not happen!!!"); | ||
211 | 215 | ||
212 | interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); | 216 | interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); |
213 | interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); | 217 | interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); |
214 | 218 | ||
215 | if (specifyAp->isChecked()) { | 219 | if (specifyAp->isChecked()) { |
216 | interfaces->setInterfaceOption(QString("wireless_ap"), macEdit->text()); | 220 | interfaces->setInterfaceOption(QString("wireless_ap"), macEdit->text()); |
217 | } else { | 221 | } else { |
218 | interfaces->removeInterfaceOption(QString("wireless_ap")); | 222 | interfaces->removeInterfaceOption(QString("wireless_ap")); |
219 | } | 223 | } |
220 | 224 | ||
221 | if (specifyChan->isChecked()) { | 225 | if (specifyChan->isChecked()) { |
222 | interfaces->setInterfaceOption(QString("wireless_channel"), networkChannel->text()); | 226 | interfaces->setInterfaceOption(QString("wireless_channel"), networkChannel->text()); |
223 | } else { | 227 | } else { |
224 | interfaces->removeInterfaceOption(QString("wireless_channel")); | 228 | interfaces->removeInterfaceOption(QString("wireless_channel")); |
225 | } | 229 | } |
226 | 230 | ||
227 | if (wepEnabled->isChecked()) { | 231 | if (wepEnabled->isChecked()) { |
228 | QStringList keyList; | 232 | QStringList keyList; |
229 | 233 | ||
230 | if (! keyLineEdit0->text().isNull()) { | 234 | if (! keyLineEdit0->text().isNull()) { |
231 | keyList += keyLineEdit0->text(); | 235 | keyList += keyLineEdit0->text(); |
232 | keyList += "[1]"; | 236 | keyList += "[1]"; |
233 | } else if (! keyLineEdit1->text().isNull()) { | 237 | } //else |
238 | if (! keyLineEdit1->text().isNull()) { | ||
234 | keyList += keyLineEdit1->text(); | 239 | keyList += keyLineEdit1->text(); |
235 | keyList += "[2]"; | 240 | keyList += "[2]"; |
236 | } else if (! keyLineEdit2->text().isNull()) { | 241 | } //else |
242 | if (! keyLineEdit2->text().isNull()) { | ||
237 | keyList += keyLineEdit2->text(); | 243 | keyList += keyLineEdit2->text(); |
238 | keyList += "[3]"; | 244 | keyList += "[3]"; |
239 | } else if (! keyLineEdit3->text().isNull()) { | 245 | } //else |
246 | if (! keyLineEdit3->text().isNull()) { | ||
240 | keyList += keyLineEdit3->text(); | 247 | keyList += keyLineEdit3->text(); |
241 | keyList += "[4]"; | 248 | keyList += "[4]"; |
242 | } | 249 | } |
243 | if (acceptNonEnc->isChecked()) { | 250 | if (acceptNonEnc->isChecked()) { |
244 | keyList += "open"; | 251 | keyList += "open"; |
245 | } else { | 252 | } else { |
246 | keyList += "restricted"; | 253 | keyList += "restricted"; |
247 | } | 254 | } |
248 | 255 | ||
249 | keyList += "key"; | 256 | keyList += "key"; |
250 | if (keyRadio0->isChecked()) { | 257 | if (keyRadio0->isChecked()) { |
251 | keyList += "[1]"; | 258 | keyList += "[1]"; |
252 | } else if (keyRadio1->isChecked()) { | 259 | } else if (keyRadio1->isChecked()) { |
253 | keyList += "[2]"; | 260 | keyList += "[2]"; |
254 | } else if (keyRadio2->isChecked()) { | 261 | } else if (keyRadio2->isChecked()) { |
255 | keyList += "[3]"; | 262 | keyList += "[3]"; |
256 | } else if (keyRadio3->isChecked()) { | 263 | } else if (keyRadio3->isChecked()) { |
257 | keyList += "[4]"; | 264 | keyList += "[4]"; |
258 | } | 265 | } |
259 | interfaces->setInterfaceOption(QString("wireless_key"), keyList.join(QString(" "))); | 266 | interfaces->setInterfaceOption(QString("wireless_key"), keyList.join(QString(" "))); |
260 | } else { | 267 | } else { |
261 | interfaces->removeInterfaceOption(QString("wireless_key")); | 268 | interfaces->removeInterfaceOption(QString("wireless_key")); |
262 | } | 269 | } |
263 | interfaces->removeInterfaceOption(QString("wireless_enc")); | 270 | interfaces->removeInterfaceOption(QString("wireless_enc")); |
264 | 271 | ||
265 | if(!interfaceSetup->saveChanges()) | 272 | if(!interfaceSetup->saveChanges()) |
266 | return; | 273 | return; |
267 | 274 | ||
268 | QDialog::accept(); | 275 | QDialog::accept(); |
269 | } | 276 | } |
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index a4488f9..b4c3509 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp | |||
@@ -1,98 +1,98 @@ | |||
1 | #include "wlanmodule.h" | 1 | #include "wlanmodule.h" |
2 | #include "wlanimp.h" | 2 | #include "wlanimp2.h" |
3 | #include "infoimp.h" | 3 | #include "infoimp.h" |
4 | #include "wextensions.h" | 4 | #include "wextensions.h" |
5 | #include "interfaceinformationimp.h" | 5 | #include "interfaceinformationimp.h" |
6 | 6 | ||
7 | #include <qcheckbox.h> | 7 | #include <qcheckbox.h> |
8 | #include <qcombobox.h> | 8 | #include <qcombobox.h> |
9 | #include <qlabel.h> | 9 | #include <qlabel.h> |
10 | #include <qlineedit.h> | 10 | #include <qlineedit.h> |
11 | #include <qprogressbar.h> | 11 | #include <qprogressbar.h> |
12 | #include <qspinbox.h> | 12 | #include <qspinbox.h> |
13 | #include <qtabwidget.h> | 13 | #include <qtabwidget.h> |
14 | 14 | ||
15 | 15 | ||
16 | 16 | ||
17 | 17 | ||
18 | /** | 18 | /** |
19 | * Constructor, find all of the possible interfaces | 19 | * Constructor, find all of the possible interfaces |
20 | */ | 20 | */ |
21 | WLANModule::WLANModule() | 21 | WLANModule::WLANModule() |
22 | : Module(), | 22 | : Module(), |
23 | wlanconfigWiget(0) | 23 | wlanconfigWiget(0) |
24 | { | 24 | { |
25 | } | 25 | } |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * Delete any interfaces that we own. | 28 | * Delete any interfaces that we own. |
29 | */ | 29 | */ |
30 | WLANModule::~WLANModule(){ | 30 | WLANModule::~WLANModule(){ |
31 | Interface *i; | 31 | Interface *i; |
32 | for ( i=list.first(); i != 0; i=list.next() ) | 32 | for ( i=list.first(); i != 0; i=list.next() ) |
33 | delete i; | 33 | delete i; |
34 | 34 | ||
35 | } | 35 | } |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * Change the current profile | 38 | * Change the current profile |
39 | */ | 39 | */ |
40 | void WLANModule::setProfile(const QString &newProfile){ | 40 | void WLANModule::setProfile(const QString &newProfile){ |
41 | profile = newProfile; | 41 | profile = newProfile; |
42 | } | 42 | } |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * get the icon name for this device. | 45 | * get the icon name for this device. |
46 | * @param Interface* can be used in determining the icon. | 46 | * @param Interface* can be used in determining the icon. |
47 | * @return QString the icon name (minus .png, .gif etc) | 47 | * @return QString the icon name (minus .png, .gif etc) |
48 | */ | 48 | */ |
49 | QString WLANModule::getPixmapName(Interface* ){ | 49 | QString WLANModule::getPixmapName(Interface* ){ |
50 | return "wlan"; | 50 | return "wlan"; |
51 | } | 51 | } |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Check to see if the interface i is owned by this module. | 54 | * Check to see if the interface i is owned by this module. |
55 | * @param Interface* interface to check against | 55 | * @param Interface* interface to check against |
56 | * @return bool true if i is owned by this module, false otherwise. | 56 | * @return bool true if i is owned by this module, false otherwise. |
57 | */ | 57 | */ |
58 | bool WLANModule::isOwner(Interface *i){ | 58 | bool WLANModule::isOwner(Interface *i){ |
59 | WExtensions we(i->getInterfaceName()); | 59 | WExtensions we(i->getInterfaceName()); |
60 | if(!we.doesHaveWirelessExtensions()) | 60 | if(!we.doesHaveWirelessExtensions()) |
61 | return false; | 61 | return false; |
62 | 62 | ||
63 | i->setHardwareName("802.11b"); | 63 | i->setHardwareName("802.11b"); |
64 | list.append(i); | 64 | list.append(i); |
65 | return true; | 65 | return true; |
66 | } | 66 | } |
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Create, and return the WLANConfigure Module | 69 | * Create, and return the WLANConfigure Module |
70 | * @return QWidget* pointer to this modules configure. | 70 | * @return QWidget* pointer to this modules configure. |
71 | */ | 71 | */ |
72 | QWidget *WLANModule::configure(Interface *i){ | 72 | QWidget *WLANModule::configure(Interface *i){ |
73 | WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, Qt::WDestructiveClose); | 73 | WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, true, Qt::WDestructiveClose); |
74 | wlanconfig->setProfile(profile); | 74 | wlanconfig->setProfile(profile); |
75 | return wlanconfig; | 75 | return wlanconfig; |
76 | } | 76 | } |
77 | 77 | ||
78 | /** | 78 | /** |
79 | * Create, and return the Information Module | 79 | * Create, and return the Information Module |
80 | * @return QWidget* pointer to this modules info. | 80 | * @return QWidget* pointer to this modules info. |
81 | */ | 81 | */ |
82 | QWidget *WLANModule::information(Interface *i){ | 82 | QWidget *WLANModule::information(Interface *i){ |
83 | WExtensions we(i->getInterfaceName()); | 83 | WExtensions we(i->getInterfaceName()); |
84 | if(!we.doesHaveWirelessExtensions()) | 84 | if(!we.doesHaveWirelessExtensions()) |
85 | return NULL; | 85 | return NULL; |
86 | 86 | ||
87 | return getInfo( i ); | 87 | return getInfo( i ); |
88 | } | 88 | } |
89 | 89 | ||
90 | /** | 90 | /** |
91 | * Get all active (up or down) interfaces | 91 | * Get all active (up or down) interfaces |
92 | * @return QList<Interface> A list of interfaces that exsist that havn't | 92 | * @return QList<Interface> A list of interfaces that exsist that havn't |
93 | * been called by isOwner() | 93 | * been called by isOwner() |
94 | */ | 94 | */ |
95 | QList<Interface> WLANModule::getInterfaces(){ | 95 | QList<Interface> WLANModule::getInterfaces(){ |
96 | return list; | 96 | return list; |
97 | } | 97 | } |
98 | 98 | ||