-rw-r--r-- | noncore/settings/networksettings/wlan/config.in | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/opie-networksettingsplugin-wlan.control | 2 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlan.pro | 2 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlan.ui | 658 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.cpp | 216 | ||||
-rw-r--r-- | noncore/settings/networksettings/wlan/wlanimp2.h | 21 | ||||
-rw-r--r-- | pics/networksettings/adhoc.png | bin | 0 -> 694 bytes | |||
-rw-r--r-- | pics/networksettings/managed.png | bin | 0 -> 410 bytes |
9 files changed, 577 insertions, 328 deletions
diff --git a/noncore/settings/networksettings/wlan/config.in b/noncore/settings/networksettings/wlan/config.in index 53bcb1e..e459788 100644 --- a/noncore/settings/networksettings/wlan/config.in +++ b/noncore/settings/networksettings/wlan/config.in | |||
@@ -1,4 +1,6 @@ | |||
1 | config WLAN | 1 | config WLAN |
2 | boolean "opie-networksettingsplugin-wlan (wireless LAN module)" | 2 | boolean "opie-networksettingsplugin-wlan (wireless LAN module)" |
3 | default "n" if NETWORKSETUP | 3 | default "n" if NETWORKSETUP |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NETWORKSETUP && NETWORKSETUP-CORE && INTERFACES | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NETWORKSETUP && NETWORKSETUP-CORE && INTERFACES && LIBOPIE2NET |
5 | #comment "opie-networksettingsplugin-wlan needs libopie, libopie2net and networksetup" | ||
6 | #depends !( LIBOPIE2NET && LIBOPIE && NETWORKSETUP) \ No newline at end of file | ||
diff --git a/noncore/settings/networksettings/wlan/opie-networksettingsplugin-wlan.control b/noncore/settings/networksettings/wlan/opie-networksettingsplugin-wlan.control index 719337f..ec3078d 100644 --- a/noncore/settings/networksettings/wlan/opie-networksettingsplugin-wlan.control +++ b/noncore/settings/networksettings/wlan/opie-networksettingsplugin-wlan.control | |||
@@ -1,10 +1,10 @@ | |||
1 | Package: opie-networksettingsplugin-wlan | 1 | Package: opie-networksettingsplugin-wlan |
2 | Files: plugins/networksettings/libwlan.so* | 2 | Files: plugins/networksettings/libwlan.so* |
3 | Priority: optional | 3 | Priority: optional |
4 | Section: opie/settings | 4 | Section: opie/settings |
5 | Maintainer: Patrick S. Vogt <tille@handhelds.org> | 5 | Maintainer: Patrick S. Vogt <tille@handhelds.org> |
6 | Architecture: arm | 6 | Architecture: arm |
7 | Depends: opie-networksettings | 7 | Depends: opie-networksettings, libopie2net (1.8.1) |
8 | Description: Network settings wavelan plugin. | 8 | Description: Network settings wavelan plugin. |
9 | 9 | ||
10 | Version: $QPE_VERSION$EXTRAVERSION | 10 | Version: $QPE_VERSION$EXTRAVERSION |
diff --git a/noncore/settings/networksettings/wlan/wlan.pro b/noncore/settings/networksettings/wlan/wlan.pro index 552c669..82a5b2f 100644 --- a/noncore/settings/networksettings/wlan/wlan.pro +++ b/noncore/settings/networksettings/wlan/wlan.pro | |||
@@ -1,28 +1,28 @@ | |||
1 | # | 1 | # |
2 | TEMPLATE = lib | 2 | TEMPLATE = lib |
3 | #TEMPLATE = app | 3 | #TEMPLATE = app |
4 | CONFIG += qt warn_on release | 4 | CONFIG += qt warn_on release |
5 | #CONFIG += qt warn_on debug | 5 | #CONFIG += qt warn_on debug |
6 | DESTDIR = $(OPIEDIR)/plugins/networksettings | 6 | DESTDIR = $(OPIEDIR)/plugins/networksettings |
7 | HEADERS = infoimp.h wlanmodule.h wextensions.h keyedit.h | 7 | HEADERS = infoimp.h wlanmodule.h wextensions.h keyedit.h |
8 | SOURCES = infoimp.cpp wlanmodule.cpp wextensions.cpp keyedit.cpp | 8 | SOURCES = infoimp.cpp wlanmodule.cpp wextensions.cpp keyedit.cpp |
9 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ | 9 | INCLUDEPATH+= $(OPIEDIR)/include ../ ../interfaces/ |
10 | DEPENDPATH+= $(OPIEDIR)/include | 10 | DEPENDPATH+= $(OPIEDIR)/include |
11 | LIBS += -lqpe -L../interfaces/ -linterfaces | 11 | LIBS += -lqpe -L../interfaces/ -linterfaces -lopienet2 |
12 | INTERFACES= wlan.ui info.ui | 12 | INTERFACES= wlan.ui info.ui |
13 | TARGET = wlan | 13 | TARGET = wlan |
14 | VERSION = 1.0.0 | 14 | VERSION = 1.0.0 |
15 | 15 | ||
16 | #CONFIG += wirelessopts | 16 | #CONFIG += wirelessopts |
17 | 17 | ||
18 | wirelessopts { | 18 | wirelessopts { |
19 | HEADERS+= wlanimp.h | 19 | HEADERS+= wlanimp.h |
20 | SOURCES+= wlanimp.cpp | 20 | SOURCES+= wlanimp.cpp |
21 | } | 21 | } |
22 | 22 | ||
23 | ! wirelessopts { | 23 | ! wirelessopts { |
24 | HEADERS+= wlanimp2.h | 24 | HEADERS+= wlanimp2.h |
25 | SOURCES += wlanimp2.cpp | 25 | SOURCES += wlanimp2.cpp |
26 | } | 26 | } |
27 | 27 | ||
28 | include ( $(OPIEDIR)/include.pro ) | 28 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/settings/networksettings/wlan/wlan.ui b/noncore/settings/networksettings/wlan/wlan.ui index 7e39e23..195ead9 100644 --- a/noncore/settings/networksettings/wlan/wlan.ui +++ b/noncore/settings/networksettings/wlan/wlan.ui | |||
@@ -1,427 +1,445 @@ | |||
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>247</width> | 14 | <width>216</width> |
15 | <height>299</height> | 15 | <height>342</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 | <property> | ||
49 | <name>layoutMargin</name> | ||
50 | </property> | ||
51 | <property> | ||
52 | <name>layoutSpacing</name> | ||
53 | </property> | ||
48 | <widget> | 54 | <widget> |
49 | <class>QWidget</class> | 55 | <class>QWidget</class> |
50 | <property stdset="1"> | 56 | <property stdset="1"> |
51 | <name>name</name> | 57 | <name>name</name> |
52 | <cstring>ConfigPage</cstring> | 58 | <cstring>ConfigPage</cstring> |
53 | </property> | 59 | </property> |
54 | <attribute> | 60 | <attribute> |
55 | <name>title</name> | 61 | <name>title</name> |
56 | <string>General</string> | 62 | <string>General</string> |
57 | </attribute> | 63 | </attribute> |
58 | <spacer> | 64 | <vbox> |
59 | <property> | ||
60 | <name>name</name> | ||
61 | <cstring>Spacer31</cstring> | ||
62 | </property> | ||
63 | <property stdset="1"> | ||
64 | <name>orientation</name> | ||
65 | <enum>Vertical</enum> | ||
66 | </property> | ||
67 | <property stdset="1"> | ||
68 | <name>sizeType</name> | ||
69 | <enum>Expanding</enum> | ||
70 | </property> | ||
71 | <property> | ||
72 | <name>sizeHint</name> | ||
73 | <size> | ||
74 | <width>20</width> | ||
75 | <height>20</height> | ||
76 | </size> | ||
77 | </property> | ||
78 | </spacer> | ||
79 | <widget> | ||
80 | <class>QLabel</class> | ||
81 | <property stdset="1"> | ||
82 | <name>name</name> | ||
83 | <cstring>modeLabel</cstring> | ||
84 | </property> | ||
85 | <property stdset="1"> | ||
86 | <name>enabled</name> | ||
87 | <bool>true</bool> | ||
88 | </property> | ||
89 | <property stdset="1"> | ||
90 | <name>geometry</name> | ||
91 | <rect> | ||
92 | <x>11</x> | ||
93 | <y>11</y> | ||
94 | <width>84</width> | ||
95 | <height>29</height> | ||
96 | </rect> | ||
97 | </property> | ||
98 | <property stdset="1"> | ||
99 | <name>sizePolicy</name> | ||
100 | <sizepolicy> | ||
101 | <hsizetype>1</hsizetype> | ||
102 | <vsizetype>1</vsizetype> | ||
103 | </sizepolicy> | ||
104 | </property> | ||
105 | <property stdset="1"> | ||
106 | <name>text</name> | ||
107 | <string>Mode</string> | ||
108 | </property> | ||
109 | </widget> | ||
110 | <widget> | ||
111 | <class>QLabel</class> | ||
112 | <property stdset="1"> | ||
113 | <name>name</name> | ||
114 | <cstring>essidLabel</cstring> | ||
115 | </property> | ||
116 | <property stdset="1"> | ||
117 | <name>enabled</name> | ||
118 | <bool>true</bool> | ||
119 | </property> | ||
120 | <property stdset="1"> | ||
121 | <name>geometry</name> | ||
122 | <rect> | ||
123 | <x>11</x> | ||
124 | <y>46</y> | ||
125 | <width>84</width> | ||
126 | <height>29</height> | ||
127 | </rect> | ||
128 | </property> | ||
129 | <property stdset="1"> | ||
130 | <name>sizePolicy</name> | ||
131 | <sizepolicy> | ||
132 | <hsizetype>1</hsizetype> | ||
133 | <vsizetype>1</vsizetype> | ||
134 | </sizepolicy> | ||
135 | </property> | ||
136 | <property stdset="1"> | ||
137 | <name>text</name> | ||
138 | <string>ESS-ID</string> | ||
139 | </property> | ||
140 | </widget> | ||
141 | <widget> | ||
142 | <class>QSpinBox</class> | ||
143 | <property stdset="1"> | ||
144 | <name>name</name> | ||
145 | <cstring>networkChannel</cstring> | ||
146 | </property> | ||
147 | <property stdset="1"> | ||
148 | <name>enabled</name> | ||
149 | <bool>false</bool> | ||
150 | </property> | ||
151 | <property stdset="1"> | ||
152 | <name>geometry</name> | ||
153 | <rect> | ||
154 | <x>146</x> | ||
155 | <y>139</y> | ||
156 | <width>58</width> | ||
157 | <height>25</height> | ||
158 | </rect> | ||
159 | </property> | ||
160 | <property stdset="1"> | ||
161 | <name>maxValue</name> | ||
162 | <number>15</number> | ||
163 | </property> | ||
164 | <property stdset="1"> | ||
165 | <name>minValue</name> | ||
166 | <number>1</number> | ||
167 | </property> | ||
168 | <property stdset="1"> | ||
169 | <name>value</name> | ||
170 | <number>1</number> | ||
171 | </property> | ||
172 | </widget> | ||
173 | <widget> | ||
174 | <class>QLineEdit</class> | ||
175 | <property stdset="1"> | ||
176 | <name>name</name> | ||
177 | <cstring>macEdit</cstring> | ||
178 | </property> | ||
179 | <property stdset="1"> | ||
180 | <name>enabled</name> | ||
181 | <bool>false</bool> | ||
182 | </property> | ||
183 | <property stdset="1"> | ||
184 | <name>geometry</name> | ||
185 | <rect> | ||
186 | <x>56</x> | ||
187 | <y>108</y> | ||
188 | <width>182</width> | ||
189 | <height>25</height> | ||
190 | </rect> | ||
191 | </property> | ||
192 | <property stdset="1"> | ||
193 | <name>sizePolicy</name> | ||
194 | <sizepolicy> | ||
195 | <hsizetype>5</hsizetype> | ||
196 | <vsizetype>1</vsizetype> | ||
197 | </sizepolicy> | ||
198 | </property> | ||
199 | </widget> | ||
200 | <widget> | ||
201 | <class>QLabel</class> | ||
202 | <property stdset="1"> | ||
203 | <name>name</name> | ||
204 | <cstring>macLabel</cstring> | ||
205 | </property> | ||
206 | <property stdset="1"> | ||
207 | <name>enabled</name> | ||
208 | <bool>false</bool> | ||
209 | </property> | ||
210 | <property stdset="1"> | ||
211 | <name>geometry</name> | ||
212 | <rect> | ||
213 | <x>11</x> | ||
214 | <y>108</y> | ||
215 | <width>39</width> | ||
216 | <height>25</height> | ||
217 | </rect> | ||
218 | </property> | ||
219 | <property stdset="1"> | ||
220 | <name>text</name> | ||
221 | <string>MAC</string> | ||
222 | </property> | ||
223 | </widget> | ||
224 | <widget> | ||
225 | <class>QCheckBox</class> | ||
226 | <property stdset="1"> | ||
227 | <name>name</name> | ||
228 | <cstring>specifyAp</cstring> | ||
229 | </property> | ||
230 | <property stdset="1"> | ||
231 | <name>geometry</name> | ||
232 | <rect> | ||
233 | <x>11</x> | ||
234 | <y>81</y> | ||
235 | <width>227</width> | ||
236 | <height>21</height> | ||
237 | </rect> | ||
238 | </property> | ||
239 | <property stdset="1"> | ||
240 | <name>text</name> | ||
241 | <string>Specify &Access Point</string> | ||
242 | </property> | ||
243 | </widget> | ||
244 | <widget> | ||
245 | <class>QCheckBox</class> | ||
246 | <property stdset="1"> | ||
247 | <name>name</name> | ||
248 | <cstring>specifyChan</cstring> | ||
249 | </property> | ||
250 | <property stdset="1"> | ||
251 | <name>geometry</name> | ||
252 | <rect> | ||
253 | <x>11</x> | ||
254 | <y>141</y> | ||
255 | <width>129</width> | ||
256 | <height>21</height> | ||
257 | </rect> | ||
258 | </property> | ||
259 | <property stdset="1"> | ||
260 | <name>text</name> | ||
261 | <string>Specify &Channel</string> | ||
262 | </property> | ||
263 | </widget> | ||
264 | <spacer> | ||
265 | <property> | ||
266 | <name>name</name> | ||
267 | <cstring>Spacer10</cstring> | ||
268 | </property> | ||
269 | <property stdset="1"> | 65 | <property stdset="1"> |
270 | <name>orientation</name> | 66 | <name>margin</name> |
271 | <enum>Horizontal</enum> | 67 | <number>3</number> |
272 | </property> | 68 | </property> |
273 | <property stdset="1"> | 69 | <property stdset="1"> |
274 | <name>sizeType</name> | 70 | <name>spacing</name> |
275 | <enum>Expanding</enum> | 71 | <number>2</number> |
276 | </property> | ||
277 | <property> | ||
278 | <name>sizeHint</name> | ||
279 | <size> | ||
280 | <width>20</width> | ||
281 | <height>20</height> | ||
282 | </size> | ||
283 | </property> | 72 | </property> |
284 | </spacer> | 73 | <widget> |
285 | <widget> | 74 | <class>QLayoutWidget</class> |
286 | <class>QComboBox</class> | 75 | <property stdset="1"> |
287 | <item> | 76 | <name>name</name> |
288 | <property> | 77 | <cstring>Layout1</cstring> |
289 | <name>text</name> | ||
290 | <string>any</string> | ||
291 | </property> | 78 | </property> |
292 | </item> | 79 | <grid> |
293 | <property stdset="1"> | 80 | <property stdset="1"> |
294 | <name>name</name> | 81 | <name>margin</name> |
295 | <cstring>essid</cstring> | 82 | <number>0</number> |
296 | </property> | 83 | </property> |
297 | <property stdset="1"> | 84 | <property stdset="1"> |
298 | <name>geometry</name> | 85 | <name>spacing</name> |
299 | <rect> | 86 | <number>6</number> |
300 | <x>101</x> | 87 | </property> |
301 | <y>46</y> | 88 | <widget row="1" column="1" > |
302 | <width>103</width> | 89 | <class>QComboBox</class> |
303 | <height>29</height> | 90 | <item> |
304 | </rect> | 91 | <property> |
305 | </property> | 92 | <name>text</name> |
306 | <property stdset="1"> | 93 | <string>any</string> |
307 | <name>sizePolicy</name> | 94 | </property> |
308 | <sizepolicy> | 95 | </item> |
309 | <hsizetype>7</hsizetype> | 96 | <property stdset="1"> |
310 | <vsizetype>0</vsizetype> | 97 | <name>name</name> |
311 | </sizepolicy> | 98 | <cstring>essid</cstring> |
312 | </property> | 99 | </property> |
313 | <property stdset="1"> | 100 | <property stdset="1"> |
314 | <name>editable</name> | 101 | <name>sizePolicy</name> |
315 | <bool>true</bool> | 102 | <sizepolicy> |
316 | </property> | 103 | <hsizetype>7</hsizetype> |
317 | <property stdset="1"> | 104 | <vsizetype>0</vsizetype> |
318 | <name>currentItem</name> | 105 | </sizepolicy> |
319 | <number>0</number> | 106 | </property> |
320 | </property> | 107 | <property stdset="1"> |
321 | <property stdset="1"> | 108 | <name>editable</name> |
322 | <name>sizeLimit</name> | 109 | <bool>true</bool> |
323 | <number>5</number> | 110 | </property> |
324 | </property> | 111 | <property stdset="1"> |
325 | <property stdset="1"> | 112 | <name>currentItem</name> |
326 | <name>autoCompletion</name> | 113 | <number>0</number> |
327 | <bool>true</bool> | 114 | </property> |
328 | </property> | 115 | <property stdset="1"> |
329 | <property stdset="1"> | 116 | <name>sizeLimit</name> |
330 | <name>duplicatesEnabled</name> | 117 | <number>5</number> |
331 | <bool>false</bool> | 118 | </property> |
332 | </property> | 119 | <property stdset="1"> |
333 | </widget> | 120 | <name>autoCompletion</name> |
334 | <widget> | 121 | <bool>true</bool> |
335 | <class>QComboBox</class> | 122 | </property> |
336 | <item> | 123 | <property stdset="1"> |
337 | <property> | 124 | <name>duplicatesEnabled</name> |
338 | <name>text</name> | 125 | <bool>false</bool> |
339 | <string>Infrastructure</string> | 126 | </property> |
127 | </widget> | ||
128 | <widget row="1" column="0" > | ||
129 | <class>QLabel</class> | ||
130 | <property stdset="1"> | ||
131 | <name>name</name> | ||
132 | <cstring>essidLabel</cstring> | ||
133 | </property> | ||
134 | <property stdset="1"> | ||
135 | <name>enabled</name> | ||
136 | <bool>true</bool> | ||
137 | </property> | ||
138 | <property stdset="1"> | ||
139 | <name>sizePolicy</name> | ||
140 | <sizepolicy> | ||
141 | <hsizetype>1</hsizetype> | ||
142 | <vsizetype>1</vsizetype> | ||
143 | </sizepolicy> | ||
144 | </property> | ||
145 | <property stdset="1"> | ||
146 | <name>text</name> | ||
147 | <string>SSID</string> | ||
148 | </property> | ||
149 | </widget> | ||
150 | <widget row="0" column="1" > | ||
151 | <class>QComboBox</class> | ||
152 | <item> | ||
153 | <property> | ||
154 | <name>text</name> | ||
155 | <string>Infrastructure</string> | ||
156 | </property> | ||
157 | </item> | ||
158 | <item> | ||
159 | <property> | ||
160 | <name>text</name> | ||
161 | <string>Auto</string> | ||
162 | </property> | ||
163 | </item> | ||
164 | <item> | ||
165 | <property> | ||
166 | <name>text</name> | ||
167 | <string>Managed</string> | ||
168 | </property> | ||
169 | </item> | ||
170 | <item> | ||
171 | <property> | ||
172 | <name>text</name> | ||
173 | <string>Ad-Hoc</string> | ||
174 | </property> | ||
175 | </item> | ||
176 | <property stdset="1"> | ||
177 | <name>name</name> | ||
178 | <cstring>mode</cstring> | ||
179 | </property> | ||
180 | <property stdset="1"> | ||
181 | <name>enabled</name> | ||
182 | <bool>true</bool> | ||
183 | </property> | ||
184 | <property stdset="1"> | ||
185 | <name>sizePolicy</name> | ||
186 | <sizepolicy> | ||
187 | <hsizetype>7</hsizetype> | ||
188 | <vsizetype>0</vsizetype> | ||
189 | </sizepolicy> | ||
190 | </property> | ||
191 | </widget> | ||
192 | <widget row="0" column="0" > | ||
193 | <class>QLabel</class> | ||
194 | <property stdset="1"> | ||
195 | <name>name</name> | ||
196 | <cstring>modeLabel</cstring> | ||
197 | </property> | ||
198 | <property stdset="1"> | ||
199 | <name>enabled</name> | ||
200 | <bool>true</bool> | ||
201 | </property> | ||
202 | <property stdset="1"> | ||
203 | <name>sizePolicy</name> | ||
204 | <sizepolicy> | ||
205 | <hsizetype>1</hsizetype> | ||
206 | <vsizetype>1</vsizetype> | ||
207 | </sizepolicy> | ||
208 | </property> | ||
209 | <property stdset="1"> | ||
210 | <name>text</name> | ||
211 | <string>Mode</string> | ||
212 | </property> | ||
213 | </widget> | ||
214 | </grid> | ||
215 | </widget> | ||
216 | <widget> | ||
217 | <class>QCheckBox</class> | ||
218 | <property stdset="1"> | ||
219 | <name>name</name> | ||
220 | <cstring>specifyAp</cstring> | ||
340 | </property> | 221 | </property> |
341 | </item> | 222 | <property stdset="1"> |
342 | <item> | ||
343 | <property> | ||
344 | <name>text</name> | 223 | <name>text</name> |
345 | <string>Auto</string> | 224 | <string>Specify &Access Point</string> |
346 | </property> | 225 | </property> |
347 | </item> | 226 | </widget> |
348 | <item> | 227 | <widget> |
349 | <property> | 228 | <class>QLayoutWidget</class> |
350 | <name>text</name> | 229 | <property stdset="1"> |
351 | <string>Managed</string> | 230 | <name>name</name> |
231 | <cstring>Layout3</cstring> | ||
352 | </property> | 232 | </property> |
353 | </item> | 233 | <hbox> |
354 | <item> | 234 | <property stdset="1"> |
355 | <property> | 235 | <name>margin</name> |
236 | <number>0</number> | ||
237 | </property> | ||
238 | <property stdset="1"> | ||
239 | <name>spacing</name> | ||
240 | <number>6</number> | ||
241 | </property> | ||
242 | <widget> | ||
243 | <class>QLabel</class> | ||
244 | <property stdset="1"> | ||
245 | <name>name</name> | ||
246 | <cstring>macLabel</cstring> | ||
247 | </property> | ||
248 | <property stdset="1"> | ||
249 | <name>enabled</name> | ||
250 | <bool>false</bool> | ||
251 | </property> | ||
252 | <property stdset="1"> | ||
253 | <name>text</name> | ||
254 | <string>MAC</string> | ||
255 | </property> | ||
256 | </widget> | ||
257 | <widget> | ||
258 | <class>QLineEdit</class> | ||
259 | <property stdset="1"> | ||
260 | <name>name</name> | ||
261 | <cstring>macEdit</cstring> | ||
262 | </property> | ||
263 | <property stdset="1"> | ||
264 | <name>enabled</name> | ||
265 | <bool>false</bool> | ||
266 | </property> | ||
267 | <property stdset="1"> | ||
268 | <name>sizePolicy</name> | ||
269 | <sizepolicy> | ||
270 | <hsizetype>7</hsizetype> | ||
271 | <vsizetype>1</vsizetype> | ||
272 | </sizepolicy> | ||
273 | </property> | ||
274 | </widget> | ||
275 | </hbox> | ||
276 | </widget> | ||
277 | <widget> | ||
278 | <class>QLayoutWidget</class> | ||
279 | <property stdset="1"> | ||
280 | <name>name</name> | ||
281 | <cstring>Layout4</cstring> | ||
282 | </property> | ||
283 | <hbox> | ||
284 | <property stdset="1"> | ||
285 | <name>margin</name> | ||
286 | <number>0</number> | ||
287 | </property> | ||
288 | <property stdset="1"> | ||
289 | <name>spacing</name> | ||
290 | <number>6</number> | ||
291 | </property> | ||
292 | <widget> | ||
293 | <class>QCheckBox</class> | ||
294 | <property stdset="1"> | ||
295 | <name>name</name> | ||
296 | <cstring>specifyChan</cstring> | ||
297 | </property> | ||
298 | <property stdset="1"> | ||
299 | <name>text</name> | ||
300 | <string>Specify &Channel</string> | ||
301 | </property> | ||
302 | </widget> | ||
303 | <widget> | ||
304 | <class>QSpinBox</class> | ||
305 | <property stdset="1"> | ||
306 | <name>name</name> | ||
307 | <cstring>networkChannel</cstring> | ||
308 | </property> | ||
309 | <property stdset="1"> | ||
310 | <name>enabled</name> | ||
311 | <bool>false</bool> | ||
312 | </property> | ||
313 | <property stdset="1"> | ||
314 | <name>maxValue</name> | ||
315 | <number>15</number> | ||
316 | </property> | ||
317 | <property stdset="1"> | ||
318 | <name>minValue</name> | ||
319 | <number>1</number> | ||
320 | </property> | ||
321 | <property stdset="1"> | ||
322 | <name>value</name> | ||
323 | <number>1</number> | ||
324 | </property> | ||
325 | </widget> | ||
326 | </hbox> | ||
327 | </widget> | ||
328 | <widget> | ||
329 | <class>QPushButton</class> | ||
330 | <property stdset="1"> | ||
331 | <name>name</name> | ||
332 | <cstring>rescanButton</cstring> | ||
333 | </property> | ||
334 | <property stdset="1"> | ||
356 | <name>text</name> | 335 | <name>text</name> |
357 | <string>Ad-Hoc</string> | 336 | <string>Rescan Neighbourhood</string> |
358 | </property> | 337 | </property> |
359 | </item> | 338 | </widget> |
360 | <property stdset="1"> | 339 | <widget> |
361 | <name>name</name> | 340 | <class>QListView</class> |
362 | <cstring>mode</cstring> | 341 | <column> |
363 | </property> | 342 | <property> |
364 | <property stdset="1"> | 343 | <name>text</name> |
365 | <name>enabled</name> | 344 | <string></string> |
366 | <bool>true</bool> | 345 | </property> |
367 | </property> | 346 | <property> |
368 | <property stdset="1"> | 347 | <name>clickable</name> |
369 | <name>geometry</name> | 348 | <bool>true</bool> |
370 | <rect> | 349 | </property> |
371 | <x>101</x> | 350 | <property> |
372 | <y>11</y> | 351 | <name>resizeable</name> |
373 | <width>103</width> | 352 | <bool>true</bool> |
374 | <height>29</height> | 353 | </property> |
375 | </rect> | 354 | </column> |
376 | </property> | 355 | <column> |
377 | <property stdset="1"> | 356 | <property> |
378 | <name>sizePolicy</name> | 357 | <name>text</name> |
379 | <sizepolicy> | 358 | <string>SSID</string> |
380 | <hsizetype>1</hsizetype> | 359 | </property> |
381 | <vsizetype>0</vsizetype> | 360 | <property> |
382 | </sizepolicy> | 361 | <name>clickable</name> |
383 | </property> | 362 | <bool>true</bool> |
384 | </widget> | 363 | </property> |
364 | <property> | ||
365 | <name>resizeable</name> | ||
366 | <bool>true</bool> | ||
367 | </property> | ||
368 | </column> | ||
369 | <column> | ||
370 | <property> | ||
371 | <name>text</name> | ||
372 | <string>Chn</string> | ||
373 | </property> | ||
374 | <property> | ||
375 | <name>clickable</name> | ||
376 | <bool>true</bool> | ||
377 | </property> | ||
378 | <property> | ||
379 | <name>resizeable</name> | ||
380 | <bool>true</bool> | ||
381 | </property> | ||
382 | </column> | ||
383 | <column> | ||
384 | <property> | ||
385 | <name>text</name> | ||
386 | <string>MAC</string> | ||
387 | </property> | ||
388 | <property> | ||
389 | <name>clickable</name> | ||
390 | <bool>true</bool> | ||
391 | </property> | ||
392 | <property> | ||
393 | <name>resizeable</name> | ||
394 | <bool>true</bool> | ||
395 | </property> | ||
396 | </column> | ||
397 | <property stdset="1"> | ||
398 | <name>name</name> | ||
399 | <cstring>netView</cstring> | ||
400 | </property> | ||
401 | </widget> | ||
402 | </vbox> | ||
385 | </widget> | 403 | </widget> |
386 | <widget> | 404 | <widget> |
387 | <class>QWidget</class> | 405 | <class>QWidget</class> |
388 | <property stdset="1"> | 406 | <property stdset="1"> |
389 | <name>name</name> | 407 | <name>name</name> |
390 | <cstring>WepPage</cstring> | 408 | <cstring>WepPage</cstring> |
391 | </property> | 409 | </property> |
392 | <attribute> | 410 | <attribute> |
393 | <name>title</name> | 411 | <name>title</name> |
394 | <string>Encryption</string> | 412 | <string>Encryption</string> |
395 | </attribute> | 413 | </attribute> |
396 | <grid> | 414 | <grid> |
397 | <property stdset="1"> | 415 | <property stdset="1"> |
398 | <name>margin</name> | 416 | <name>margin</name> |
399 | <number>11</number> | 417 | <number>7</number> |
400 | </property> | 418 | </property> |
401 | <property stdset="1"> | 419 | <property stdset="1"> |
402 | <name>spacing</name> | 420 | <name>spacing</name> |
403 | <number>6</number> | 421 | <number>3</number> |
404 | </property> | 422 | </property> |
405 | <widget row="0" column="0" > | 423 | <widget row="0" column="0" > |
406 | <class>QCheckBox</class> | 424 | <class>QCheckBox</class> |
407 | <property stdset="1"> | 425 | <property stdset="1"> |
408 | <name>name</name> | 426 | <name>name</name> |
409 | <cstring>wepEnabled</cstring> | 427 | <cstring>wepEnabled</cstring> |
410 | </property> | 428 | </property> |
411 | <property stdset="1"> | 429 | <property stdset="1"> |
412 | <name>text</name> | 430 | <name>text</name> |
413 | <string>&Enable Encryption</string> | 431 | <string>&Enable Encryption</string> |
414 | </property> | 432 | </property> |
415 | </widget> | 433 | </widget> |
416 | <widget row="1" column="0" > | 434 | <widget row="1" column="0" > |
417 | <class>QButtonGroup</class> | 435 | <class>QButtonGroup</class> |
418 | <property stdset="1"> | 436 | <property stdset="1"> |
419 | <name>name</name> | 437 | <name>name</name> |
420 | <cstring>KeyButtonGroup</cstring> | 438 | <cstring>KeyButtonGroup</cstring> |
421 | </property> | 439 | </property> |
422 | <property stdset="1"> | 440 | <property stdset="1"> |
423 | <name>enabled</name> | 441 | <name>enabled</name> |
424 | <bool>false</bool> | 442 | <bool>false</bool> |
425 | </property> | 443 | </property> |
426 | <property stdset="1"> | 444 | <property stdset="1"> |
427 | <name>title</name> | 445 | <name>title</name> |
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index 8bf004f..719be1b 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp | |||
@@ -197,48 +197,48 @@ void WLANImp::changeAndSaveSettingFile(){ | |||
197 | if(line.contains("esac")) | 197 | if(line.contains("esac")) |
198 | stream << line << "\n"; | 198 | stream << line << "\n"; |
199 | } | 199 | } |
200 | if(line.contains(";;")) | 200 | if(line.contains(";;")) |
201 | output = true; | 201 | output = true; |
202 | if(output && (*it).length() ) | 202 | if(output && (*it).length() ) |
203 | stream << (*it) << '\n'; | 203 | stream << (*it) << '\n'; |
204 | } | 204 | } |
205 | file.close(); | 205 | file.close(); |
206 | } | 206 | } |
207 | 207 | ||
208 | /** | 208 | /** |
209 | * Check to see if the current config is valid | 209 | * Check to see if the current config is valid |
210 | * Save wireless.opts, save interfaces | 210 | * Save wireless.opts, save interfaces |
211 | */ | 211 | */ |
212 | void WLANImp::accept(){ | 212 | void WLANImp::accept(){ |
213 | if(wepEnabled->isChecked()){ | 213 | if(wepEnabled->isChecked()){ |
214 | if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() ){ | 214 | if(keyLineEdit0->text().isEmpty() && keyLineEdit1->text().isEmpty() && keyLineEdit2->text().isEmpty() && keyLineEdit3->text().isEmpty() ){ |
215 | QMessageBox::information(this, "Error", "Please enter a key for WEP.", QMessageBox::Ok); | 215 | QMessageBox::information(this, "Error", "Please enter a key for WEP.", QMessageBox::Ok); |
216 | return; | 216 | return; |
217 | } | 217 | } |
218 | } | 218 | } |
219 | 219 | ||
220 | if(essAny->isChecked() && essSpecificLineEdit->text().isEmpty()){ | 220 | if(essAny->isChecked() && essSpecificLineEdit->text().isEmpty()){ |
221 | QMessageBox::information(this, "Error", "Please enter a ESS-ID.", QMessageBox::Ok); | 221 | QMessageBox::information(this, "Error", "Please enter a SSID.", QMessageBox::Ok); |
222 | return; | 222 | return; |
223 | } | 223 | } |
224 | 224 | ||
225 | // Ok settings are good here, save | 225 | // Ok settings are good here, save |
226 | changeAndSaveSettingFile(); | 226 | changeAndSaveSettingFile(); |
227 | 227 | ||
228 | // Try to save the interfaces settings. | 228 | // Try to save the interfaces settings. |
229 | if(!interfaceSetup->saveChanges()) | 229 | if(!interfaceSetup->saveChanges()) |
230 | return; | 230 | return; |
231 | 231 | ||
232 | OProcess insert; | 232 | OProcess insert; |
233 | insert << "sh"; | 233 | insert << "sh"; |
234 | insert << "-c"; | 234 | insert << "-c"; |
235 | insert << "cardctl eject && cardctl insert"; | 235 | insert << "cardctl eject && cardctl insert"; |
236 | 236 | ||
237 | if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { | 237 | if (!insert.start(OProcess::DontCare, OProcess::NoCommunication) ) { |
238 | qWarning("could not start cardctl"); | 238 | qWarning("could not start cardctl"); |
239 | } | 239 | } |
240 | 240 | ||
241 | // Close out the dialog | 241 | // Close out the dialog |
242 | QDialog::accept(); | 242 | QDialog::accept(); |
243 | } | 243 | } |
244 | 244 | ||
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.cpp b/noncore/settings/networksettings/wlan/wlanimp2.cpp index 26e3aa9..7ce096f 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp2.cpp | |||
@@ -1,63 +1,85 @@ | |||
1 | #include "wlanimp2.h" | 1 | #include "wlanimp2.h" |
2 | #include "keyedit.h" | 2 | #include "keyedit.h" |
3 | #include "interfacesetupimp.h" | 3 | #include "interfacesetupimp.h" |
4 | 4 | ||
5 | #include "../interfaces/interface.h" | ||
6 | |||
7 | #include <assert.h> | ||
8 | #include <errno.h> | ||
9 | #include <string.h> | ||
10 | |||
11 | #include <qapplication.h> | ||
5 | #include <qfile.h> | 12 | #include <qfile.h> |
6 | #include <qdir.h> | 13 | #include <qdir.h> |
14 | #include <qdialog.h> | ||
7 | #include <qtextstream.h> | 15 | #include <qtextstream.h> |
8 | #include <qmessagebox.h> | 16 | #include <qmessagebox.h> |
9 | #include <qlineedit.h> | 17 | #include <qlineedit.h> |
10 | #include <qlabel.h> | 18 | #include <qlabel.h> |
11 | #include <qspinbox.h> | 19 | #include <qspinbox.h> |
12 | #include <qradiobutton.h> | 20 | #include <qradiobutton.h> |
21 | #include <qpushbutton.h> | ||
13 | #include <qcheckbox.h> | 22 | #include <qcheckbox.h> |
14 | #include <qtabwidget.h> | 23 | #include <qtabwidget.h> |
15 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
25 | #include <qlistview.h> | ||
26 | #include <qvbox.h> | ||
27 | #include <qprogressbar.h> | ||
16 | 28 | ||
17 | #ifdef QWS | 29 | #ifdef QWS |
30 | #include <qpe/resource.h> | ||
18 | #include <opie/oprocess.h> | 31 | #include <opie/oprocess.h> |
32 | #include <opie2/onetwork.h> | ||
33 | #include <opie2/opcap.h> | ||
19 | #else | 34 | #else |
20 | #define OProcess KProcess | 35 | #define OProcess KProcess |
21 | #include <kprocess.h> | 36 | #include <kprocess.h> |
22 | #endif | 37 | #endif |
23 | 38 | ||
24 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" | 39 | #define WIRELESS_OPTS "/etc/pcmcia/wireless.opts" |
25 | #define PREUP "/etc/netwrok/if-pre-up.d/wireless-tools" | 40 | #define PREUP "/etc/network/if-pre-up.d/wireless-tools" |
26 | 41 | ||
27 | /** | 42 | /** |
28 | * Constructor, read in the wireless.opts file for parsing later. | 43 | * Constructor, read in the wireless.opts file for parsing later. |
29 | */ | 44 | */ |
30 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") { | 45 | WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl) : WLAN(parent, name, modal, fl), interface(i), currentProfile("*") { |
31 | interfaces = new Interfaces(); | 46 | interfaces = new Interfaces(); |
32 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); | 47 | interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, interfaces); |
33 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); | 48 | tabWidget->insertTab(interfaceSetup, "TCP/IP"); |
34 | 49 | ||
35 | // Check sanity - the existance of the wireless-tools if-pre-up script | 50 | // Check sanity - the existance of the wireless-tools if-pre-up script |
36 | QFile file(QString(PREUP)); | 51 | QFile file(QString(PREUP)); |
37 | if (file.exists()) { | 52 | if (file.exists()) { |
38 | qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); | 53 | qWarning(QString("WLANImp: Unable to open /etc/network/if-pre-up.d/wireless-tools")); |
39 | } | 54 | } |
55 | |||
56 | connect( rescanButton, SIGNAL( clicked() ), this, SLOT( rescanNeighbourhood() ) ); | ||
57 | connect( netView, SIGNAL( clicked( QListViewItem* ) ), this, SLOT( selectNetwork( QListViewItem* ) ) ); | ||
58 | netView->setColumnAlignment( col_chn, AlignCenter ); | ||
59 | netView->setItemMargin( 3 ); | ||
60 | netView->setAllColumnsShowFocus( true ); | ||
61 | |||
40 | } | 62 | } |
41 | 63 | ||
42 | WLANImp::~WLANImp() { | 64 | WLANImp::~WLANImp() { |
43 | //FIXME: delete interfaces; | 65 | //FIXME: delete interfaces; |
44 | } | 66 | } |
45 | 67 | ||
46 | /** | 68 | /** |
47 | * Change the profile for both wireless settings and network settings. | 69 | * Change the profile for both wireless settings and network settings. |
48 | */ | 70 | */ |
49 | void WLANImp::setProfile(const QString &profile){ | 71 | void WLANImp::setProfile(const QString &profile){ |
50 | interfaceSetup->setProfile(profile); | 72 | interfaceSetup->setProfile(profile); |
51 | parseOpts(); | 73 | parseOpts(); |
52 | } | 74 | } |
53 | 75 | ||
54 | void WLANImp::parseOpts() { | 76 | void WLANImp::parseOpts() { |
55 | bool error; | 77 | bool error; |
56 | QString opt; | 78 | QString opt; |
57 | 79 | ||
58 | if (! interfaces->isInterfaceSet()) | 80 | if (! interfaces->isInterfaceSet()) |
59 | return; | 81 | return; |
60 | 82 | ||
61 | 83 | ||
62 | opt = interfaces->getInterfaceOption("wireless_essid", error); | 84 | opt = interfaces->getInterfaceOption("wireless_essid", error); |
63 | if(opt == "any" || opt == "off" || opt.isNull()){ | 85 | if(opt == "any" || opt == "off" || opt.isNull()){ |
@@ -253,24 +275,216 @@ void WLANImp::writeOpts() { | |||
253 | keyList += "restricted"; | 275 | keyList += "restricted"; |
254 | } | 276 | } |
255 | 277 | ||
256 | keyList += "key"; | 278 | keyList += "key"; |
257 | if (keyRadio0->isChecked()) { | 279 | if (keyRadio0->isChecked()) { |
258 | keyList += "[1]"; | 280 | keyList += "[1]"; |
259 | } else if (keyRadio1->isChecked()) { | 281 | } else if (keyRadio1->isChecked()) { |
260 | keyList += "[2]"; | 282 | keyList += "[2]"; |
261 | } else if (keyRadio2->isChecked()) { | 283 | } else if (keyRadio2->isChecked()) { |
262 | keyList += "[3]"; | 284 | keyList += "[3]"; |
263 | } else if (keyRadio3->isChecked()) { | 285 | } else if (keyRadio3->isChecked()) { |
264 | keyList += "[4]"; | 286 | keyList += "[4]"; |
265 | } | 287 | } |
266 | interfaces->setInterfaceOption(QString("wireless_key"), keyList.join(QString(" "))); | 288 | interfaces->setInterfaceOption(QString("wireless_key"), keyList.join(QString(" "))); |
267 | } else { | 289 | } else { |
268 | interfaces->removeInterfaceOption(QString("wireless_key")); | 290 | interfaces->removeInterfaceOption(QString("wireless_key")); |
269 | } | 291 | } |
270 | interfaces->removeInterfaceOption(QString("wireless_enc")); | 292 | interfaces->removeInterfaceOption(QString("wireless_enc")); |
271 | 293 | ||
272 | if(!interfaceSetup->saveChanges()) | 294 | if(!interfaceSetup->saveChanges()) |
273 | return; | 295 | return; |
274 | 296 | ||
275 | QDialog::accept(); | 297 | QDialog::accept(); |
276 | } | 298 | } |
299 | |||
300 | /* | ||
301 | * Scan for possible wireless networks around... | ||
302 | * ... powered by Wellenreiter II technology (C) Michael 'Mickey' Lauer <mickeyl@handhelds.org> | ||
303 | */ | ||
304 | |||
305 | void WLANImp::rescanNeighbourhood() | ||
306 | { | ||
307 | QString name = interface->getInterfaceName(); | ||
308 | qDebug( "rescanNeighbourhood via '%s'", (const char*) name ); | ||
309 | |||
310 | OWirelessNetworkInterface* wiface = static_cast<OWirelessNetworkInterface*>( ONetwork::instance()->interface( name ) ); | ||
311 | assert( wiface ); | ||
312 | |||
313 | // try to guess device type | ||
314 | QString devicetype; | ||
315 | QFile m( "/proc/modules" ); | ||
316 | if ( m.open( IO_ReadOnly ) ) | ||
317 | { | ||
318 | QString line; | ||
319 | QTextStream modules( &m ); | ||
320 | while( !modules.atEnd() && !devicetype ) | ||
321 | { | ||
322 | modules >> line; | ||
323 | if ( line.contains( "cisco" ) ) devicetype = "cisco"; | ||
324 | else if ( line.contains( "hostap" ) ) devicetype = "hostap"; | ||
325 | else if ( line.contains( "prism" ) ) devicetype = "wlan-ng"; /* puke */ | ||
326 | else if ( line.contains( "orinoco" ) ) devicetype = "orinoco"; | ||
327 | } | ||
328 | } | ||
329 | if ( devicetype.isEmpty() ) | ||
330 | { | ||
331 | qWarning( "rescanNeighbourhood(): couldn't guess device type :(" ); | ||
332 | return; | ||
333 | } | ||
334 | else | ||
335 | { | ||
336 | qDebug( "rescanNeighbourhood(): device type seems to be '%s'", (const char*) devicetype ); | ||
337 | } | ||
338 | |||
339 | // configure interface to receive 802.11 management frames | ||
340 | |||
341 | wiface->setUp( true ); | ||
342 | wiface->setPromiscuousMode( true ); | ||
343 | |||
344 | if ( devicetype == "cisco" ) wiface->setMonitoring( new OCiscoMonitoringInterface( wiface, false ) ); | ||
345 | else if ( devicetype == "hostap" ) wiface->setMonitoring( new OHostAPMonitoringInterface( wiface, false ) ); | ||
346 | else if ( devicetype == "wlan-ng" ) wiface->setMonitoring( new OWlanNGMonitoringInterface( wiface, false ) ); | ||
347 | else if ( devicetype == "orinoco" ) wiface->setMonitoring( new OOrinocoMonitoringInterface( wiface, false ) ); | ||
348 | else | ||
349 | { | ||
350 | qDebug( "rescanNeighbourhood(): unsupported device type for monitoring :(" ); | ||
351 | return; | ||
352 | } | ||
353 | |||
354 | wiface->setMonitorMode( true ); | ||
355 | if ( !wiface->monitorMode() ) | ||
356 | { | ||
357 | qWarning( "rescanNeighbourhood(): Unable to bring device into monitor mode (%s).", strerror( errno ) ); | ||
358 | return; | ||
359 | } | ||
360 | |||
361 | // open a packet capturer | ||
362 | OPacketCapturer* cap = new OPacketCapturer(); | ||
363 | cap->open( name ); | ||
364 | if ( !cap->isOpen() ) | ||
365 | { | ||
366 | qWarning( "rescanNeighbourhood(): Unable to open libpcap (%s).", strerror( errno ) ); | ||
367 | return; | ||
368 | } | ||
369 | |||
370 | // display splash screen | ||
371 | QFrame* splash = new QFrame( this, "splash", false, WStyle_StaysOnTop | WStyle_DialogBorder | WStyle_Customize ); | ||
372 | splash->setLineWidth( 2 ); | ||
373 | splash->setFrameStyle( QFrame::Panel | QFrame::Raised ); | ||
374 | QVBoxLayout* vbox = new QVBoxLayout( splash, 4, 4 ); | ||
375 | QLabel* lab = new QLabel( "<center><b>Scanning...</b><br>Please Wait...</center>", splash ); | ||
376 | QProgressBar* pb = new QProgressBar( wiface->channels(), splash ); | ||
377 | vbox->addWidget( lab ); | ||
378 | vbox->addWidget( pb ); | ||
379 | pb->setCenterIndicator( true ); | ||
380 | pb->setFixedHeight( pb->sizeHint().height() ); | ||
381 | QWidget* widgetDesktop = qApp->desktop(); | ||
382 | int dw = widgetDesktop->width(); | ||
383 | int dh = widgetDesktop->height(); | ||
384 | int pw = vbox->sizeHint().width(); | ||
385 | int ph = vbox->sizeHint().height(); | ||
386 | splash->setGeometry((dw-pw)/2,(dh-ph)/2,pw,ph); | ||
387 | splash->show(); | ||
388 | splash->raise(); | ||
389 | qApp->processEvents(); | ||
390 | |||
391 | // set capturer to non-blocking mode | ||
392 | cap->setBlocking( false ); | ||
393 | |||
394 | for ( int i = 1; i <= wiface->channels(); ++i ) | ||
395 | { | ||
396 | wiface->setChannel( i ); | ||
397 | pb->setProgress( i ); | ||
398 | qApp->processEvents(); | ||
399 | qDebug( "rescanNeighbourhood(): listening on channel %d...", i ); | ||
400 | OPacket* p = cap->next( 1000 ); | ||
401 | if ( !p ) | ||
402 | { | ||
403 | qDebug( "rescanNeighbourhood(): nothing received on channel %d", i ); | ||
404 | } | ||
405 | else | ||
406 | { | ||
407 | qDebug( "rescanNeighbourhood(): TADAA - something came in on channel %d", i ); | ||
408 | handlePacket( p ); | ||
409 | } | ||
410 | } | ||
411 | |||
412 | cap->close(); | ||
413 | wiface->setMonitorMode( false ); | ||
414 | wiface->setPromiscuousMode( true ); | ||
415 | |||
416 | splash->hide(); | ||
417 | delete splash; | ||
418 | |||
419 | } | ||
420 | |||
421 | void WLANImp::handlePacket( OPacket* p ) | ||
422 | { | ||
423 | |||
424 | // check if we received a beacon frame | ||
425 | OWaveLanManagementPacket* beacon = static_cast<OWaveLanManagementPacket*>( p->child( "802.11 Management" ) ); | ||
426 | if ( beacon && beacon->managementType() == "Beacon" ) | ||
427 | { | ||
428 | |||
429 | QString type; | ||
430 | if ( beacon->canIBSS() ) | ||
431 | { | ||
432 | type = "adhoc"; | ||
433 | } | ||
434 | else if ( beacon->canESS() ) | ||
435 | { | ||
436 | type = "managed"; | ||
437 | } | ||
438 | else | ||
439 | { | ||
440 | qWarning( "handlePacket(): invalid frame [possibly noise] detected!" ); | ||
441 | return; | ||
442 | } | ||
443 | |||
444 | OWaveLanManagementSSID* ssid = static_cast<OWaveLanManagementSSID*>( p->child( "802.11 SSID" ) ); | ||
445 | QString essid = ssid ? ssid->ID() : QString("<unknown>"); | ||
446 | OWaveLanManagementDS* ds = static_cast<OWaveLanManagementDS*>( p->child( "802.11 DS" ) ); | ||
447 | int channel = ds ? ds->channel() : -1; | ||
448 | OWaveLanPacket* header = static_cast<OWaveLanPacket*>( p->child( "802.11" ) ); | ||
449 | displayFoundNetwork( type, channel, essid, header->macAddress2() ); | ||
450 | } | ||
451 | } | ||
452 | |||
453 | |||
454 | void WLANImp::displayFoundNetwork( const QString& mode, int channel, const QString& ssid, const OMacAddress& mac ) | ||
455 | { | ||
456 | |||
457 | qDebug( "found network: <%s>, chn %d, ssid '%s', mac '%s'", (const char*) mode, channel, | ||
458 | (const char*) ssid, | ||
459 | (const char*) mac.toString() ); | ||
460 | |||
461 | QListViewItemIterator it( netView ); | ||
462 | while ( it.current() && it.current()->text( col_ssid ) != ssid ) ++it; | ||
463 | if ( !it.current() ) // ssid didn't show up yet | ||
464 | { | ||
465 | QListViewItem* item = new QListViewItem( netView, mode.left( 1 ).upper(), ssid, QString::number( channel ), mac.toString() ); | ||
466 | QString name; | ||
467 | name.sprintf( "networksettings/%s", (const char*) mode ); | ||
468 | item->setPixmap( col_mode, Resource::loadPixmap( name ) ); | ||
469 | qApp->processEvents(); | ||
470 | } | ||
471 | |||
472 | } | ||
473 | |||
474 | |||
475 | void WLANImp::selectNetwork( QListViewItem* item ) | ||
476 | { | ||
477 | bool ok; | ||
478 | if ( item ) | ||
479 | { | ||
480 | specifyAp->setChecked(true); | ||
481 | macEdit->setText( item->text( col_mac ) ); | ||
482 | specifyChan->setChecked( item->text( col_mode ) == "A" ); | ||
483 | networkChannel->setValue( item->text( col_chn ).toInt( &ok ) ); | ||
484 | essid->setEditText( item->text( col_ssid ) ); | ||
485 | if ( item->text( col_mode ) == "A" ) | ||
486 | mode->setCurrentItem( 3 ); | ||
487 | else | ||
488 | mode->setCurrentItem( 2 ); | ||
489 | } | ||
490 | } | ||
diff --git a/noncore/settings/networksettings/wlan/wlanimp2.h b/noncore/settings/networksettings/wlan/wlanimp2.h index 992d09a..a777203 100644 --- a/noncore/settings/networksettings/wlan/wlanimp2.h +++ b/noncore/settings/networksettings/wlan/wlanimp2.h | |||
@@ -1,37 +1,52 @@ | |||
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 "interfaces.h" | 5 | #include "interfaces.h" |
6 | #include <qstringlist.h> | 6 | #include <qstringlist.h> |
7 | #include <opie2/onetutils.h> | ||
7 | 8 | ||
8 | class InterfaceSetupImp; | 9 | class InterfaceSetupImp; |
9 | class Interface; | 10 | class Interface; |
10 | class Config; | 11 | class Config; |
12 | class OPacket; | ||
13 | class QListViewItem; | ||
11 | 14 | ||
12 | class WLANImp : public WLAN { | 15 | const int col_mode= 0; |
16 | const int col_ssid = 1; | ||
17 | const int col_chn = 2; | ||
18 | const int col_mac = 3; | ||
19 | |||
20 | class WLANImp : public WLAN { | ||
13 | Q_OBJECT | 21 | Q_OBJECT |
14 | 22 | ||
15 | public: | 23 | public: |
16 | WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); | 24 | WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); |
17 | ~WLANImp(); | 25 | ~WLANImp(); |
18 | void setProfile(const QString &profile); | 26 | void setProfile(const QString &profile); |
19 | 27 | ||
28 | public slots: | ||
29 | void rescanNeighbourhood(); | ||
30 | void selectNetwork( QListViewItem* ); | ||
31 | |||
20 | protected: | 32 | protected: |
21 | void accept(); | 33 | void accept(); |
22 | 34 | ||
23 | private: | 35 | private: |
24 | void parseOpts(); | 36 | void parseOpts(); |
25 | void writeOpts(); | 37 | void writeOpts(); |
26 | 38 | ||
27 | void parseKeyStr(QString keystr); | 39 | void parseKeyStr(QString keystr); |
28 | 40 | ||
41 | void handlePacket( OPacket* ); | ||
42 | void displayFoundNetwork( const QString& mode, int channel, const QString& ssid, const OMacAddress& mac ); | ||
43 | |||
29 | InterfaceSetupImp *interfaceSetup; | 44 | InterfaceSetupImp *interfaceSetup; |
30 | Interfaces *interfaces; | 45 | Interfaces *interfaces; |
31 | Interface *interface; | 46 | Interface *interface; |
32 | 47 | ||
33 | QString currentProfile; | 48 | QString currentProfile; |
34 | }; | 49 | }; |
35 | 50 | ||
36 | #endif | 51 | #endif |
37 | 52 | ||
diff --git a/pics/networksettings/adhoc.png b/pics/networksettings/adhoc.png new file mode 100644 index 0000000..dcf5ad2 --- a/dev/null +++ b/pics/networksettings/adhoc.png | |||
Binary files differ | |||
diff --git a/pics/networksettings/managed.png b/pics/networksettings/managed.png new file mode 100644 index 0000000..4554533 --- a/dev/null +++ b/pics/networksettings/managed.png | |||
Binary files differ | |||