summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/wlan/keyedit.cpp21
-rw-r--r--noncore/settings/networksettings/wlan/keyedit.h21
-rw-r--r--noncore/settings/networksettings/wlan/wlan.pro4
-rw-r--r--noncore/settings/networksettings/wlan/wlan.ui179
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp2.cpp1
5 files changed, 160 insertions, 66 deletions
diff --git a/noncore/settings/networksettings/wlan/keyedit.cpp b/noncore/settings/networksettings/wlan/keyedit.cpp
new file mode 100644
index 0000000..ad9ecae
--- a/dev/null
+++ b/noncore/settings/networksettings/wlan/keyedit.cpp
@@ -0,0 +1,21 @@
1#include "keyedit.h"
2#include <qlineedit.h>
3
4KeyEdit::KeyEdit(QWidget* parent, const char* name) :
5 QLineEdit(parent, name)
6{
7}
8
9KeyEdit::~KeyEdit()
10{
11}
12
13void KeyEdit::focusInEvent(QFocusEvent *event)
14{
15 setEchoMode(Normal);
16}
17
18void KeyEdit::focusOutEvent(QFocusEvent *event)
19{
20 setEchoMode(Password);
21}
diff --git a/noncore/settings/networksettings/wlan/keyedit.h b/noncore/settings/networksettings/wlan/keyedit.h
new file mode 100644
index 0000000..7d418a6
--- a/dev/null
+++ b/noncore/settings/networksettings/wlan/keyedit.h
@@ -0,0 +1,21 @@
1#ifndef KEYEDIT_H
2#define KEYEDIT_H
3
4#include <qlineedit.h>
5
6class KeyEdit : public QLineEdit {
7 Q_OBJECT
8
9public:
10 KeyEdit(QWidget* parent = 0, const char* name = 0);
11 ~KeyEdit();
12
13protected:
14 void focusInEvent(QFocusEvent *event);
15 void focusOutEvent(QFocusEvent *event);
16
17private:
18};
19
20#endif
21
diff --git a/noncore/settings/networksettings/wlan/wlan.pro b/noncore/settings/networksettings/wlan/wlan.pro
index 9ddc154..7a55a8e 100644
--- a/noncore/settings/networksettings/wlan/wlan.pro
+++ b/noncore/settings/networksettings/wlan/wlan.pro
@@ -1,26 +1,26 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3 #CONFIG += qt warn_on debug 3 #CONFIG += qt warn_on debug
4DESTDIR = $(OPIEDIR)/plugins/networksettings 4DESTDIR = $(OPIEDIR)/plugins/networksettings
5 HEADERS = infoimp.h wlanmodule.h wextensions.h 5 HEADERS = infoimp.h wlanmodule.h wextensions.h keyedit.h
6 SOURCES = infoimp.cpp wlanmodule.cpp wextensions.cpp 6 SOURCES = infoimp.cpp wlanmodule.cpp wextensions.cpp keyedit.cpp
7 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ 7 INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/
8 DEPENDPATH+= $(OPIEDIR)/include 8 DEPENDPATH+= $(OPIEDIR)/include
9LIBS += -lqpe -L../interfaces/ -linterfaces 9LIBS += -lqpe -L../interfaces/ -linterfaces
10 INTERFACES= wlan.ui info.ui 10 INTERFACES= wlan.ui info.ui
11 TARGET = wlanplugin 11 TARGET = wlanplugin
12 VERSION = 1.0.0 12 VERSION = 1.0.0
13 13
14#CONFIG += wirelessopts 14#CONFIG += wirelessopts
15 15
16wirelessopts { 16wirelessopts {
17 HEADERS+= wlanimp.h 17 HEADERS+= wlanimp.h
18 SOURCES+= wlanimp.cpp 18 SOURCES+= wlanimp.cpp
19} 19}
20 20
21! wirelessopts { 21! wirelessopts {
22 HEADERS+= wlanimp2.h 22 HEADERS+= wlanimp2.h
23 SOURCES += wlanimp2.cpp 23 SOURCES += wlanimp2.cpp
24} 24}
25 25
26include ( $(OPIEDIR)/include.pro ) 26include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/networksettings/wlan/wlan.ui b/noncore/settings/networksettings/wlan/wlan.ui
index e7c8dbb..2e2d4d7 100644
--- a/noncore/settings/networksettings/wlan/wlan.ui
+++ b/noncore/settings/networksettings/wlan/wlan.ui
@@ -1,667 +1,718 @@
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>255</width> 14 <width>251</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>
111 <class>QLabel</class> 111 <class>QLabel</class>
112 <property stdset="1"> 112 <property stdset="1">
113 <name>name</name> 113 <name>name</name>
114 <cstring>essidLabel</cstring> 114 <cstring>essidLabel</cstring>
115 </property> 115 </property>
116 <property stdset="1"> 116 <property stdset="1">
117 <name>enabled</name> 117 <name>enabled</name>
118 <bool>true</bool> 118 <bool>true</bool>
119 </property> 119 </property>
120 <property stdset="1"> 120 <property stdset="1">
121 <name>geometry</name> 121 <name>geometry</name>
122 <rect> 122 <rect>
123 <x>11</x> 123 <x>11</x>
124 <y>46</y> 124 <y>46</y>
125 <width>84</width> 125 <width>84</width>
126 <height>29</height> 126 <height>29</height>
127 </rect> 127 </rect>
128 </property> 128 </property>
129 <property stdset="1"> 129 <property stdset="1">
130 <name>sizePolicy</name> 130 <name>sizePolicy</name>
131 <sizepolicy> 131 <sizepolicy>
132 <hsizetype>1</hsizetype> 132 <hsizetype>1</hsizetype>
133 <vsizetype>1</vsizetype> 133 <vsizetype>1</vsizetype>
134 </sizepolicy> 134 </sizepolicy>
135 </property> 135 </property>
136 <property stdset="1"> 136 <property stdset="1">
137 <name>text</name> 137 <name>text</name>
138 <string>ESS-ID</string> 138 <string>ESS-ID</string>
139 </property> 139 </property>
140 </widget> 140 </widget>
141 <widget> 141 <widget>
142 <class>QSpinBox</class> 142 <class>QSpinBox</class>
143 <property stdset="1"> 143 <property stdset="1">
144 <name>name</name> 144 <name>name</name>
145 <cstring>networkChannel</cstring> 145 <cstring>networkChannel</cstring>
146 </property> 146 </property>
147 <property stdset="1"> 147 <property stdset="1">
148 <name>enabled</name> 148 <name>enabled</name>
149 <bool>false</bool> 149 <bool>false</bool>
150 </property> 150 </property>
151 <property stdset="1"> 151 <property stdset="1">
152 <name>geometry</name> 152 <name>geometry</name>
153 <rect> 153 <rect>
154 <x>146</x> 154 <x>146</x>
155 <y>139</y> 155 <y>139</y>
156 <width>58</width> 156 <width>58</width>
157 <height>25</height> 157 <height>25</height>
158 </rect> 158 </rect>
159 </property> 159 </property>
160 <property stdset="1"> 160 <property stdset="1">
161 <name>maxValue</name> 161 <name>maxValue</name>
162 <number>15</number> 162 <number>15</number>
163 </property> 163 </property>
164 <property stdset="1"> 164 <property stdset="1">
165 <name>minValue</name> 165 <name>minValue</name>
166 <number>1</number> 166 <number>1</number>
167 </property> 167 </property>
168 <property stdset="1"> 168 <property stdset="1">
169 <name>value</name> 169 <name>value</name>
170 <number>1</number> 170 <number>1</number>
171 </property> 171 </property>
172 </widget> 172 </widget>
173 <widget> 173 <widget>
174 <class>QLineEdit</class> 174 <class>QLineEdit</class>
175 <property stdset="1"> 175 <property stdset="1">
176 <name>name</name> 176 <name>name</name>
177 <cstring>macEdit</cstring> 177 <cstring>macEdit</cstring>
178 </property> 178 </property>
179 <property stdset="1"> 179 <property stdset="1">
180 <name>enabled</name> 180 <name>enabled</name>
181 <bool>false</bool> 181 <bool>false</bool>
182 </property> 182 </property>
183 <property stdset="1"> 183 <property stdset="1">
184 <name>geometry</name> 184 <name>geometry</name>
185 <rect> 185 <rect>
186 <x>56</x> 186 <x>56</x>
187 <y>108</y> 187 <y>108</y>
188 <width>182</width> 188 <width>182</width>
189 <height>25</height> 189 <height>25</height>
190 </rect> 190 </rect>
191 </property> 191 </property>
192 <property stdset="1"> 192 <property stdset="1">
193 <name>sizePolicy</name> 193 <name>sizePolicy</name>
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 &amp;Access Point</string> 241 <string>Specify &amp;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 &amp;Channel</string> 261 <string>Specify &amp;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>Auto</string>
291 </property> 291 </property>
292 </item> 292 </item>
293 <item> 293 <item>
294 <property> 294 <property>
295 <name>text</name> 295 <name>text</name>
296 <string>Managed</string> 296 <string>Managed</string>
297 </property> 297 </property>
298 </item> 298 </item>
299 <item> 299 <item>
300 <property> 300 <property>
301 <name>text</name> 301 <name>text</name>
302 <string>Ad-Hoc</string> 302 <string>Ad-Hoc</string>
303 </property> 303 </property>
304 </item> 304 </item>
305 <property stdset="1"> 305 <property stdset="1">
306 <name>name</name> 306 <name>name</name>
307 <cstring>mode</cstring> 307 <cstring>mode</cstring>
308 </property> 308 </property>
309 <property stdset="1"> 309 <property stdset="1">
310 <name>enabled</name> 310 <name>enabled</name>
311 <bool>true</bool> 311 <bool>true</bool>
312 </property> 312 </property>
313 <property stdset="1"> 313 <property stdset="1">
314 <name>geometry</name> 314 <name>geometry</name>
315 <rect> 315 <rect>
316 <x>101</x> 316 <x>101</x>
317 <y>11</y> 317 <y>11</y>
318 <width>103</width> 318 <width>103</width>
319 <height>29</height> 319 <height>29</height>
320 </rect> 320 </rect>
321 </property> 321 </property>
322 <property stdset="1"> 322 <property stdset="1">
323 <name>sizePolicy</name> 323 <name>sizePolicy</name>
324 <sizepolicy> 324 <sizepolicy>
325 <hsizetype>1</hsizetype> 325 <hsizetype>1</hsizetype>
326 <vsizetype>0</vsizetype> 326 <vsizetype>0</vsizetype>
327 </sizepolicy> 327 </sizepolicy>
328 </property> 328 </property>
329 </widget> 329 </widget>
330 <widget> 330 <widget>
331 <class>QComboBox</class> 331 <class>QComboBox</class>
332 <item> 332 <item>
333 <property> 333 <property>
334 <name>text</name> 334 <name>text</name>
335 <string>any</string> 335 <string>any</string>
336 </property> 336 </property>
337 </item> 337 </item>
338 <property stdset="1"> 338 <property stdset="1">
339 <name>name</name> 339 <name>name</name>
340 <cstring>essid</cstring> 340 <cstring>essid</cstring>
341 </property> 341 </property>
342 <property stdset="1"> 342 <property stdset="1">
343 <name>geometry</name> 343 <name>geometry</name>
344 <rect> 344 <rect>
345 <x>101</x> 345 <x>101</x>
346 <y>46</y> 346 <y>46</y>
347 <width>103</width> 347 <width>103</width>
348 <height>29</height> 348 <height>29</height>
349 </rect> 349 </rect>
350 </property> 350 </property>
351 <property stdset="1"> 351 <property stdset="1">
352 <name>sizePolicy</name> 352 <name>sizePolicy</name>
353 <sizepolicy> 353 <sizepolicy>
354 <hsizetype>7</hsizetype> 354 <hsizetype>7</hsizetype>
355 <vsizetype>0</vsizetype> 355 <vsizetype>0</vsizetype>
356 </sizepolicy> 356 </sizepolicy>
357 </property> 357 </property>
358 <property stdset="1"> 358 <property stdset="1">
359 <name>editable</name> 359 <name>editable</name>
360 <bool>true</bool> 360 <bool>true</bool>
361 </property> 361 </property>
362 <property stdset="1"> 362 <property stdset="1">
363 <name>currentItem</name> 363 <name>currentItem</name>
364 <number>0</number> 364 <number>0</number>
365 </property> 365 </property>
366 <property stdset="1"> 366 <property stdset="1">
367 <name>sizeLimit</name> 367 <name>sizeLimit</name>
368 <number>5</number> 368 <number>5</number>
369 </property> 369 </property>
370 <property stdset="1"> 370 <property stdset="1">
371 <name>autoCompletion</name> 371 <name>autoCompletion</name>
372 <bool>true</bool> 372 <bool>true</bool>
373 </property> 373 </property>
374 <property stdset="1"> 374 <property stdset="1">
375 <name>duplicatesEnabled</name> 375 <name>duplicatesEnabled</name>
376 <bool>false</bool> 376 <bool>false</bool>
377 </property> 377 </property>
378 </widget> 378 </widget>
379 </widget> 379 </widget>
380 <widget> 380 <widget>
381 <class>QWidget</class> 381 <class>QWidget</class>
382 <property stdset="1"> 382 <property stdset="1">
383 <name>name</name> 383 <name>name</name>
384 <cstring>WepPage</cstring> 384 <cstring>WepPage</cstring>
385 </property> 385 </property>
386 <attribute> 386 <attribute>
387 <name>title</name> 387 <name>title</name>
388 <string>Encryption</string> 388 <string>Encryption</string>
389 </attribute> 389 </attribute>
390 <grid> 390 <grid>
391 <property stdset="1"> 391 <property stdset="1">
392 <name>margin</name> 392 <name>margin</name>
393 <number>11</number> 393 <number>11</number>
394 </property> 394 </property>
395 <property stdset="1"> 395 <property stdset="1">
396 <name>spacing</name> 396 <name>spacing</name>
397 <number>6</number> 397 <number>6</number>
398 </property> 398 </property>
399 <spacer row="0" column="0" >
400 <property>
401 <name>name</name>
402 <cstring>Spacer30</cstring>
403 </property>
404 <property stdset="1">
405 <name>orientation</name>
406 <enum>Vertical</enum>
407 </property>
408 <property stdset="1">
409 <name>sizeType</name>
410 <enum>Expanding</enum>
411 </property>
412 <property>
413 <name>sizeHint</name>
414 <size>
415 <width>20</width>
416 <height>20</height>
417 </size>
418 </property>
419 </spacer>
420 <widget row="0" column="0" > 399 <widget row="0" column="0" >
421 <class>QCheckBox</class> 400 <class>QCheckBox</class>
422 <property stdset="1"> 401 <property stdset="1">
423 <name>name</name> 402 <name>name</name>
424 <cstring>wepEnabled</cstring> 403 <cstring>wepEnabled</cstring>
425 </property> 404 </property>
426 <property stdset="1"> 405 <property stdset="1">
427 <name>text</name> 406 <name>text</name>
428 <string>&amp;Enable Encryption</string> 407 <string>&amp;Enable Encryption</string>
429 </property> 408 </property>
430 </widget> 409 </widget>
431 <widget row="1" column="0" > 410 <widget row="1" column="0" >
432 <class>QButtonGroup</class> 411 <class>QButtonGroup</class>
433 <property stdset="1"> 412 <property stdset="1">
434 <name>name</name> 413 <name>name</name>
435 <cstring>KeyButtonGroup</cstring> 414 <cstring>KeyButtonGroup</cstring>
436 </property> 415 </property>
437 <property stdset="1"> 416 <property stdset="1">
438 <name>enabled</name> 417 <name>enabled</name>
439 <bool>false</bool> 418 <bool>false</bool>
440 </property> 419 </property>
441 <property stdset="1"> 420 <property stdset="1">
442 <name>title</name> 421 <name>title</name>
443 <string>&amp;Key Setting</string> 422 <string>&amp;Key Setting</string>
444 </property> 423 </property>
445 <grid> 424 <grid>
446 <property stdset="1"> 425 <property stdset="1">
447 <name>margin</name> 426 <name>margin</name>
448 <number>11</number> 427 <number>11</number>
449 </property> 428 </property>
450 <property stdset="1"> 429 <property stdset="1">
451 <name>spacing</name> 430 <name>spacing</name>
452 <number>6</number> 431 <number>6</number>
453 </property> 432 </property>
454 <widget row="0" column="1" > 433 <widget row="0" column="0" >
455 <class>QLineEdit</class> 434 <class>QRadioButton</class>
456 <property stdset="1"> 435 <property stdset="1">
457 <name>name</name> 436 <name>name</name>
458 <cstring>keyLineEdit0</cstring> 437 <cstring>keyRadio0</cstring>
438 </property>
439 <property stdset="1">
440 <name>text</name>
441 <string>Key &amp;1</string>
459 </property> 442 </property>
460 <property stdset="1"> 443 <property stdset="1">
461 <name>echoMode</name> 444 <name>checked</name>
462 <enum>Password</enum> 445 <bool>true</bool>
463 </property> 446 </property>
464 </widget> 447 </widget>
465 <widget row="1" column="1" > 448 <widget row="1" column="0" >
466 <class>QLineEdit</class> 449 <class>QRadioButton</class>
467 <property stdset="1"> 450 <property stdset="1">
468 <name>name</name> 451 <name>name</name>
469 <cstring>keyLineEdit1</cstring> 452 <cstring>keyRadio1</cstring>
470 </property> 453 </property>
471 <property stdset="1"> 454 <property stdset="1">
472 <name>echoMode</name> 455 <name>text</name>
473 <enum>Password</enum> 456 <string>Key &amp;2</string>
474 </property> 457 </property>
475 </widget> 458 </widget>
476 <widget row="2" column="1" > 459 <widget row="2" column="0" >
477 <class>QLineEdit</class> 460 <class>QRadioButton</class>
478 <property stdset="1"> 461 <property stdset="1">
479 <name>name</name> 462 <name>name</name>
480 <cstring>keyLineEdit2</cstring> 463 <cstring>keyRadio2</cstring>
481 </property> 464 </property>
482 <property stdset="1"> 465 <property stdset="1">
483 <name>echoMode</name> 466 <name>text</name>
484 <enum>Password</enum> 467 <string>Key &amp;3</string>
485 </property> 468 </property>
486 </widget> 469 </widget>
487 <widget row="3" column="1" > 470 <widget row="3" column="0" >
488 <class>QLineEdit</class> 471 <class>QRadioButton</class>
489 <property stdset="1"> 472 <property stdset="1">
490 <name>name</name> 473 <name>name</name>
491 <cstring>keyLineEdit3</cstring> 474 <cstring>keyRadio3</cstring>
492 </property> 475 </property>
493 <property stdset="1"> 476 <property stdset="1">
494 <name>echoMode</name> 477 <name>text</name>
495 <enum>Password</enum> 478 <string>Key &amp;4</string>
496 </property> 479 </property>
497 </widget> 480 </widget>
498 <widget row="0" column="0" > 481 <widget row="0" column="1" >
499 <class>QRadioButton</class> 482 <class>KeyEdit</class>
500 <property stdset="1"> 483 <property stdset="1">
501 <name>name</name> 484 <name>name</name>
502 <cstring>keyRadio0</cstring> 485 <cstring>keyLineEdit0</cstring>
503 </property> 486 </property>
504 <property stdset="1"> 487 <property stdset="1">
505 <name>text</name> 488 <name>sizePolicy</name>
506 <string>Key &amp;1</string> 489 <sizepolicy>
490 <hsizetype>3</hsizetype>
491 <vsizetype>5</vsizetype>
492 </sizepolicy>
507 </property> 493 </property>
508 <property stdset="1"> 494 <property stdset="1">
509 <name>checked</name> 495 <name>focusPolicy</name>
510 <bool>true</bool> 496 <enum>StrongFocus</enum>
511 </property> 497 </property>
512 </widget> 498 </widget>
513 <widget row="1" column="0" > 499 <widget row="1" column="1" >
514 <class>QRadioButton</class> 500 <class>KeyEdit</class>
515 <property stdset="1"> 501 <property stdset="1">
516 <name>name</name> 502 <name>name</name>
517 <cstring>keyRadio1</cstring> 503 <cstring>keyLineEdit1</cstring>
518 </property> 504 </property>
519 <property stdset="1"> 505 <property stdset="1">
520 <name>text</name> 506 <name>sizePolicy</name>
521 <string>Key &amp;2</string> 507 <sizepolicy>
508 <hsizetype>3</hsizetype>
509 <vsizetype>5</vsizetype>
510 </sizepolicy>
511 </property>
512 <property stdset="1">
513 <name>focusPolicy</name>
514 <enum>StrongFocus</enum>
522 </property> 515 </property>
523 </widget> 516 </widget>
524 <widget row="2" column="0" > 517 <widget row="2" column="1" >
525 <class>QRadioButton</class> 518 <class>KeyEdit</class>
526 <property stdset="1"> 519 <property stdset="1">
527 <name>name</name> 520 <name>name</name>
528 <cstring>keyRadio2</cstring> 521 <cstring>keyLineEdit2</cstring>
529 </property> 522 </property>
530 <property stdset="1"> 523 <property stdset="1">
531 <name>text</name> 524 <name>sizePolicy</name>
532 <string>Key &amp;3</string> 525 <sizepolicy>
526 <hsizetype>3</hsizetype>
527 <vsizetype>5</vsizetype>
528 </sizepolicy>
529 </property>
530 <property stdset="1">
531 <name>focusPolicy</name>
532 <enum>StrongFocus</enum>
533 </property> 533 </property>
534 </widget> 534 </widget>
535 <widget row="3" column="0" > 535 <widget row="3" column="1" >
536 <class>QRadioButton</class> 536 <class>KeyEdit</class>
537 <property stdset="1"> 537 <property stdset="1">
538 <name>name</name> 538 <name>name</name>
539 <cstring>keyRadio3</cstring> 539 <cstring>keyLineEdit3</cstring>
540 </property> 540 </property>
541 <property stdset="1"> 541 <property stdset="1">
542 <name>text</name> 542 <name>sizePolicy</name>
543 <string>Key &amp;4</string> 543 <sizepolicy>
544 <hsizetype>3</hsizetype>
545 <vsizetype>5</vsizetype>
546 </sizepolicy>
547 </property>
548 <property stdset="1">
549 <name>focusPolicy</name>
550 <enum>StrongFocus</enum>
544 </property> 551 </property>
545 </widget> 552 </widget>
546 </grid> 553 </grid>
547 </widget> 554 </widget>
548 <widget row="2" column="0" > 555 <widget row="2" column="0" >
549 <class>QButtonGroup</class> 556 <class>QButtonGroup</class>
550 <property stdset="1"> 557 <property stdset="1">
551 <name>name</name> 558 <name>name</name>
552 <cstring>NonEncButtonGroup</cstring> 559 <cstring>NonEncButtonGroup</cstring>
553 </property> 560 </property>
554 <property stdset="1"> 561 <property stdset="1">
555 <name>enabled</name> 562 <name>enabled</name>
556 <bool>false</bool> 563 <bool>false</bool>
557 </property> 564 </property>
558 <property stdset="1"> 565 <property stdset="1">
559 <name>title</name> 566 <name>title</name>
560 <string>Non-encrypted Packets</string> 567 <string>Non-encrypted Packets</string>
561 </property> 568 </property>
562 <property stdset="1"> 569 <property stdset="1">
563 <name>radioButtonExclusive</name> 570 <name>radioButtonExclusive</name>
564 <bool>true</bool> 571 <bool>true</bool>
565 </property> 572 </property>
566 <grid> 573 <grid>
567 <property stdset="1"> 574 <property stdset="1">
568 <name>margin</name> 575 <name>margin</name>
569 <number>11</number> 576 <number>11</number>
570 </property> 577 </property>
571 <property stdset="1"> 578 <property stdset="1">
572 <name>spacing</name> 579 <name>spacing</name>
573 <number>6</number> 580 <number>6</number>
574 </property> 581 </property>
575 <widget row="0" column="0" > 582 <widget row="0" column="0" >
576 <class>QRadioButton</class> 583 <class>QRadioButton</class>
577 <property stdset="1"> 584 <property stdset="1">
578 <name>name</name> 585 <name>name</name>
579 <cstring>acceptNonEnc</cstring> 586 <cstring>acceptNonEnc</cstring>
580 </property> 587 </property>
581 <property stdset="1"> 588 <property stdset="1">
582 <name>text</name> 589 <name>text</name>
583 <string>&amp;Accept</string> 590 <string>&amp;Accept</string>
584 </property> 591 </property>
585 <property stdset="1"> 592 <property stdset="1">
586 <name>checked</name> 593 <name>checked</name>
587 <bool>true</bool> 594 <bool>true</bool>
588 </property> 595 </property>
589 <property stdset="1"> 596 <property stdset="1">
590 <name>buttonGroupId</name> 597 <name>buttonGroupId</name>
591 <number>0</number> 598 <number>0</number>
592 </property> 599 </property>
593 </widget> 600 </widget>
594 <widget row="0" column="1" > 601 <widget row="0" column="1" >
595 <class>QRadioButton</class> 602 <class>QRadioButton</class>
596 <property stdset="1"> 603 <property stdset="1">
597 <name>name</name> 604 <name>name</name>
598 <cstring>rejectNonEnc</cstring> 605 <cstring>rejectNonEnc</cstring>
599 </property> 606 </property>
600 <property stdset="1"> 607 <property stdset="1">
601 <name>text</name> 608 <name>text</name>
602 <string>&amp;Reject</string> 609 <string>&amp;Reject</string>
603 </property> 610 </property>
604 <property stdset="1"> 611 <property stdset="1">
605 <name>buttonGroupId</name> 612 <name>buttonGroupId</name>
606 <number>1</number> 613 <number>1</number>
607 </property> 614 </property>
608 </widget> 615 </widget>
609 </grid> 616 </grid>
610 </widget> 617 </widget>
618 <spacer row="3" column="0" >
619 <property>
620 <name>name</name>
621 <cstring>Spacer30</cstring>
622 </property>
623 <property stdset="1">
624 <name>orientation</name>
625 <enum>Vertical</enum>
626 </property>
627 <property stdset="1">
628 <name>sizeType</name>
629 <enum>Expanding</enum>
630 </property>
631 <property>
632 <name>sizeHint</name>
633 <size>
634 <width>20</width>
635 <height>20</height>
636 </size>
637 </property>
638 </spacer>
611 </grid> 639 </grid>
612 </widget> 640 </widget>
613 </widget> 641 </widget>
614 </vbox> 642 </vbox>
615</widget> 643</widget>
644<customwidgets>
645 <customwidget>
646 <class>KeyEdit</class>
647 <header location="global">/usr/src/opie/noncore/net/networksettings/wlan/keyedit.h</header>
648 <sizehint>
649 <width>-1</width>
650 <height>-1</height>
651 </sizehint>
652 <container>0</container>
653 <sizepolicy>
654 <hordata>5</hordata>
655 <verdata>5</verdata>
656 </sizepolicy>
657 <pixmap>image0</pixmap>
658 <slot access="public">setEnabled(bool)</slot>
659 </customwidget>
660</customwidgets>
661<images>
662 <image>
663 <name>image0</name>
664 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1ddec44f503c0ae2a154410f53d0ed20e2bf6bdb656dd6861dd23d9a66591b0587fd1654235ebded6f0edcd53e419d87ae7b1f4f9b8f906d0bfe012317426a70b07bdc2f3ec77f8ed6b89559061a0343d06a124cc105596482585094bc0ae599b04646c9018926491b2205e140c485cace25755c175d0a967b622ff900b8cc9c7d29af594ea722d589167f813aa852ba07d94b9dce296e883fe7bb163f23896753</data>
665 </image>
666</images>
616<connections> 667<connections>
617 <connection> 668 <connection>
618 <sender>specifyAp</sender> 669 <sender>specifyAp</sender>
619 <signal>toggled(bool)</signal> 670 <signal>toggled(bool)</signal>
620 <receiver>macLabel</receiver> 671 <receiver>macLabel</receiver>
621 <slot>setEnabled(bool)</slot> 672 <slot>setEnabled(bool)</slot>
622 </connection> 673 </connection>
623 <connection> 674 <connection>
624 <sender>specifyAp</sender> 675 <sender>specifyAp</sender>
625 <signal>toggled(bool)</signal> 676 <signal>toggled(bool)</signal>
626 <receiver>macEdit</receiver> 677 <receiver>macEdit</receiver>
627 <slot>setEnabled(bool)</slot> 678 <slot>setEnabled(bool)</slot>
628 </connection> 679 </connection>
629 <connection> 680 <connection>
630 <sender>specifyChan</sender> 681 <sender>specifyChan</sender>
631 <signal>toggled(bool)</signal> 682 <signal>toggled(bool)</signal>
632 <receiver>networkChannel</receiver> 683 <receiver>networkChannel</receiver>
633 <slot>setEnabled(bool)</slot> 684 <slot>setEnabled(bool)</slot>
634 </connection> 685 </connection>
635 <connection> 686 <connection>
636 <sender>wepEnabled</sender> 687 <sender>wepEnabled</sender>
637 <signal>toggled(bool)</signal> 688 <signal>toggled(bool)</signal>
638 <receiver>KeyButtonGroup</receiver> 689 <receiver>KeyButtonGroup</receiver>
639 <slot>setEnabled(bool)</slot> 690 <slot>setEnabled(bool)</slot>
640 </connection> 691 </connection>
641 <connection> 692 <connection>
642 <sender>wepEnabled</sender> 693 <sender>wepEnabled</sender>
643 <signal>toggled(bool)</signal> 694 <signal>toggled(bool)</signal>
644 <receiver>NonEncButtonGroup</receiver> 695 <receiver>NonEncButtonGroup</receiver>
645 <slot>setEnabled(bool)</slot> 696 <slot>setEnabled(bool)</slot>
646 </connection> 697 </connection>
647</connections> 698</connections>
648<tabstops> 699<tabstops>
649 <tabstop>tabWidget</tabstop> 700 <tabstop>tabWidget</tabstop>
650 <tabstop>wepEnabled</tabstop> 701 <tabstop>wepEnabled</tabstop>
651 <tabstop>keyRadio0</tabstop> 702 <tabstop>keyRadio0</tabstop>
652 <tabstop>keyLineEdit0</tabstop> 703 <tabstop>keyLineEdit0</tabstop>
653 <tabstop>keyRadio1</tabstop> 704 <tabstop>keyRadio1</tabstop>
654 <tabstop>keyLineEdit1</tabstop> 705 <tabstop>keyLineEdit1</tabstop>
655 <tabstop>keyRadio2</tabstop> 706 <tabstop>keyRadio2</tabstop>
656 <tabstop>keyLineEdit2</tabstop> 707 <tabstop>keyLineEdit2</tabstop>
657 <tabstop>keyRadio3</tabstop> 708 <tabstop>keyRadio3</tabstop>
658 <tabstop>keyLineEdit3</tabstop> 709 <tabstop>keyLineEdit3</tabstop>
659 <tabstop>acceptNonEnc</tabstop> 710 <tabstop>acceptNonEnc</tabstop>
660 <tabstop>mode</tabstop> 711 <tabstop>mode</tabstop>
661 <tabstop>essid</tabstop> 712 <tabstop>essid</tabstop>
662 <tabstop>specifyAp</tabstop> 713 <tabstop>specifyAp</tabstop>
663 <tabstop>macEdit</tabstop> 714 <tabstop>macEdit</tabstop>
664 <tabstop>specifyChan</tabstop> 715 <tabstop>specifyChan</tabstop>
665 <tabstop>networkChannel</tabstop> 716 <tabstop>networkChannel</tabstop>
666</tabstops> 717</tabstops>
667</UI> 718</UI>
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp
index 73afc92..e7b842b 100644
--- a/noncore/settings/networksettings/wlan/wlanimp2.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp
@@ -1,268 +1,269 @@
1#include "wlanimp2.h" 1#include "wlanimp2.h"
2#include "keyedit.h"
2#include "interfacesetupimp.h" 3#include "interfacesetupimp.h"
3 4
4#include <qfile.h> 5#include <qfile.h>
5#include <qdir.h> 6#include <qdir.h>
6#include <qtextstream.h> 7#include <qtextstream.h>
7#include <qmessagebox.h> 8#include <qmessagebox.h>
8#include <qlineedit.h> 9#include <qlineedit.h>
9#include <qlabel.h> 10#include <qlabel.h>
10#include <qspinbox.h> 11#include <qspinbox.h>
11#include <qradiobutton.h> 12#include <qradiobutton.h>
12#include <qcheckbox.h> 13#include <qcheckbox.h>
13#include <qtabwidget.h> 14#include <qtabwidget.h>
14#include <qcombobox.h> 15#include <qcombobox.h>
15 16
16#ifdef QWS 17#ifdef QWS
17 #include <opie/oprocess.h> 18 #include <opie/oprocess.h>
18#else 19#else
19 #define OProcess KProcess 20 #define OProcess KProcess
20 #include <kprocess.h> 21 #include <kprocess.h>
21#endif 22#endif
22 23
23#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" 24#define WIRELESS_OPTS "/etc/pcmcia/wireless.opts"
24#define PREUP "/etc/netwrok/if-pre-up.d/wireless-tools" 25#define PREUP "/etc/netwrok/if-pre-up.d/wireless-tools"
25 26
26/** 27/**
27 * Constructor, read in the wireless.opts file for parsing later. 28 * Constructor, read in the wireless.opts file for parsing later.
28 */ 29 */
29WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) { 30WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), currentProfile("*"), interface(i) {
30 interfaces = new Interfaces; 31 interfaces = new Interfaces;
31 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); 32 interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces);
32 tabWidget->insertTab(interfaceSetup, "TCP/IP"); 33 tabWidget->insertTab(interfaceSetup, "TCP/IP");
33 34
34 // 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
35 QFile file(QString(PREUP)); 36 QFile file(QString(PREUP));
36 if (file.exists()) { 37 if (file.exists()) {
37 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"));
38 } 39 }
39} 40}
40 41
41WLANImp::~WLANImp() { 42WLANImp::~WLANImp() {
42 delete interfaces; 43 delete interfaces;
43} 44}
44 45
45/** 46/**
46 * Change the profile for both wireless settings and network settings. 47 * Change the profile for both wireless settings and network settings.
47 */ 48 */
48void WLANImp::setProfile(const QString &profile){ 49void WLANImp::setProfile(const QString &profile){
49 interfaceSetup->setProfile(profile); 50 interfaceSetup->setProfile(profile);
50 parseOpts(); 51 parseOpts();
51} 52}
52 53
53void WLANImp::parseOpts() { 54void WLANImp::parseOpts() {
54 bool error; 55 bool error;
55 QString opt; 56 QString opt;
56 57
57 if (! interfaces->isInterfaceSet()) 58 if (! interfaces->isInterfaceSet())
58 return; 59 return;
59 60
60 61
61 opt = interfaces->getInterfaceOption("wireless_essid", error); 62 opt = interfaces->getInterfaceOption("wireless_essid", error);
62 if(opt == "any" || opt == "off" || opt.isNull()){ 63 if(opt == "any" || opt == "off" || opt.isNull()){
63 essid->setEditText("any"); 64 essid->setEditText("any");
64 } else { 65 } else {
65 essid->setEditText(opt); 66 essid->setEditText(opt);
66 } 67 }
67 68
68 opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace(); 69 opt = interfaces->getInterfaceOption("wireless_mode", error).simplifyWhiteSpace();
69 if (opt == "Auto") { 70 if (opt == "Auto") {
70 mode->setCurrentItem(0); 71 mode->setCurrentItem(0);
71 } else if (opt == "Ad-Hoc") { 72 } else if (opt == "Ad-Hoc") {
72 mode->setCurrentItem(2); 73 mode->setCurrentItem(2);
73 } else { 74 } else {
74 // Managed/Infrastructure mode 75 // Managed/Infrastructure mode
75 mode->setCurrentItem(1); 76 mode->setCurrentItem(1);
76 } 77 }
77 78
78 opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace(); 79 opt = interfaces->getInterfaceOption("wireless_ap", error).simplifyWhiteSpace();
79 if (! opt.isNull()) { 80 if (! opt.isNull()) {
80 specifyAp->setChecked(true); 81 specifyAp->setChecked(true);
81 macEdit->setText(opt); 82 macEdit->setText(opt);
82 } 83 }
83 84
84 opt = interfaces->getInterfaceOption("wireless_channel", error).simplifyWhiteSpace(); 85 opt = interfaces->getInterfaceOption("wireless_channel", error).simplifyWhiteSpace();
85 if (! opt.isNull()) { 86 if (! opt.isNull()) {
86 specifyChan->setChecked(true); 87 specifyChan->setChecked(true);
87 networkChannel->setValue(opt.toInt()); 88 networkChannel->setValue(opt.toInt());
88 } 89 }
89 90
90 opt = interfaces->getInterfaceOption("wireless_key", error).simplifyWhiteSpace(); 91 opt = interfaces->getInterfaceOption("wireless_key", error).simplifyWhiteSpace();
91 if (opt.isNull()) 92 if (opt.isNull())
92 opt = interfaces->getInterfaceOption("wireless_enc", error).simplifyWhiteSpace(); 93 opt = interfaces->getInterfaceOption("wireless_enc", error).simplifyWhiteSpace();
93 parseKeyStr(opt); 94 parseKeyStr(opt);
94} 95}
95 96
96void WLANImp::parseKeyStr(QString keystr) { 97void WLANImp::parseKeyStr(QString keystr) {
97 int loc = 0; 98 int loc = 0;
98 int index = 1; 99 int index = 1;
99 QString key; 100 QString key;
100 QStringList keys = QStringList::split(QRegExp("\\s+"), keystr); 101 QStringList keys = QStringList::split(QRegExp("\\s+"), keystr);
101 int enc = -1; // encryption state 102 int enc = -1; // encryption state
102 103
103 for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) { 104 for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) {
104 if ((*it).left(3) == "off") { 105 if ((*it).left(3) == "off") {
105 // encryption disabled 106 // encryption disabled
106 enc = 0; 107 enc = 0;
107 } else if ((*it).left(2) == "on") { 108 } else if ((*it).left(2) == "on") {
108 // encryption enabled 109 // encryption enabled
109 enc = 1; 110 enc = 1;
110 } else if ((*it).left(4) == "open") { 111 } else if ((*it).left(4) == "open") {
111 // open mode, accept non encrypted packets 112 // open mode, accept non encrypted packets
112 acceptNonEnc->setChecked(true); 113 acceptNonEnc->setChecked(true);
113 } else if ((*it).left(10) == "restricted") { 114 } else if ((*it).left(10) == "restricted") {
114 // restricted mode, only accept encrypted packets 115 // restricted mode, only accept encrypted packets
115 rejectNonEnc->setChecked(true); 116 rejectNonEnc->setChecked(true);
116 } else if ((*it).left(3) == "key") { 117 } else if ((*it).left(3) == "key") {
117 // new set of options 118 // new set of options
118 } else if ((*it).left(1) == "[") { 119 } else if ((*it).left(1) == "[") {
119 index = (*it).mid(1, 1).toInt(); 120 index = (*it).mid(1, 1).toInt();
120 // switch current key to index 121 // switch current key to index
121 switch (index) { 122 switch (index) {
122 case 1: 123 case 1:
123 keyRadio0->setChecked(true); 124 keyRadio0->setChecked(true);
124 break; 125 break;
125 case 2: 126 case 2:
126 keyRadio1->setChecked(true); 127 keyRadio1->setChecked(true);
127 break; 128 break;
128 case 3: 129 case 3:
129 keyRadio2->setChecked(true); 130 keyRadio2->setChecked(true);
130 break; 131 break;
131 case 4: 132 case 4:
132 keyRadio3->setChecked(true); 133 keyRadio3->setChecked(true);
133 break; 134 break;
134 } 135 }
135 } else { 136 } else {
136 // key 137 // key
137 key = (*it); 138 key = (*it);
138 } 139 }
139 if (! key.isNull()) { 140 if (! key.isNull()) {
140 if (enc == -1) 141 if (enc == -1)
141 enc = 1; 142 enc = 1;
142 QStringList::Iterator next = ++it; 143 QStringList::Iterator next = ++it;
143 if (it == keys.end()) { 144 if (it == keys.end()) {
144 break; 145 break;
145 } 146 }
146 if ((*(next)).left(1) == "[") { 147 if ((*(next)).left(1) == "[") {
147 // set key at index 148 // set key at index
148 index = (*(next)).mid(1, 1).toInt(); 149 index = (*(next)).mid(1, 1).toInt();
149 } else { 150 } else {
150 index = 1; 151 index = 1;
151 } 152 }
152 switch (index) { 153 switch (index) {
153 case 1: 154 case 1:
154 keyLineEdit0->setText(key); 155 keyLineEdit0->setText(key);
155 break; 156 break;
156 case 2: 157 case 2:
157 keyLineEdit1->setText(key); 158 keyLineEdit1->setText(key);
158 break; 159 break;
159 case 3: 160 case 3:
160 keyLineEdit2->setText(key); 161 keyLineEdit2->setText(key);
161 break; 162 break;
162 case 4: 163 case 4:
163 keyLineEdit3->setText(key); 164 keyLineEdit3->setText(key);
164 break; 165 break;
165 } 166 }
166 key = QString::null; 167 key = QString::null;
167 } 168 }
168 } 169 }
169 if (enc == 1) { 170 if (enc == 1) {
170 wepEnabled->setChecked(true); 171 wepEnabled->setChecked(true);
171 } else { 172 } else {
172 wepEnabled->setChecked(false); 173 wepEnabled->setChecked(false);
173 } 174 }
174} 175}
175 176
176/** 177/**
177 * Check to see if the current config is valid 178 * Check to see if the current config is valid
178 * Save interfaces 179 * Save interfaces
179 */ 180 */
180void WLANImp::accept() { 181void WLANImp::accept() {
181 if (wepEnabled->isChecked()) { 182 if (wepEnabled->isChecked()) {
182 if ((keyRadio0->isChecked() && keyLineEdit0->text().isEmpty()) || 183 if ((keyRadio0->isChecked() && keyLineEdit0->text().isEmpty()) ||
183 (keyRadio1->isChecked() && keyLineEdit1->text().isEmpty()) || 184 (keyRadio1->isChecked() && keyLineEdit1->text().isEmpty()) ||
184 (keyRadio2->isChecked() && keyLineEdit2->text().isEmpty()) || 185 (keyRadio2->isChecked() && keyLineEdit2->text().isEmpty()) ||
185 (keyRadio3->isChecked() && keyLineEdit3->text().isEmpty())) { 186 (keyRadio3->isChecked() && keyLineEdit3->text().isEmpty())) {
186 QMessageBox::information(this, "Error", "Please enter a WEP key.", QMessageBox::Ok); 187 QMessageBox::information(this, "Error", "Please enter a WEP key.", QMessageBox::Ok);
187 return; 188 return;
188 } 189 }
189 } 190 }
190 191
191 if (essid->currentText().isEmpty()) { 192 if (essid->currentText().isEmpty()) {
192 QMessageBox::information(this, "Error", "Please select/enter an ESSID.", QMessageBox::Ok); 193 QMessageBox::information(this, "Error", "Please select/enter an ESSID.", QMessageBox::Ok);
193 return; 194 return;
194 } 195 }
195 196
196 if (specifyAp->isChecked() && macEdit->text().isEmpty()) { 197 if (specifyAp->isChecked() && macEdit->text().isEmpty()) {
197 QMessageBox::information(this, "Error", "Please enter the MAC address of the Access Point.", QMessageBox::Ok); 198 QMessageBox::information(this, "Error", "Please enter the MAC address of the Access Point.", QMessageBox::Ok);
198 return; 199 return;
199 } 200 }
200 201
201 // Try to save the interfaces settings. 202 // Try to save the interfaces settings.
202 writeOpts(); 203 writeOpts();
203 204
204 // Close out the dialog 205 // Close out the dialog
205 QDialog::accept(); 206 QDialog::accept();
206} 207}
207 208
208void WLANImp::writeOpts() { 209void WLANImp::writeOpts() {
209 bool error = false; 210 bool error = false;
210 211
211 interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText()); 212 interfaces->setInterfaceOption(QString("wireless_mode"), mode->currentText());
212 interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText()); 213 interfaces->setInterfaceOption(QString("wireless_essid"), essid->currentText());
213 214
214 if (specifyAp->isChecked()) { 215 if (specifyAp->isChecked()) {
215 interfaces->setInterfaceOption(QString("wireless_ap"), macEdit->text()); 216 interfaces->setInterfaceOption(QString("wireless_ap"), macEdit->text());
216 } else { 217 } else {
217 interfaces->removeInterfaceOption(QString("wireless_ap")); 218 interfaces->removeInterfaceOption(QString("wireless_ap"));
218 } 219 }
219 220
220 if (specifyChan->isChecked()) { 221 if (specifyChan->isChecked()) {
221 interfaces->setInterfaceOption(QString("wireless_channel"), networkChannel->text()); 222 interfaces->setInterfaceOption(QString("wireless_channel"), networkChannel->text());
222 } else { 223 } else {
223 interfaces->removeInterfaceOption(QString("wireless_channel")); 224 interfaces->removeInterfaceOption(QString("wireless_channel"));
224 } 225 }
225 226
226 if (wepEnabled->isChecked()) { 227 if (wepEnabled->isChecked()) {
227 QStringList keyList; 228 QStringList keyList;
228 229
229 if (! keyLineEdit0->text().isNull()) { 230 if (! keyLineEdit0->text().isNull()) {
230 keyList += keyLineEdit0->text(); 231 keyList += keyLineEdit0->text();
231 keyList += "[1]"; 232 keyList += "[1]";
232 } else if (! keyLineEdit1->text().isNull()) { 233 } else if (! keyLineEdit1->text().isNull()) {
233 keyList += keyLineEdit1->text(); 234 keyList += keyLineEdit1->text();
234 keyList += "[2]"; 235 keyList += "[2]";
235 } else if (! keyLineEdit2->text().isNull()) { 236 } else if (! keyLineEdit2->text().isNull()) {
236 keyList += keyLineEdit2->text(); 237 keyList += keyLineEdit2->text();
237 keyList += "[3]"; 238 keyList += "[3]";
238 } else if (! keyLineEdit3->text().isNull()) { 239 } else if (! keyLineEdit3->text().isNull()) {
239 keyList += keyLineEdit3->text(); 240 keyList += keyLineEdit3->text();
240 keyList += "[4]"; 241 keyList += "[4]";
241 } 242 }
242 if (acceptNonEnc->isChecked()) { 243 if (acceptNonEnc->isChecked()) {
243 keyList += "open"; 244 keyList += "open";
244 } else { 245 } else {
245 keyList += "restricted"; 246 keyList += "restricted";
246 } 247 }
247 248
248 keyList += "key"; 249 keyList += "key";
249 if (keyRadio0->isChecked()) { 250 if (keyRadio0->isChecked()) {
250 keyList += "[1]"; 251 keyList += "[1]";
251 } else if (keyRadio1->isChecked()) { 252 } else if (keyRadio1->isChecked()) {
252 keyList += "[2]"; 253 keyList += "[2]";
253 } else if (keyRadio2->isChecked()) { 254 } else if (keyRadio2->isChecked()) {
254 keyList += "[3]"; 255 keyList += "[3]";
255 } else if (keyRadio3->isChecked()) { 256 } else if (keyRadio3->isChecked()) {
256 keyList += "[4]"; 257 keyList += "[4]";
257 } 258 }
258 interfaces->setInterfaceOption(QString("wireless_key"), keyList.join(QString(" "))); 259 interfaces->setInterfaceOption(QString("wireless_key"), keyList.join(QString(" ")));
259 } else { 260 } else {
260 interfaces->removeInterfaceOption(QString("wireless_key")); 261 interfaces->removeInterfaceOption(QString("wireless_key"));
261 } 262 }
262 interfaces->removeInterfaceOption(QString("wireless_enc")); 263 interfaces->removeInterfaceOption(QString("wireless_enc"));
263 264
264 if(!interfaceSetup->saveChanges()) 265 if(!interfaceSetup->saveChanges())
265 return; 266 return;
266 267
267 QDialog::accept(); 268 QDialog::accept();
268} 269}