author | benmeyer <benmeyer> | 2002-12-11 22:08:02 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-12-11 22:08:02 (UTC) |
commit | 6523ee46d49203d11f34a3dbbf966a318cef7def (patch) (unidiff) | |
tree | 2a51a44e1fb114c3f4d8f3965d5106c8930fba16 | |
parent | c5737bbbe357ea7481a9f6a406ef81bbeba0d541 (diff) | |
download | opie-6523ee46d49203d11f34a3dbbf966a318cef7def.zip opie-6523ee46d49203d11f34a3dbbf966a318cef7def.tar.gz opie-6523ee46d49203d11f34a3dbbf966a318cef7def.tar.bz2 |
New cleaner layout
-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 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlan.ui | 173 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 45 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.h | 3 |
6 files changed, 212 insertions, 230 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 | |||
@@ -1,259 +1,234 @@ | |||
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>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> |
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>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> |
224 | <width>20</width> | 199 | <width>20</width> |
225 | <height>20</height> | 200 | <height>20</height> |
226 | </size> | 201 | </size> |
227 | </property> | 202 | </property> |
228 | </spacer> | 203 | </spacer> |
229 | </grid> | 204 | </grid> |
230 | </widget> | 205 | </widget> |
231 | <spacer> | 206 | <spacer> |
232 | <property> | 207 | <property> |
233 | <name>name</name> | 208 | <name>name</name> |
234 | <cstring>Spacer31</cstring> | 209 | <cstring>Spacer31</cstring> |
235 | </property> | 210 | </property> |
236 | <property stdset="1"> | 211 | <property stdset="1"> |
237 | <name>orientation</name> | 212 | <name>orientation</name> |
238 | <enum>Vertical</enum> | 213 | <enum>Vertical</enum> |
239 | </property> | 214 | </property> |
240 | <property stdset="1"> | 215 | <property stdset="1"> |
241 | <name>sizeType</name> | 216 | <name>sizeType</name> |
242 | <enum>Expanding</enum> | 217 | <enum>Expanding</enum> |
243 | </property> | 218 | </property> |
244 | <property> | 219 | <property> |
245 | <name>sizeHint</name> | 220 | <name>sizeHint</name> |
246 | <size> | 221 | <size> |
247 | <width>20</width> | 222 | <width>20</width> |
248 | <height>20</height> | 223 | <height>20</height> |
249 | </size> | 224 | </size> |
250 | </property> | 225 | </property> |
251 | </spacer> | 226 | </spacer> |
252 | </vbox> | 227 | </vbox> |
253 | </widget> | 228 | </widget> |
254 | <widget> | 229 | <widget> |
255 | <class>QWidget</class> | 230 | <class>QWidget</class> |
256 | <property stdset="1"> | 231 | <property stdset="1"> |
257 | <name>name</name> | 232 | <name>name</name> |
258 | <cstring>WepPage</cstring> | 233 | <cstring>WepPage</cstring> |
259 | </property> | 234 | </property> |
@@ -291,230 +266,226 @@ | |||
291 | <name>enabled</name> | 266 | <name>enabled</name> |
292 | <bool>false</bool> | 267 | <bool>false</bool> |
293 | </property> | 268 | </property> |
294 | <property stdset="1"> | 269 | <property stdset="1"> |
295 | <name>title</name> | 270 | <name>title</name> |
296 | <string>Authentication Type</string> | 271 | <string>Authentication Type</string> |
297 | </property> | 272 | </property> |
298 | <hbox> | 273 | <hbox> |
299 | <property stdset="1"> | 274 | <property stdset="1"> |
300 | <name>margin</name> | 275 | <name>margin</name> |
301 | <number>11</number> | 276 | <number>11</number> |
302 | </property> | 277 | </property> |
303 | <property stdset="1"> | 278 | <property stdset="1"> |
304 | <name>spacing</name> | 279 | <name>spacing</name> |
305 | <number>6</number> | 280 | <number>6</number> |
306 | </property> | 281 | </property> |
307 | <widget> | 282 | <widget> |
308 | <class>QRadioButton</class> | 283 | <class>QRadioButton</class> |
309 | <property stdset="1"> | 284 | <property stdset="1"> |
310 | <name>name</name> | 285 | <name>name</name> |
311 | <cstring>authOpen</cstring> | 286 | <cstring>authOpen</cstring> |
312 | </property> | 287 | </property> |
313 | <property stdset="1"> | 288 | <property stdset="1"> |
314 | <name>text</name> | 289 | <name>text</name> |
315 | <string>Open System</string> | 290 | <string>Open System</string> |
316 | </property> | 291 | </property> |
317 | <property stdset="1"> | 292 | <property stdset="1"> |
318 | <name>checked</name> | 293 | <name>checked</name> |
319 | <bool>true</bool> | 294 | <bool>true</bool> |
320 | </property> | 295 | </property> |
321 | </widget> | 296 | </widget> |
322 | <widget> | 297 | <widget> |
323 | <class>QRadioButton</class> | 298 | <class>QRadioButton</class> |
324 | <property stdset="1"> | 299 | <property stdset="1"> |
325 | <name>name</name> | 300 | <name>name</name> |
326 | <cstring>authShared</cstring> | 301 | <cstring>authShared</cstring> |
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"> |
397 | <name>checked</name> | 388 | <name>checked</name> |
398 | <bool>true</bool> | 389 | <bool>true</bool> |
399 | </property> | 390 | </property> |
400 | </widget> | 391 | </widget> |
401 | <widget row="1" column="0" > | 392 | <widget row="1" column="0" > |
402 | <class>QRadioButton</class> | 393 | <class>QRadioButton</class> |
403 | <property stdset="1"> | 394 | <property stdset="1"> |
404 | <name>name</name> | 395 | <name>name</name> |
405 | <cstring>keyRadio1</cstring> | 396 | <cstring>keyRadio1</cstring> |
406 | </property> | 397 | </property> |
407 | <property stdset="1"> | 398 | <property stdset="1"> |
408 | <name>text</name> | 399 | <name>text</name> |
409 | <string>Key 2</string> | 400 | <string>Key 2</string> |
410 | </property> | 401 | </property> |
411 | </widget> | 402 | </widget> |
412 | <widget row="2" column="0" > | 403 | <widget row="2" column="0" > |
413 | <class>QRadioButton</class> | 404 | <class>QRadioButton</class> |
414 | <property stdset="1"> | 405 | <property stdset="1"> |
415 | <name>name</name> | 406 | <name>name</name> |
416 | <cstring>keyRadio2</cstring> | 407 | <cstring>keyRadio2</cstring> |
417 | </property> | 408 | </property> |
418 | <property stdset="1"> | 409 | <property stdset="1"> |
419 | <name>text</name> | 410 | <name>text</name> |
420 | <string>Key 3</string> | 411 | <string>Key 3</string> |
421 | </property> | 412 | </property> |
422 | </widget> | 413 | </widget> |
423 | <widget row="3" column="0" > | 414 | <widget row="3" column="0" > |
424 | <class>QRadioButton</class> | 415 | <class>QRadioButton</class> |
425 | <property stdset="1"> | 416 | <property stdset="1"> |
426 | <name>name</name> | 417 | <name>name</name> |
427 | <cstring>keyRadio3</cstring> | 418 | <cstring>keyRadio3</cstring> |
428 | </property> | 419 | </property> |
429 | <property stdset="1"> | 420 | <property stdset="1"> |
430 | <name>text</name> | 421 | <name>text</name> |
431 | <string>Key 4</string> | 422 | <string>Key 4</string> |
432 | </property> | 423 | </property> |
433 | </widget> | 424 | </widget> |
434 | </grid> | 425 | </grid> |
435 | </widget> | 426 | </widget> |
436 | <spacer> | 427 | <spacer> |
437 | <property> | 428 | <property> |
438 | <name>name</name> | 429 | <name>name</name> |
439 | <cstring>Spacer30</cstring> | 430 | <cstring>Spacer30</cstring> |
440 | </property> | 431 | </property> |
441 | <property stdset="1"> | 432 | <property stdset="1"> |
442 | <name>orientation</name> | 433 | <name>orientation</name> |
443 | <enum>Vertical</enum> | 434 | <enum>Vertical</enum> |
444 | </property> | 435 | </property> |
445 | <property stdset="1"> | 436 | <property stdset="1"> |
446 | <name>sizeType</name> | 437 | <name>sizeType</name> |
447 | <enum>Expanding</enum> | 438 | <enum>Expanding</enum> |
448 | </property> | 439 | </property> |
449 | <property> | 440 | <property> |
450 | <name>sizeHint</name> | 441 | <name>sizeHint</name> |
451 | <size> | 442 | <size> |
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> |
519 | </tabstops> | 490 | </tabstops> |
520 | </UI> | 491 | </UI> |
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,227 +1,244 @@ | |||
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"); |
25 | 27 | ||
26 | // Read in the config file. | 28 | // Read in the config file. |
27 | QString wlanFile = WIRELESS_OPTS; | 29 | QString wlanFile = WIRELESS_OPTS; |
28 | QFile file(wlanFile); | 30 | QFile file(wlanFile); |
29 | if (file.open(IO_ReadOnly)){ | 31 | if (file.open(IO_ReadOnly)){ |
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. |
54 | */ | 63 | */ |
55 | void WLANImp::parseSettingFile(){ | 64 | void WLANImp::parseSettingFile(){ |
56 | bool foundCase = false; | 65 | bool foundCase = false; |
57 | bool found = false; | 66 | bool found = false; |
58 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { | 67 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { |
59 | QString line = (*it).simplifyWhiteSpace(); | 68 | QString line = (*it).simplifyWhiteSpace(); |
60 | if(line.contains("case")) | 69 | if(line.contains("case")) |
61 | foundCase = true; | 70 | foundCase = true; |
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=")){ |
103 | wepEnabled->setChecked(true); | 108 | wepEnabled->setChecked(true); |
104 | QString key; | 109 | QString key; |
105 | if(line.right(5) == (" open")){ | 110 | if(line.right(5) == (" open")){ |
106 | key = line.mid(4, line.length()-5); | 111 | key = line.mid(4, line.length()-5); |
107 | authOpen->setChecked(true); | 112 | authOpen->setChecked(true); |
108 | authShared->setChecked(false); | 113 | authShared->setChecked(false); |
109 | } | 114 | } |
110 | else{ | 115 | else{ |
111 | authOpen->setChecked(false); | 116 | authOpen->setChecked(false); |
112 | authShared->setChecked(true); | 117 | authShared->setChecked(true); |
113 | key = line.mid(4, line.length()); | 118 | key = line.mid(4, line.length()); |
114 | } | 119 | } |
115 | if(key == keyLineEdit0->text()) keyRadio0->setChecked(true); | 120 | if(key == keyLineEdit0->text()) keyRadio0->setChecked(true); |
116 | if(key == keyLineEdit1->text()) keyRadio1->setChecked(true); | 121 | if(key == keyLineEdit1->text()) keyRadio1->setChecked(true); |
117 | if(key == keyLineEdit2->text()) keyRadio2->setChecked(true); | 122 | if(key == keyLineEdit2->text()) keyRadio2->setChecked(true); |
118 | if(key == keyLineEdit3->text()) keyRadio3->setChecked(true); | 123 | if(key == keyLineEdit3->text()) keyRadio3->setChecked(true); |
119 | } | 124 | } |
120 | if(line.contains("CHANNEL=")){ | 125 | if(line.contains("CHANNEL=")){ |
121 | networkChannel->setValue(line.mid(line.find("CHANNEL=")+8, line.length()).toInt()); | 126 | networkChannel->setValue(line.mid(line.find("CHANNEL=")+8, line.length()).toInt()); |
122 | } | 127 | } |
123 | } | 128 | } |
124 | } | 129 | } |
125 | } | 130 | } |
126 | 131 | ||
127 | /** | 132 | /** |
128 | * Saves settings to the wireless.opts file using the current profile | 133 | * Saves settings to the wireless.opts file using the current profile |
129 | */ | 134 | */ |
130 | void WLANImp::changeAndSaveSettingFile(){ | 135 | void WLANImp::changeAndSaveSettingFile(){ |
131 | QString wlanFile = WIRELESS_OPTS; | 136 | QString wlanFile = WIRELESS_OPTS; |
132 | QFile::remove(wlanFile); | 137 | QFile::remove(wlanFile); |
133 | QFile file(wlanFile); | 138 | QFile file(wlanFile); |
134 | 139 | ||
135 | if (!file.open(IO_ReadWrite)){ | 140 | if (!file.open(IO_ReadWrite)){ |
136 | qDebug(QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1()); | 141 | qDebug(QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1()); |
137 | return; | 142 | return; |
138 | } | 143 | } |
139 | 144 | ||
140 | QTextStream stream( &file ); | 145 | QTextStream stream( &file ); |
141 | bool foundCase = false; | 146 | bool foundCase = false; |
142 | bool found = false; | 147 | bool found = false; |
143 | bool output = true; | 148 | bool output = true; |
144 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { | 149 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { |
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 |
223 | QDialog::accept(); | 240 | QDialog::accept(); |
224 | } | 241 | } |
225 | 242 | ||
226 | // wlanimp.cpp | 243 | // wlanimp.cpp |
227 | 244 | ||
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 | |||
@@ -1,31 +1,34 @@ | |||
1 | #ifndef WLANIMP_H | 1 | #ifndef WLANIMP_H |
2 | #define WLANIMP_H | 2 | #define WLANIMP_H |
3 | 3 | ||
4 | #include "wlan.h" | 4 | #include "wlan.h" |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | 6 | ||
7 | class InterfaceSetupImp; | 7 | class InterfaceSetupImp; |
8 | class Interface; | 8 | 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 | ||
diff --git a/noncore/settings/networksettings/wlan/wlan.ui b/noncore/settings/networksettings/wlan/wlan.ui index 47d6db6..09593b3 100644 --- a/noncore/settings/networksettings/wlan/wlan.ui +++ b/noncore/settings/networksettings/wlan/wlan.ui | |||
@@ -1,259 +1,234 @@ | |||
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>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> |
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>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> |
224 | <width>20</width> | 199 | <width>20</width> |
225 | <height>20</height> | 200 | <height>20</height> |
226 | </size> | 201 | </size> |
227 | </property> | 202 | </property> |
228 | </spacer> | 203 | </spacer> |
229 | </grid> | 204 | </grid> |
230 | </widget> | 205 | </widget> |
231 | <spacer> | 206 | <spacer> |
232 | <property> | 207 | <property> |
233 | <name>name</name> | 208 | <name>name</name> |
234 | <cstring>Spacer31</cstring> | 209 | <cstring>Spacer31</cstring> |
235 | </property> | 210 | </property> |
236 | <property stdset="1"> | 211 | <property stdset="1"> |
237 | <name>orientation</name> | 212 | <name>orientation</name> |
238 | <enum>Vertical</enum> | 213 | <enum>Vertical</enum> |
239 | </property> | 214 | </property> |
240 | <property stdset="1"> | 215 | <property stdset="1"> |
241 | <name>sizeType</name> | 216 | <name>sizeType</name> |
242 | <enum>Expanding</enum> | 217 | <enum>Expanding</enum> |
243 | </property> | 218 | </property> |
244 | <property> | 219 | <property> |
245 | <name>sizeHint</name> | 220 | <name>sizeHint</name> |
246 | <size> | 221 | <size> |
247 | <width>20</width> | 222 | <width>20</width> |
248 | <height>20</height> | 223 | <height>20</height> |
249 | </size> | 224 | </size> |
250 | </property> | 225 | </property> |
251 | </spacer> | 226 | </spacer> |
252 | </vbox> | 227 | </vbox> |
253 | </widget> | 228 | </widget> |
254 | <widget> | 229 | <widget> |
255 | <class>QWidget</class> | 230 | <class>QWidget</class> |
256 | <property stdset="1"> | 231 | <property stdset="1"> |
257 | <name>name</name> | 232 | <name>name</name> |
258 | <cstring>WepPage</cstring> | 233 | <cstring>WepPage</cstring> |
259 | </property> | 234 | </property> |
@@ -291,230 +266,226 @@ | |||
291 | <name>enabled</name> | 266 | <name>enabled</name> |
292 | <bool>false</bool> | 267 | <bool>false</bool> |
293 | </property> | 268 | </property> |
294 | <property stdset="1"> | 269 | <property stdset="1"> |
295 | <name>title</name> | 270 | <name>title</name> |
296 | <string>Authentication Type</string> | 271 | <string>Authentication Type</string> |
297 | </property> | 272 | </property> |
298 | <hbox> | 273 | <hbox> |
299 | <property stdset="1"> | 274 | <property stdset="1"> |
300 | <name>margin</name> | 275 | <name>margin</name> |
301 | <number>11</number> | 276 | <number>11</number> |
302 | </property> | 277 | </property> |
303 | <property stdset="1"> | 278 | <property stdset="1"> |
304 | <name>spacing</name> | 279 | <name>spacing</name> |
305 | <number>6</number> | 280 | <number>6</number> |
306 | </property> | 281 | </property> |
307 | <widget> | 282 | <widget> |
308 | <class>QRadioButton</class> | 283 | <class>QRadioButton</class> |
309 | <property stdset="1"> | 284 | <property stdset="1"> |
310 | <name>name</name> | 285 | <name>name</name> |
311 | <cstring>authOpen</cstring> | 286 | <cstring>authOpen</cstring> |
312 | </property> | 287 | </property> |
313 | <property stdset="1"> | 288 | <property stdset="1"> |
314 | <name>text</name> | 289 | <name>text</name> |
315 | <string>Open System</string> | 290 | <string>Open System</string> |
316 | </property> | 291 | </property> |
317 | <property stdset="1"> | 292 | <property stdset="1"> |
318 | <name>checked</name> | 293 | <name>checked</name> |
319 | <bool>true</bool> | 294 | <bool>true</bool> |
320 | </property> | 295 | </property> |
321 | </widget> | 296 | </widget> |
322 | <widget> | 297 | <widget> |
323 | <class>QRadioButton</class> | 298 | <class>QRadioButton</class> |
324 | <property stdset="1"> | 299 | <property stdset="1"> |
325 | <name>name</name> | 300 | <name>name</name> |
326 | <cstring>authShared</cstring> | 301 | <cstring>authShared</cstring> |
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"> |
397 | <name>checked</name> | 388 | <name>checked</name> |
398 | <bool>true</bool> | 389 | <bool>true</bool> |
399 | </property> | 390 | </property> |
400 | </widget> | 391 | </widget> |
401 | <widget row="1" column="0" > | 392 | <widget row="1" column="0" > |
402 | <class>QRadioButton</class> | 393 | <class>QRadioButton</class> |
403 | <property stdset="1"> | 394 | <property stdset="1"> |
404 | <name>name</name> | 395 | <name>name</name> |
405 | <cstring>keyRadio1</cstring> | 396 | <cstring>keyRadio1</cstring> |
406 | </property> | 397 | </property> |
407 | <property stdset="1"> | 398 | <property stdset="1"> |
408 | <name>text</name> | 399 | <name>text</name> |
409 | <string>Key 2</string> | 400 | <string>Key 2</string> |
410 | </property> | 401 | </property> |
411 | </widget> | 402 | </widget> |
412 | <widget row="2" column="0" > | 403 | <widget row="2" column="0" > |
413 | <class>QRadioButton</class> | 404 | <class>QRadioButton</class> |
414 | <property stdset="1"> | 405 | <property stdset="1"> |
415 | <name>name</name> | 406 | <name>name</name> |
416 | <cstring>keyRadio2</cstring> | 407 | <cstring>keyRadio2</cstring> |
417 | </property> | 408 | </property> |
418 | <property stdset="1"> | 409 | <property stdset="1"> |
419 | <name>text</name> | 410 | <name>text</name> |
420 | <string>Key 3</string> | 411 | <string>Key 3</string> |
421 | </property> | 412 | </property> |
422 | </widget> | 413 | </widget> |
423 | <widget row="3" column="0" > | 414 | <widget row="3" column="0" > |
424 | <class>QRadioButton</class> | 415 | <class>QRadioButton</class> |
425 | <property stdset="1"> | 416 | <property stdset="1"> |
426 | <name>name</name> | 417 | <name>name</name> |
427 | <cstring>keyRadio3</cstring> | 418 | <cstring>keyRadio3</cstring> |
428 | </property> | 419 | </property> |
429 | <property stdset="1"> | 420 | <property stdset="1"> |
430 | <name>text</name> | 421 | <name>text</name> |
431 | <string>Key 4</string> | 422 | <string>Key 4</string> |
432 | </property> | 423 | </property> |
433 | </widget> | 424 | </widget> |
434 | </grid> | 425 | </grid> |
435 | </widget> | 426 | </widget> |
436 | <spacer> | 427 | <spacer> |
437 | <property> | 428 | <property> |
438 | <name>name</name> | 429 | <name>name</name> |
439 | <cstring>Spacer30</cstring> | 430 | <cstring>Spacer30</cstring> |
440 | </property> | 431 | </property> |
441 | <property stdset="1"> | 432 | <property stdset="1"> |
442 | <name>orientation</name> | 433 | <name>orientation</name> |
443 | <enum>Vertical</enum> | 434 | <enum>Vertical</enum> |
444 | </property> | 435 | </property> |
445 | <property stdset="1"> | 436 | <property stdset="1"> |
446 | <name>sizeType</name> | 437 | <name>sizeType</name> |
447 | <enum>Expanding</enum> | 438 | <enum>Expanding</enum> |
448 | </property> | 439 | </property> |
449 | <property> | 440 | <property> |
450 | <name>sizeHint</name> | 441 | <name>sizeHint</name> |
451 | <size> | 442 | <size> |
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> |
519 | </tabstops> | 490 | </tabstops> |
520 | </UI> | 491 | </UI> |
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 6a56358..ef7329e 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -1,227 +1,244 @@ | |||
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"); |
25 | 27 | ||
26 | // Read in the config file. | 28 | // Read in the config file. |
27 | QString wlanFile = WIRELESS_OPTS; | 29 | QString wlanFile = WIRELESS_OPTS; |
28 | QFile file(wlanFile); | 30 | QFile file(wlanFile); |
29 | if (file.open(IO_ReadOnly)){ | 31 | if (file.open(IO_ReadOnly)){ |
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. |
54 | */ | 63 | */ |
55 | void WLANImp::parseSettingFile(){ | 64 | void WLANImp::parseSettingFile(){ |
56 | bool foundCase = false; | 65 | bool foundCase = false; |
57 | bool found = false; | 66 | bool found = false; |
58 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { | 67 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { |
59 | QString line = (*it).simplifyWhiteSpace(); | 68 | QString line = (*it).simplifyWhiteSpace(); |
60 | if(line.contains("case")) | 69 | if(line.contains("case")) |
61 | foundCase = true; | 70 | foundCase = true; |
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=")){ |
103 | wepEnabled->setChecked(true); | 108 | wepEnabled->setChecked(true); |
104 | QString key; | 109 | QString key; |
105 | if(line.right(5) == (" open")){ | 110 | if(line.right(5) == (" open")){ |
106 | key = line.mid(4, line.length()-5); | 111 | key = line.mid(4, line.length()-5); |
107 | authOpen->setChecked(true); | 112 | authOpen->setChecked(true); |
108 | authShared->setChecked(false); | 113 | authShared->setChecked(false); |
109 | } | 114 | } |
110 | else{ | 115 | else{ |
111 | authOpen->setChecked(false); | 116 | authOpen->setChecked(false); |
112 | authShared->setChecked(true); | 117 | authShared->setChecked(true); |
113 | key = line.mid(4, line.length()); | 118 | key = line.mid(4, line.length()); |
114 | } | 119 | } |
115 | if(key == keyLineEdit0->text()) keyRadio0->setChecked(true); | 120 | if(key == keyLineEdit0->text()) keyRadio0->setChecked(true); |
116 | if(key == keyLineEdit1->text()) keyRadio1->setChecked(true); | 121 | if(key == keyLineEdit1->text()) keyRadio1->setChecked(true); |
117 | if(key == keyLineEdit2->text()) keyRadio2->setChecked(true); | 122 | if(key == keyLineEdit2->text()) keyRadio2->setChecked(true); |
118 | if(key == keyLineEdit3->text()) keyRadio3->setChecked(true); | 123 | if(key == keyLineEdit3->text()) keyRadio3->setChecked(true); |
119 | } | 124 | } |
120 | if(line.contains("CHANNEL=")){ | 125 | if(line.contains("CHANNEL=")){ |
121 | networkChannel->setValue(line.mid(line.find("CHANNEL=")+8, line.length()).toInt()); | 126 | networkChannel->setValue(line.mid(line.find("CHANNEL=")+8, line.length()).toInt()); |
122 | } | 127 | } |
123 | } | 128 | } |
124 | } | 129 | } |
125 | } | 130 | } |
126 | 131 | ||
127 | /** | 132 | /** |
128 | * Saves settings to the wireless.opts file using the current profile | 133 | * Saves settings to the wireless.opts file using the current profile |
129 | */ | 134 | */ |
130 | void WLANImp::changeAndSaveSettingFile(){ | 135 | void WLANImp::changeAndSaveSettingFile(){ |
131 | QString wlanFile = WIRELESS_OPTS; | 136 | QString wlanFile = WIRELESS_OPTS; |
132 | QFile::remove(wlanFile); | 137 | QFile::remove(wlanFile); |
133 | QFile file(wlanFile); | 138 | QFile file(wlanFile); |
134 | 139 | ||
135 | if (!file.open(IO_ReadWrite)){ | 140 | if (!file.open(IO_ReadWrite)){ |
136 | qDebug(QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1()); | 141 | qDebug(QString("WLANImp::changeAndSaveSettingFile(): Can't open file: %1 for writing.").arg(wlanFile).latin1()); |
137 | return; | 142 | return; |
138 | } | 143 | } |
139 | 144 | ||
140 | QTextStream stream( &file ); | 145 | QTextStream stream( &file ); |
141 | bool foundCase = false; | 146 | bool foundCase = false; |
142 | bool found = false; | 147 | bool found = false; |
143 | bool output = true; | 148 | bool output = true; |
144 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { | 149 | for ( QStringList::Iterator it = settingsFileText.begin(); it != settingsFileText.end(); ++it ) { |
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 |
223 | QDialog::accept(); | 240 | QDialog::accept(); |
224 | } | 241 | } |
225 | 242 | ||
226 | // wlanimp.cpp | 243 | // wlanimp.cpp |
227 | 244 | ||
diff --git a/noncore/settings/networksettings/wlan/wlanimp.h b/noncore/settings/networksettings/wlan/wlanimp.h index df599af..310836c 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.h +++ b/noncore/settings/networksettings/wlan/wlanimp.h | |||
@@ -1,31 +1,34 @@ | |||
1 | #ifndef WLANIMP_H | 1 | #ifndef WLANIMP_H |
2 | #define WLANIMP_H | 2 | #define WLANIMP_H |
3 | 3 | ||
4 | #include "wlan.h" | 4 | #include "wlan.h" |
5 | #include <qstringlist.h> | 5 | #include <qstringlist.h> |
6 | 6 | ||
7 | class InterfaceSetupImp; | 7 | class InterfaceSetupImp; |
8 | class Interface; | 8 | 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 | ||