Diffstat (limited to 'noncore/net/networksetup/wlan') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/wlan/wlan.ui | 173 | ||||
-rw-r--r-- | noncore/net/networksetup/wlan/wlanimp.cpp | 45 | ||||
-rw-r--r-- | noncore/net/networksetup/wlan/wlanimp.h | 3 |
3 files changed, 106 insertions, 115 deletions
diff --git a/noncore/net/networksetup/wlan/wlan.ui b/noncore/net/networksetup/wlan/wlan.ui index 47d6db6..09593b3 100644 --- a/noncore/net/networksetup/wlan/wlan.ui +++ b/noncore/net/networksetup/wlan/wlan.ui | |||
@@ -2,26 +2,26 @@ | |||
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>237</width> | 14 | <width>239</width> |
15 | <height>286</height> | 15 | <height>277</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 LAN Setting</string> | 20 | <string>Wireless LAN Setting</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> |
@@ -56,168 +56,143 @@ | |||
56 | <string>WLAN General</string> | 56 | <string>WLAN General</string> |
57 | </attribute> | 57 | </attribute> |
58 | <vbox> | 58 | <vbox> |
59 | <property stdset="1"> | 59 | <property stdset="1"> |
60 | <name>margin</name> | 60 | <name>margin</name> |
61 | <number>11</number> | 61 | <number>11</number> |
62 | </property> | 62 | </property> |
63 | <property stdset="1"> | 63 | <property stdset="1"> |
64 | <name>spacing</name> | 64 | <name>spacing</name> |
65 | <number>6</number> | 65 | <number>6</number> |
66 | </property> | 66 | </property> |
67 | <widget> | 67 | <widget> |
68 | <class>QButtonGroup</class> | 68 | <class>QCheckBox</class> |
69 | <property stdset="1"> | ||
70 | <name>name</name> | ||
71 | <cstring>essAny</cstring> | ||
72 | </property> | ||
73 | <property stdset="1"> | ||
74 | <name>text</name> | ||
75 | <string>Sepecify Access Point</string> | ||
76 | </property> | ||
77 | </widget> | ||
78 | <widget> | ||
79 | <class>QGroupBox</class> | ||
69 | <property stdset="1"> | 80 | <property stdset="1"> |
70 | <name>name</name> | 81 | <name>name</name> |
71 | <cstring>ButtonGroup45</cstring> | 82 | <cstring>GroupBox1</cstring> |
83 | </property> | ||
84 | <property stdset="1"> | ||
85 | <name>enabled</name> | ||
86 | <bool>false</bool> | ||
72 | </property> | 87 | </property> |
73 | <property stdset="1"> | 88 | <property stdset="1"> |
74 | <name>title</name> | 89 | <name>title</name> |
75 | <string>ESS ID</string> | 90 | <string>Settings</string> |
76 | </property> | 91 | </property> |
77 | <vbox> | 92 | <grid> |
78 | <property stdset="1"> | 93 | <property stdset="1"> |
79 | <name>margin</name> | 94 | <name>margin</name> |
80 | <number>11</number> | 95 | <number>11</number> |
81 | </property> | 96 | </property> |
82 | <property stdset="1"> | 97 | <property stdset="1"> |
83 | <name>spacing</name> | 98 | <name>spacing</name> |
84 | <number>6</number> | 99 | <number>6</number> |
85 | </property> | 100 | </property> |
86 | <widget> | 101 | <widget row="0" column="0" > |
87 | <class>QRadioButton</class> | 102 | <class>QLabel</class> |
88 | <property stdset="1"> | 103 | <property stdset="1"> |
89 | <name>name</name> | 104 | <name>name</name> |
90 | <cstring>essNon</cstring> | 105 | <cstring>TextLabel1</cstring> |
91 | </property> | 106 | </property> |
92 | <property stdset="1"> | 107 | <property stdset="1"> |
93 | <name>text</name> | 108 | <name>text</name> |
94 | <string>Non-Spec ESSID: "ANY"</string> | 109 | <string>ESS-ID</string> |
95 | </property> | ||
96 | <property stdset="1"> | ||
97 | <name>checked</name> | ||
98 | <bool>true</bool> | ||
99 | </property> | 110 | </property> |
100 | </widget> | 111 | </widget> |
101 | <widget> | 112 | <widget row="1" column="0" > |
102 | <class>QRadioButton</class> | 113 | <class>QLabel</class> |
103 | <property stdset="1"> | 114 | <property stdset="1"> |
104 | <name>name</name> | 115 | <name>name</name> |
105 | <cstring>essSpecific</cstring> | 116 | <cstring>TextLabel2_2</cstring> |
106 | </property> | 117 | </property> |
107 | <property stdset="1"> | 118 | <property stdset="1"> |
108 | <name>text</name> | 119 | <name>text</name> |
109 | <string>Specific ESSID</string> | 120 | <string>Network Type</string> |
110 | </property> | 121 | </property> |
111 | </widget> | 122 | </widget> |
112 | <widget> | 123 | <widget row="0" column="1" rowspan="1" colspan="2" > |
113 | <class>QLineEdit</class> | 124 | <class>QLineEdit</class> |
114 | <property stdset="1"> | 125 | <property stdset="1"> |
115 | <name>name</name> | 126 | <name>name</name> |
116 | <cstring>essSpecificLineEdit</cstring> | 127 | <cstring>essSpecificLineEdit</cstring> |
117 | </property> | 128 | </property> |
118 | <property stdset="1"> | ||
119 | <name>enabled</name> | ||
120 | <bool>false</bool> | ||
121 | </property> | ||
122 | </widget> | 129 | </widget> |
123 | </vbox> | 130 | <widget row="1" column="1" rowspan="1" colspan="2" > |
124 | </widget> | 131 | <class>QComboBox</class> |
125 | <widget> | 132 | <item> |
126 | <class>QButtonGroup</class> | 133 | <property> |
127 | <property stdset="1"> | 134 | <name>text</name> |
128 | <name>name</name> | 135 | <string>Infrastructure</string> |
129 | <cstring>ButtonGroup46</cstring> | 136 | </property> |
130 | </property> | 137 | </item> |
131 | <property stdset="1"> | 138 | <item> |
132 | <name>title</name> | 139 | <property> |
133 | <string>Network Type</string> | 140 | <name>text</name> |
134 | </property> | 141 | <string>Ad-Hoc</string> |
135 | <grid> | 142 | </property> |
136 | <property stdset="1"> | 143 | </item> |
137 | <name>margin</name> | ||
138 | <number>11</number> | ||
139 | </property> | ||
140 | <property stdset="1"> | ||
141 | <name>spacing</name> | ||
142 | <number>6</number> | ||
143 | </property> | ||
144 | <widget row="0" column="0" rowspan="1" colspan="3" > | ||
145 | <class>QRadioButton</class> | ||
146 | <property stdset="1"> | 144 | <property stdset="1"> |
147 | <name>name</name> | 145 | <name>name</name> |
148 | <cstring>networkInfrastructure</cstring> | 146 | <cstring>networkType</cstring> |
149 | </property> | ||
150 | <property stdset="1"> | ||
151 | <name>text</name> | ||
152 | <string>Infrastructure</string> | ||
153 | </property> | ||
154 | <property stdset="1"> | ||
155 | <name>checked</name> | ||
156 | <bool>true</bool> | ||
157 | </property> | 147 | </property> |
158 | </widget> | 148 | </widget> |
159 | <widget row="2" column="0" > | 149 | <widget row="2" column="0" > |
160 | <class>QLabel</class> | 150 | <class>QLabel</class> |
161 | <property stdset="1"> | 151 | <property stdset="1"> |
162 | <name>name</name> | 152 | <name>name</name> |
163 | <cstring>TextLabel2</cstring> | 153 | <cstring>channelLabel</cstring> |
164 | </property> | ||
165 | <property stdset="1"> | ||
166 | <name>enabled</name> | ||
167 | <bool>false</bool> | ||
168 | </property> | 154 | </property> |
169 | <property stdset="1"> | 155 | <property stdset="1"> |
170 | <name>text</name> | 156 | <name>text</name> |
171 | <string>Channel</string> | 157 | <string>Channel</string> |
172 | </property> | 158 | </property> |
173 | </widget> | 159 | </widget> |
174 | <widget row="1" column="0" rowspan="1" colspan="2" > | ||
175 | <class>QRadioButton</class> | ||
176 | <property stdset="1"> | ||
177 | <name>name</name> | ||
178 | <cstring>network802</cstring> | ||
179 | </property> | ||
180 | <property stdset="1"> | ||
181 | <name>text</name> | ||
182 | <string>Ad-Hoc</string> | ||
183 | </property> | ||
184 | </widget> | ||
185 | <widget row="2" column="1" > | 160 | <widget row="2" column="1" > |
186 | <class>QSpinBox</class> | 161 | <class>QSpinBox</class> |
187 | <property stdset="1"> | 162 | <property stdset="1"> |
188 | <name>name</name> | 163 | <name>name</name> |
189 | <cstring>networkChannel</cstring> | 164 | <cstring>networkChannel</cstring> |
190 | </property> | 165 | </property> |
191 | <property stdset="1"> | 166 | <property stdset="1"> |
192 | <name>enabled</name> | 167 | <name>enabled</name> |
193 | <bool>false</bool> | 168 | <bool>false</bool> |
194 | </property> | 169 | </property> |
195 | <property stdset="1"> | 170 | <property stdset="1"> |
196 | <name>maxValue</name> | 171 | <name>maxValue</name> |
197 | <number>11</number> | 172 | <number>15</number> |
198 | </property> | 173 | </property> |
199 | <property stdset="1"> | 174 | <property stdset="1"> |
200 | <name>minValue</name> | 175 | <name>minValue</name> |
201 | <number>1</number> | 176 | <number>1</number> |
202 | </property> | 177 | </property> |
203 | <property stdset="1"> | 178 | <property stdset="1"> |
204 | <name>value</name> | 179 | <name>value</name> |
205 | <number>6</number> | 180 | <number>6</number> |
206 | </property> | 181 | </property> |
207 | </widget> | 182 | </widget> |
208 | <spacer row="2" column="2" > | 183 | <spacer row="2" column="2" > |
209 | <property> | 184 | <property> |
210 | <name>name</name> | 185 | <name>name</name> |
211 | <cstring>Spacer32</cstring> | 186 | <cstring>Spacer4</cstring> |
212 | </property> | 187 | </property> |
213 | <property stdset="1"> | 188 | <property stdset="1"> |
214 | <name>orientation</name> | 189 | <name>orientation</name> |
215 | <enum>Horizontal</enum> | 190 | <enum>Horizontal</enum> |
216 | </property> | 191 | </property> |
217 | <property stdset="1"> | 192 | <property stdset="1"> |
218 | <name>sizeType</name> | 193 | <name>sizeType</name> |
219 | <enum>Expanding</enum> | 194 | <enum>Expanding</enum> |
220 | </property> | 195 | </property> |
221 | <property> | 196 | <property> |
222 | <name>sizeHint</name> | 197 | <name>sizeHint</name> |
223 | <size> | 198 | <size> |
@@ -327,70 +302,86 @@ | |||
327 | </property> | 302 | </property> |
328 | <property stdset="1"> | 303 | <property stdset="1"> |
329 | <name>text</name> | 304 | <name>text</name> |
330 | <string>Shared Key</string> | 305 | <string>Shared Key</string> |
331 | </property> | 306 | </property> |
332 | </widget> | 307 | </widget> |
333 | </hbox> | 308 | </hbox> |
334 | </widget> | 309 | </widget> |
335 | <widget> | 310 | <widget> |
336 | <class>QButtonGroup</class> | 311 | <class>QButtonGroup</class> |
337 | <property stdset="1"> | 312 | <property stdset="1"> |
338 | <name>name</name> | 313 | <name>name</name> |
339 | <cstring>ButtonGroup44</cstring> | 314 | <cstring>KeyButtonGroup</cstring> |
340 | </property> | 315 | </property> |
341 | <property stdset="1"> | 316 | <property stdset="1"> |
342 | <name>enabled</name> | 317 | <name>enabled</name> |
343 | <bool>false</bool> | 318 | <bool>false</bool> |
344 | </property> | 319 | </property> |
345 | <property stdset="1"> | 320 | <property stdset="1"> |
346 | <name>title</name> | 321 | <name>title</name> |
347 | <string>Key Setting</string> | 322 | <string>Key Setting</string> |
348 | </property> | 323 | </property> |
349 | <grid> | 324 | <grid> |
350 | <property stdset="1"> | 325 | <property stdset="1"> |
351 | <name>margin</name> | 326 | <name>margin</name> |
352 | <number>11</number> | 327 | <number>11</number> |
353 | </property> | 328 | </property> |
354 | <property stdset="1"> | 329 | <property stdset="1"> |
355 | <name>spacing</name> | 330 | <name>spacing</name> |
356 | <number>6</number> | 331 | <number>6</number> |
357 | </property> | 332 | </property> |
358 | <widget row="0" column="1" > | 333 | <widget row="0" column="1" > |
359 | <class>QLineEdit</class> | 334 | <class>QLineEdit</class> |
360 | <property stdset="1"> | 335 | <property stdset="1"> |
361 | <name>name</name> | 336 | <name>name</name> |
362 | <cstring>keyLineEdit0</cstring> | 337 | <cstring>keyLineEdit0</cstring> |
363 | </property> | 338 | </property> |
339 | <property stdset="1"> | ||
340 | <name>echoMode</name> | ||
341 | <enum>Password</enum> | ||
342 | </property> | ||
364 | </widget> | 343 | </widget> |
365 | <widget row="1" column="1" > | 344 | <widget row="1" column="1" > |
366 | <class>QLineEdit</class> | 345 | <class>QLineEdit</class> |
367 | <property stdset="1"> | 346 | <property stdset="1"> |
368 | <name>name</name> | 347 | <name>name</name> |
369 | <cstring>keyLineEdit1</cstring> | 348 | <cstring>keyLineEdit1</cstring> |
370 | </property> | 349 | </property> |
350 | <property stdset="1"> | ||
351 | <name>echoMode</name> | ||
352 | <enum>Password</enum> | ||
353 | </property> | ||
371 | </widget> | 354 | </widget> |
372 | <widget row="2" column="1" > | 355 | <widget row="2" column="1" > |
373 | <class>QLineEdit</class> | 356 | <class>QLineEdit</class> |
374 | <property stdset="1"> | 357 | <property stdset="1"> |
375 | <name>name</name> | 358 | <name>name</name> |
376 | <cstring>keyLineEdit2</cstring> | 359 | <cstring>keyLineEdit2</cstring> |
377 | </property> | 360 | </property> |
361 | <property stdset="1"> | ||
362 | <name>echoMode</name> | ||
363 | <enum>Password</enum> | ||
364 | </property> | ||
378 | </widget> | 365 | </widget> |
379 | <widget row="3" column="1" > | 366 | <widget row="3" column="1" > |
380 | <class>QLineEdit</class> | 367 | <class>QLineEdit</class> |
381 | <property stdset="1"> | 368 | <property stdset="1"> |
382 | <name>name</name> | 369 | <name>name</name> |
383 | <cstring>keyLineEdit3</cstring> | 370 | <cstring>keyLineEdit3</cstring> |
384 | </property> | 371 | </property> |
372 | <property stdset="1"> | ||
373 | <name>echoMode</name> | ||
374 | <enum>Password</enum> | ||
375 | </property> | ||
385 | </widget> | 376 | </widget> |
386 | <widget row="0" column="0" > | 377 | <widget row="0" column="0" > |
387 | <class>QRadioButton</class> | 378 | <class>QRadioButton</class> |
388 | <property stdset="1"> | 379 | <property stdset="1"> |
389 | <name>name</name> | 380 | <name>name</name> |
390 | <cstring>keyRadio0</cstring> | 381 | <cstring>keyRadio0</cstring> |
391 | </property> | 382 | </property> |
392 | <property stdset="1"> | 383 | <property stdset="1"> |
393 | <name>text</name> | 384 | <name>text</name> |
394 | <string>Key 1</string> | 385 | <string>Key 1</string> |
395 | </property> | 386 | </property> |
396 | <property stdset="1"> | 387 | <property stdset="1"> |
@@ -452,67 +443,47 @@ | |||
452 | <width>20</width> | 443 | <width>20</width> |
453 | <height>20</height> | 444 | <height>20</height> |
454 | </size> | 445 | </size> |
455 | </property> | 446 | </property> |
456 | </spacer> | 447 | </spacer> |
457 | </vbox> | 448 | </vbox> |
458 | </widget> | 449 | </widget> |
459 | </widget> | 450 | </widget> |
460 | </vbox> | 451 | </vbox> |
461 | </widget> | 452 | </widget> |
462 | <connections> | 453 | <connections> |
463 | <connection> | 454 | <connection> |
464 | <sender>essSpecific</sender> | 455 | <sender>wepEnabled</sender> |
465 | <signal>toggled(bool)</signal> | ||
466 | <receiver>essSpecificLineEdit</receiver> | ||
467 | <slot>setEnabled(bool)</slot> | ||
468 | </connection> | ||
469 | <connection> | ||
470 | <sender>network802</sender> | ||
471 | <signal>clicked()</signal> | ||
472 | <receiver>essSpecific</receiver> | ||
473 | <slot>animateClick()</slot> | ||
474 | </connection> | ||
475 | <connection> | ||
476 | <sender>network802</sender> | ||
477 | <signal>toggled(bool)</signal> | ||
478 | <receiver>TextLabel2</receiver> | ||
479 | <slot>setEnabled(bool)</slot> | ||
480 | </connection> | ||
481 | <connection> | ||
482 | <sender>network802</sender> | ||
483 | <signal>toggled(bool)</signal> | 456 | <signal>toggled(bool)</signal> |
484 | <receiver>networkChannel</receiver> | 457 | <receiver>ButtonGroup43</receiver> |
485 | <slot>setEnabled(bool)</slot> | 458 | <slot>setEnabled(bool)</slot> |
486 | </connection> | 459 | </connection> |
487 | <connection> | 460 | <connection> |
488 | <sender>wepEnabled</sender> | 461 | <sender>wepEnabled</sender> |
489 | <signal>toggled(bool)</signal> | 462 | <signal>toggled(bool)</signal> |
490 | <receiver>ButtonGroup43</receiver> | 463 | <receiver>KeyButtonGroup</receiver> |
491 | <slot>setEnabled(bool)</slot> | 464 | <slot>setEnabled(bool)</slot> |
492 | </connection> | 465 | </connection> |
493 | <connection> | 466 | <connection> |
494 | <sender>wepEnabled</sender> | 467 | <sender>essAny</sender> |
495 | <signal>toggled(bool)</signal> | 468 | <signal>toggled(bool)</signal> |
496 | <receiver>ButtonGroup44</receiver> | 469 | <receiver>GroupBox1</receiver> |
497 | <slot>setEnabled(bool)</slot> | 470 | <slot>setEnabled(bool)</slot> |
498 | </connection> | 471 | </connection> |
499 | </connections> | 472 | </connections> |
500 | <tabstops> | 473 | <tabstops> |
501 | <tabstop>tabWidget</tabstop> | 474 | <tabstop>tabWidget</tabstop> |
502 | <tabstop>essNon</tabstop> | 475 | <tabstop>essAny</tabstop> |
503 | <tabstop>essSpecific</tabstop> | ||
504 | <tabstop>essSpecificLineEdit</tabstop> | 476 | <tabstop>essSpecificLineEdit</tabstop> |
505 | <tabstop>networkInfrastructure</tabstop> | 477 | <tabstop>networkType</tabstop> |
506 | <tabstop>network802</tabstop> | ||
507 | <tabstop>networkChannel</tabstop> | 478 | <tabstop>networkChannel</tabstop> |
508 | <tabstop>wepEnabled</tabstop> | 479 | <tabstop>wepEnabled</tabstop> |
509 | <tabstop>authOpen</tabstop> | 480 | <tabstop>authOpen</tabstop> |
510 | <tabstop>authShared</tabstop> | 481 | <tabstop>authShared</tabstop> |
511 | <tabstop>keyRadio0</tabstop> | 482 | <tabstop>keyRadio0</tabstop> |
512 | <tabstop>keyLineEdit0</tabstop> | 483 | <tabstop>keyLineEdit0</tabstop> |
513 | <tabstop>keyRadio1</tabstop> | 484 | <tabstop>keyRadio1</tabstop> |
514 | <tabstop>keyLineEdit1</tabstop> | 485 | <tabstop>keyLineEdit1</tabstop> |
515 | <tabstop>keyRadio2</tabstop> | 486 | <tabstop>keyRadio2</tabstop> |
516 | <tabstop>keyLineEdit2</tabstop> | 487 | <tabstop>keyLineEdit2</tabstop> |
517 | <tabstop>keyRadio3</tabstop> | 488 | <tabstop>keyRadio3</tabstop> |
518 | <tabstop>keyLineEdit3</tabstop> | 489 | <tabstop>keyLineEdit3</tabstop> |
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp index 6a56358..ef7329e 100644 --- a/noncore/net/networksetup/wlan/wlanimp.cpp +++ b/noncore/net/networksetup/wlan/wlanimp.cpp | |||
@@ -1,24 +1,26 @@ | |||
1 | #include "wlanimp.h" | 1 | #include "wlanimp.h" |
2 | #include "interfacesetupimp.h" | 2 | #include "interfacesetupimp.h" |
3 | 3 | ||
4 | #include <qfile.h> | 4 | #include <qfile.h> |
5 | #include <qdir.h> | 5 | #include <qdir.h> |
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | #include <qmessagebox.h> | 7 | #include <qmessagebox.h> |
8 | #include <qlineedit.h> | 8 | #include <qlineedit.h> |
9 | #include <qlabel.h> | ||
9 | #include <qspinbox.h> | 10 | #include <qspinbox.h> |
10 | #include <qradiobutton.h> | 11 | #include <qradiobutton.h> |
11 | #include <qcheckbox.h> | 12 | #include <qcheckbox.h> |
12 | #include <qtabwidget.h> | 13 | #include <qtabwidget.h> |
14 | #include <qcombobox.h> | ||
13 | 15 | ||
14 | /* system() */ | 16 | /* system() */ |
15 | #include <stdlib.h> | 17 | #include <stdlib.h> |
16 | 18 | ||
17 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" | 19 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" |
18 | 20 | ||
19 | /** | 21 | /** |
20 | * Constructor, read in the wireless.opts file for parsing later. | 22 | * Constructor, read in the wireless.opts file for parsing later. |
21 | */ | 23 | */ |
22 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl), currentProfile("*") { | 24 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl), currentProfile("*") { |
23 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i); | 25 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i); |
24 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); | 26 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); |
@@ -30,24 +32,31 @@ WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, W | |||
30 | QTextStream stream( &file ); | 32 | QTextStream stream( &file ); |
31 | QString line = ""; | 33 | QString line = ""; |
32 | while ( !stream.eof() ) { | 34 | while ( !stream.eof() ) { |
33 | line += stream.readLine(); | 35 | line += stream.readLine(); |
34 | line += "\n"; | 36 | line += "\n"; |
35 | } | 37 | } |
36 | file.close(); | 38 | file.close(); |
37 | settingsFileText = QStringList::split("\n", line, true); | 39 | settingsFileText = QStringList::split("\n", line, true); |
38 | parseSettingFile(); | 40 | parseSettingFile(); |
39 | } | 41 | } |
40 | else | 42 | else |
41 | qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1()); | 43 | qDebug(QString("WLANImp: Can't open file: %1 for reading.").arg(wlanFile).latin1()); |
44 | connect(networkType, SIGNAL(activated(int)), this, SLOT(typeChanged(int))); | ||
45 | |||
46 | } | ||
47 | |||
48 | void WLANImp::typeChanged(int mod){ | ||
49 | networkChannel->setEnabled(mod); | ||
50 | channelLabel->setEnabled(mod); | ||
42 | } | 51 | } |
43 | 52 | ||
44 | /** | 53 | /** |
45 | * Change the profile for both wireless settings and network settings. | 54 | * Change the profile for both wireless settings and network settings. |
46 | */ | 55 | */ |
47 | void WLANImp::setProfile(const QString &profile){ | 56 | void WLANImp::setProfile(const QString &profile){ |
48 | interfaceSetup->setProfile(profile); | 57 | interfaceSetup->setProfile(profile); |
49 | parseSettingFile(); | 58 | parseSettingFile(); |
50 | } | 59 | } |
51 | 60 | ||
52 | /** | 61 | /** |
53 | * Parses the settings file that was read in and gets any setting from it. | 62 | * Parses the settings file that was read in and gets any setting from it. |
@@ -62,41 +71,37 @@ void WLANImp::parseSettingFile(){ | |||
62 | // See if we found our scheme to write or the sceme couldn't be found | 71 | // See if we found our scheme to write or the sceme couldn't be found |
63 | if((foundCase && line.contains("esac")) || | 72 | if((foundCase && line.contains("esac")) || |
64 | (foundCase && line.left(currentProfile.length()+7) == currentProfile + ",*,*,*)" && line.at(0) != '#')) | 73 | (foundCase && line.left(currentProfile.length()+7) == currentProfile + ",*,*,*)" && line.at(0) != '#')) |
65 | found = true; | 74 | found = true; |
66 | 75 | ||
67 | if(line.contains(";;")) | 76 | if(line.contains(";;")) |
68 | found = false; | 77 | found = false; |
69 | if(found){ | 78 | if(found){ |
70 | // write out scheme | 79 | // write out scheme |
71 | if(line.contains("ESSID=")){ | 80 | if(line.contains("ESSID=")){ |
72 | QString id = line.mid(line.find("ESSID=")+6, line.length()); | 81 | QString id = line.mid(line.find("ESSID=")+6, line.length()); |
73 | if(id == "any"){ | 82 | if(id == "any"){ |
74 | essNon->setChecked(true); | 83 | essAny->setChecked(false); |
75 | essSpecific->setChecked(false); | ||
76 | }else{ | 84 | }else{ |
77 | essSpecific->setChecked(true); | 85 | essAny->setChecked(true); |
78 | essSpecificLineEdit->setText(id); | 86 | essSpecificLineEdit->setText(id); |
79 | essNon->setChecked(false); | ||
80 | } | 87 | } |
81 | } | 88 | } |
82 | if(line.contains("MODE=")){ | 89 | if(line.contains("MODE=")){ |
83 | QString mode = line.mid(line.find("MODE=")+5, line.length()); | 90 | QString mode = line.mid(line.find("MODE=")+5, line.length()); |
84 | if(mode == "Managed"){ | 91 | if(mode == "Managed"){ |
85 | network802->setChecked( false ); | 92 | networkType->setCurrentItem(0); |
86 | networkInfrastructure->setChecked( true ); | ||
87 | } | 93 | } |
88 | else{ | 94 | else{ |
89 | network802->setChecked( true ); | 95 | networkType->setCurrentItem(0); |
90 | networkInfrastructure->setChecked( false ); | ||
91 | } | 96 | } |
92 | } | 97 | } |
93 | if(line.contains("KEY0=")) | 98 | if(line.contains("KEY0=")) |
94 | keyLineEdit0->setText(line.mid(5, line.length())); | 99 | keyLineEdit0->setText(line.mid(5, line.length())); |
95 | if(line.contains("KEY1=")) | 100 | if(line.contains("KEY1=")) |
96 | keyLineEdit1->setText(line.mid(5, line.length())); | 101 | keyLineEdit1->setText(line.mid(5, line.length())); |
97 | if(line.contains("KEY2=")) | 102 | if(line.contains("KEY2=")) |
98 | keyLineEdit2->setText(line.mid(5, line.length())); | 103 | keyLineEdit2->setText(line.mid(5, line.length())); |
99 | if(line.contains("KEY3=")) | 104 | if(line.contains("KEY3=")) |
100 | keyLineEdit3->setText(line.mid(5, line.length())); | 105 | keyLineEdit3->setText(line.mid(5, line.length())); |
101 | 106 | ||
102 | if(line.contains("KEY=")){ | 107 | if(line.contains("KEY=")){ |
@@ -145,78 +150,90 @@ void WLANImp::changeAndSaveSettingFile(){ | |||
145 | QString line = (*it).simplifyWhiteSpace(); | 150 | QString line = (*it).simplifyWhiteSpace(); |
146 | if(line.contains("case")) | 151 | if(line.contains("case")) |
147 | foundCase = true; | 152 | foundCase = true; |
148 | // See if we found our scheme to write or the sceme couldn't be found | 153 | // See if we found our scheme to write or the sceme couldn't be found |
149 | if((foundCase && line.contains("esac") && !found) || | 154 | if((foundCase && line.contains("esac") && !found) || |
150 | (foundCase && line.left(currentProfile.length()+7) == currentProfile + ",*,*,*)" && line.at(0) != '#')){ | 155 | (foundCase && line.left(currentProfile.length()+7) == currentProfile + ",*,*,*)" && line.at(0) != '#')){ |
151 | // write out scheme | 156 | // write out scheme |
152 | found = true; | 157 | found = true; |
153 | output = false; | 158 | output = false; |
154 | 159 | ||
155 | if(!line.contains("esac")) | 160 | if(!line.contains("esac")) |
156 | stream << line << "\n"; | 161 | stream << line << "\n"; |
157 | 162 | if(!essAny->isChecked() == true){ | |
158 | stream << "\tESSID=" << (essNon->isChecked() == true ? QString("any") : essSpecificLineEdit->text()) << '\n'; | 163 | stream << "\tESSID=any\n"; |
159 | stream << "\tMODE=" << (networkInfrastructure->isChecked() == true ? "Managed" : "ad-hoc") << '\n'; | 164 | stream << "\tMODE=Managed\n"; |
160 | 165 | stream << "\tCHANNEL=6\n"; | |
166 | } | ||
167 | else{ | ||
168 | stream << "\tESSID=" << essSpecificLineEdit->text() << '\n'; | ||
169 | stream << "\tMODE=" << ( networkType->currentItem() == 0 ? "Managed" : "ad-hoc") << '\n'; | ||
170 | stream << "\tCHANNEL=" << networkChannel->value() << "\n"; | ||
171 | } | ||
172 | |||
161 | stream << "\tKEY0=" << keyLineEdit0->text() << "\n"; | 173 | stream << "\tKEY0=" << keyLineEdit0->text() << "\n"; |
162 | stream << "\tKEY1=" << keyLineEdit1->text() << "\n"; | 174 | stream << "\tKEY1=" << keyLineEdit1->text() << "\n"; |
163 | stream << "\tKEY2=" << keyLineEdit2->text() << "\n"; | 175 | stream << "\tKEY2=" << keyLineEdit2->text() << "\n"; |
164 | stream << "\tKEY3=" << keyLineEdit3->text() << "\n"; | 176 | stream << "\tKEY3=" << keyLineEdit3->text() << "\n"; |
165 | 177 | ||
166 | if(wepEnabled->isChecked()){ | 178 | if(wepEnabled->isChecked()){ |
167 | stream << "\tKEY=\""; | 179 | stream << "\tKEY=\""; |
168 | if(keyRadio0->isChecked()) stream << keyLineEdit0->text(); | 180 | if(keyRadio0->isChecked()) stream << keyLineEdit0->text(); |
169 | if(keyRadio1->isChecked()) stream << keyLineEdit1->text(); | 181 | if(keyRadio1->isChecked()) stream << keyLineEdit1->text(); |
170 | if(keyRadio2->isChecked()) stream << keyLineEdit2->text(); | 182 | if(keyRadio2->isChecked()) stream << keyLineEdit2->text(); |
171 | if(keyRadio3->isChecked()) stream << keyLineEdit3->text(); | 183 | if(keyRadio3->isChecked()) stream << keyLineEdit3->text(); |
172 | if(authOpen->isChecked()) | 184 | if(authOpen->isChecked()) |
173 | stream << " open"; | 185 | stream << " open"; |
174 | else | 186 | else |
175 | stream << " restricted"; | 187 | stream << " restricted"; |
176 | stream << "\"\n"; | 188 | stream << "\"\n"; |
177 | } | 189 | } |
178 | stream << "\tCHANNEL=" << networkChannel->value() << "\n"; | ||
179 | stream << "\tRATE=auto\n"; | 190 | stream << "\tRATE=auto\n"; |
180 | if(line.contains("esac")) | 191 | if(line.contains("esac")) |
181 | stream << line << "\n"; | 192 | stream << line << "\n"; |
182 | } | 193 | } |
183 | if(line.contains(";;")) | 194 | if(line.contains(";;")) |
184 | output = true; | 195 | output = true; |
185 | if(output && (*it).length() ) | 196 | if(output && (*it).length() ) |
186 | stream << (*it) << '\n'; | 197 | stream << (*it) << '\n'; |
187 | } | 198 | } |
188 | file.close(); | 199 | file.close(); |
189 | } | 200 | } |
190 | 201 | ||
191 | /** | 202 | /** |
192 | * Check to see if the current config is valid | 203 | * Check to see if the current config is valid |
193 | * Save wireless.opts, save interfaces | 204 | * Save wireless.opts, save interfaces |
194 | */ | 205 | */ |
195 | void WLANImp::accept(){ | 206 | void WLANImp::accept(){ |
196 | if(wepEnabled->isChecked()){ | 207 | if(wepEnabled->isChecked()){ |
197 | if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() ) | 208 | if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() ) |
198 | { | 209 | { |
199 | QMessageBox::information(this, "", "Please enter a key for WEP.", QMessageBox::Ok); | 210 | QMessageBox::information(this, "Error", "Please enter a key for WEP.", QMessageBox::Ok); |
200 | return; | 211 | return; |
201 | } | 212 | } |
202 | } | 213 | } |
203 | 214 | ||
215 | if(essSpecificLineEdit->text().isEmpty()){ | ||
216 | QMessageBox::information(this, "Error", "Please enter a ESS-ID.", QMessageBox::Ok); | ||
217 | return; | ||
218 | } | ||
219 | |||
204 | // Ok settings are good here, save | 220 | // Ok settings are good here, save |
205 | changeAndSaveSettingFile(); | 221 | changeAndSaveSettingFile(); |
206 | 222 | ||
207 | // Try to save the interfaces settings. | 223 | // Try to save the interfaces settings. |
208 | if(!interfaceSetup->saveChanges()) | 224 | if(!interfaceSetup->saveChanges()) |
209 | return; | 225 | return; |
210 | 226 | ||
227 | return; | ||
211 | // Restart the device now that the settings have changed | 228 | // Restart the device now that the settings have changed |
212 | QString initpath; | 229 | QString initpath; |
213 | if( QDir("/etc/rc.d/init.d").exists() ) | 230 | if( QDir("/etc/rc.d/init.d").exists() ) |
214 | initpath = "/etc/rc.d/init.d"; | 231 | initpath = "/etc/rc.d/init.d"; |
215 | else if( QDir("/etc/init.d").exists() ) | 232 | else if( QDir("/etc/init.d").exists() ) |
216 | initpath = "/etc/init.d"; | 233 | initpath = "/etc/init.d"; |
217 | if( initpath ) | 234 | if( initpath ) |
218 | system(QString("%1/pcmcia stop").arg(initpath)); | 235 | system(QString("%1/pcmcia stop").arg(initpath)); |
219 | if( initpath ) | 236 | if( initpath ) |
220 | system(QString("%1/pcmcia start").arg(initpath)); | 237 | system(QString("%1/pcmcia start").arg(initpath)); |
221 | 238 | ||
222 | // Close out the dialog | 239 | // Close out the dialog |
diff --git a/noncore/net/networksetup/wlan/wlanimp.h b/noncore/net/networksetup/wlan/wlanimp.h index df599af..310836c 100644 --- a/noncore/net/networksetup/wlan/wlanimp.h +++ b/noncore/net/networksetup/wlan/wlanimp.h | |||
@@ -9,23 +9,26 @@ class Interface; | |||
9 | class Config; | 9 | class Config; |
10 | 10 | ||
11 | class WLANImp : public WLAN { | 11 | class WLANImp : public WLAN { |
12 | Q_OBJECT | 12 | Q_OBJECT |
13 | 13 | ||
14 | public: | 14 | public: |
15 | WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); | 15 | WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); |
16 | void setProfile(const QString &profile); | 16 | void setProfile(const QString &profile); |
17 | 17 | ||
18 | protected: | 18 | protected: |
19 | void accept(); | 19 | void accept(); |
20 | 20 | ||
21 | private slots: | ||
22 | void typeChanged(int); | ||
23 | |||
21 | private: | 24 | private: |
22 | void parseSettingFile(); | 25 | void parseSettingFile(); |
23 | void changeAndSaveSettingFile(); | 26 | void changeAndSaveSettingFile(); |
24 | 27 | ||
25 | InterfaceSetupImp *interfaceSetup; | 28 | InterfaceSetupImp *interfaceSetup; |
26 | QStringList settingsFileText; | 29 | QStringList settingsFileText; |
27 | QString currentProfile; | 30 | QString currentProfile; |
28 | }; | 31 | }; |
29 | 32 | ||
30 | #endif | 33 | #endif |
31 | 34 | ||