-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 512 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 17 |
4 files changed, 331 insertions, 215 deletions
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index 3ece270..ba4de32 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui | |||
@@ -1,466 +1,554 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>WellenreiterConfigBase</class> | 2 | <class>WellenreiterConfigBase</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>WellenreiterConfigBase</cstring> | 7 | <cstring>WellenreiterConfigBase</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>220</width> | 14 | <width>236</width> |
15 | <height>306</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>Form1</string> | 20 | <string>Form1</string> |
21 | </property> | 21 | </property> |
22 | <property> | 22 | <property> |
23 | <name>layoutMargin</name> | 23 | <name>layoutMargin</name> |
24 | </property> | 24 | </property> |
25 | <property> | 25 | <property> |
26 | <name>layoutSpacing</name> | 26 | <name>layoutSpacing</name> |
27 | </property> | 27 | </property> |
28 | <vbox> | 28 | <grid> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>6</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>1</number> | 35 | <number>5</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget row="0" column="0" rowspan="1" colspan="3" > |
38 | <class>QLayoutWidget</class> | 38 | <class>QLayoutWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>Layout5</cstring> | 41 | <cstring>Layout5</cstring> |
42 | </property> | 42 | </property> |
43 | <property> | 43 | <property> |
44 | <name>layoutSpacing</name> | 44 | <name>layoutSpacing</name> |
45 | </property> | 45 | </property> |
46 | <hbox> | 46 | <hbox> |
47 | <property stdset="1"> | 47 | <property stdset="1"> |
48 | <name>margin</name> | 48 | <name>margin</name> |
49 | <number>0</number> | 49 | <number>0</number> |
50 | </property> | 50 | </property> |
51 | <property stdset="1"> | 51 | <property stdset="1"> |
52 | <name>spacing</name> | 52 | <name>spacing</name> |
53 | <number>2</number> | 53 | <number>2</number> |
54 | </property> | 54 | </property> |
55 | <widget> | 55 | <widget> |
56 | <class>QLabel</class> | 56 | <class>QLabel</class> |
57 | <property stdset="1"> | 57 | <property stdset="1"> |
58 | <name>name</name> | 58 | <name>name</name> |
59 | <cstring>TextLabel3_2</cstring> | 59 | <cstring>TextLabel3_2</cstring> |
60 | </property> | 60 | </property> |
61 | <property stdset="1"> | 61 | <property stdset="1"> |
62 | <name>sizePolicy</name> | 62 | <name>sizePolicy</name> |
63 | <sizepolicy> | 63 | <sizepolicy> |
64 | <hsizetype>4</hsizetype> | 64 | <hsizetype>4</hsizetype> |
65 | <vsizetype>1</vsizetype> | 65 | <vsizetype>1</vsizetype> |
66 | </sizepolicy> | 66 | </sizepolicy> |
67 | </property> | 67 | </property> |
68 | <property stdset="1"> | 68 | <property stdset="1"> |
69 | <name>text</name> | 69 | <name>text</name> |
70 | <string>Sniffer</string> | 70 | <string>Sniffer</string> |
71 | </property> | 71 | </property> |
72 | </widget> | 72 | </widget> |
73 | <widget> | 73 | <widget> |
74 | <class>Line</class> | 74 | <class>Line</class> |
75 | <property stdset="1"> | 75 | <property stdset="1"> |
76 | <name>name</name> | 76 | <name>name</name> |
77 | <cstring>Line9</cstring> | 77 | <cstring>Line9</cstring> |
78 | </property> | 78 | </property> |
79 | <property stdset="1"> | 79 | <property stdset="1"> |
80 | <name>orientation</name> | 80 | <name>orientation</name> |
81 | <enum>Horizontal</enum> | 81 | <enum>Horizontal</enum> |
82 | </property> | 82 | </property> |
83 | </widget> | 83 | </widget> |
84 | </hbox> | 84 | </hbox> |
85 | </widget> | 85 | </widget> |
86 | <widget> | 86 | <widget row="1" column="0" rowspan="1" colspan="2" > |
87 | <class>QLayoutWidget</class> | 87 | <class>QComboBox</class> |
88 | <property stdset="1"> | 88 | <property stdset="1"> |
89 | <name>name</name> | 89 | <name>name</name> |
90 | <cstring>Layout7</cstring> | 90 | <cstring>interfaceName</cstring> |
91 | </property> | ||
92 | <property stdset="1"> | ||
93 | <name>enabled</name> | ||
94 | <bool>true</bool> | ||
91 | </property> | 95 | </property> |
92 | <property> | 96 | <property> |
93 | <name>layoutSpacing</name> | 97 | <name>whatsThis</name> |
98 | <string>Choose the interface used for sniffing.</string> | ||
99 | </property> | ||
100 | </widget> | ||
101 | <widget row="2" column="0" rowspan="1" colspan="2" > | ||
102 | <class>QComboBox</class> | ||
103 | <item> | ||
104 | <property> | ||
105 | <name>text</name> | ||
106 | <string><select></string> | ||
107 | </property> | ||
108 | </item> | ||
109 | <item> | ||
110 | <property> | ||
111 | <name>text</name> | ||
112 | <string>cisco</string> | ||
113 | </property> | ||
114 | </item> | ||
115 | <item> | ||
116 | <property> | ||
117 | <name>text</name> | ||
118 | <string>wlan-ng</string> | ||
119 | </property> | ||
120 | </item> | ||
121 | <item> | ||
122 | <property> | ||
123 | <name>text</name> | ||
124 | <string>hostap</string> | ||
125 | </property> | ||
126 | </item> | ||
127 | <item> | ||
128 | <property> | ||
129 | <name>text</name> | ||
130 | <string>orinoco</string> | ||
131 | </property> | ||
132 | </item> | ||
133 | <item> | ||
134 | <property> | ||
135 | <name>text</name> | ||
136 | <string><manual></string> | ||
137 | </property> | ||
138 | </item> | ||
139 | <item> | ||
140 | <property> | ||
141 | <name>text</name> | ||
142 | <string><file></string> | ||
143 | </property> | ||
144 | </item> | ||
145 | <property stdset="1"> | ||
146 | <name>name</name> | ||
147 | <cstring>deviceType</cstring> | ||
148 | </property> | ||
149 | <property stdset="1"> | ||
150 | <name>enabled</name> | ||
151 | <bool>true</bool> | ||
152 | </property> | ||
153 | <property> | ||
154 | <name>whatsThis</name> | ||
155 | <string>Choose the type of driver used for sniffing.</string> | ||
156 | </property> | ||
157 | </widget> | ||
158 | <widget row="3" column="0" rowspan="1" colspan="2" > | ||
159 | <class>QSpinBox</class> | ||
160 | <property stdset="1"> | ||
161 | <name>name</name> | ||
162 | <cstring>hopInterval</cstring> | ||
163 | </property> | ||
164 | <property stdset="1"> | ||
165 | <name>enabled</name> | ||
166 | <bool>true</bool> | ||
167 | </property> | ||
168 | <property stdset="1"> | ||
169 | <name>suffix</name> | ||
170 | <string> ms</string> | ||
171 | </property> | ||
172 | <property stdset="1"> | ||
173 | <name>maxValue</name> | ||
174 | <number>2000</number> | ||
175 | </property> | ||
176 | <property stdset="1"> | ||
177 | <name>minValue</name> | ||
178 | <number>100</number> | ||
179 | </property> | ||
180 | <property stdset="1"> | ||
181 | <name>lineStep</name> | ||
182 | <number>100</number> | ||
183 | </property> | ||
184 | <property> | ||
185 | <name>whatsThis</name> | ||
186 | <string>Choose the channel hop interval.</string> | ||
187 | </property> | ||
188 | </widget> | ||
189 | <widget row="3" column="2" > | ||
190 | <class>QLabel</class> | ||
191 | <property stdset="1"> | ||
192 | <name>name</name> | ||
193 | <cstring>TextLabel3_3</cstring> | ||
194 | </property> | ||
195 | <property stdset="1"> | ||
196 | <name>enabled</name> | ||
197 | <bool>true</bool> | ||
198 | </property> | ||
199 | <property stdset="1"> | ||
200 | <name>text</name> | ||
201 | <string>Hop Interval</string> | ||
202 | </property> | ||
203 | </widget> | ||
204 | <widget row="2" column="2" > | ||
205 | <class>QLabel</class> | ||
206 | <property stdset="1"> | ||
207 | <name>name</name> | ||
208 | <cstring>TextLabel2_3</cstring> | ||
209 | </property> | ||
210 | <property stdset="1"> | ||
211 | <name>enabled</name> | ||
212 | <bool>true</bool> | ||
213 | </property> | ||
214 | <property stdset="1"> | ||
215 | <name>text</name> | ||
216 | <string>Device Type</string> | ||
217 | </property> | ||
218 | </widget> | ||
219 | <widget row="1" column="2" > | ||
220 | <class>QLabel</class> | ||
221 | <property stdset="1"> | ||
222 | <name>name</name> | ||
223 | <cstring>TextLabel1_2</cstring> | ||
224 | </property> | ||
225 | <property stdset="1"> | ||
226 | <name>enabled</name> | ||
227 | <bool>true</bool> | ||
228 | </property> | ||
229 | <property stdset="1"> | ||
230 | <name>text</name> | ||
231 | <string>Interface Name</string> | ||
232 | </property> | ||
233 | </widget> | ||
234 | <widget row="5" column="0" > | ||
235 | <class>QLabel</class> | ||
236 | <property stdset="1"> | ||
237 | <name>name</name> | ||
238 | <cstring>TextLabel1_5</cstring> | ||
239 | </property> | ||
240 | <property stdset="1"> | ||
241 | <name>text</name> | ||
242 | <string>Fake MAC:</string> | ||
243 | </property> | ||
244 | </widget> | ||
245 | <widget row="5" column="1" rowspan="1" colspan="2" > | ||
246 | <class>QLineEdit</class> | ||
247 | <property stdset="1"> | ||
248 | <name>name</name> | ||
249 | <cstring>MAC</cstring> | ||
250 | </property> | ||
251 | <property stdset="1"> | ||
252 | <name>enabled</name> | ||
253 | <bool>false</bool> | ||
254 | </property> | ||
255 | <property stdset="1"> | ||
256 | <name>text</name> | ||
257 | <string>44:44:44:44:44:44</string> | ||
258 | </property> | ||
259 | </widget> | ||
260 | <widget row="4" column="0" rowspan="1" colspan="3" > | ||
261 | <class>QCheckBox</class> | ||
262 | <property stdset="1"> | ||
263 | <name>name</name> | ||
264 | <cstring>activeScanning</cstring> | ||
265 | </property> | ||
266 | <property stdset="1"> | ||
267 | <name>enabled</name> | ||
268 | <bool>false</bool> | ||
269 | </property> | ||
270 | <property stdset="1"> | ||
271 | <name>text</name> | ||
272 | <string>Active Scanning (caution!)</string> | ||
273 | </property> | ||
274 | </widget> | ||
275 | <widget row="10" column="0" rowspan="1" colspan="3" > | ||
276 | <class>QLayoutWidget</class> | ||
277 | <property stdset="1"> | ||
278 | <name>name</name> | ||
279 | <cstring>Layout5</cstring> | ||
94 | </property> | 280 | </property> |
95 | <grid> | 281 | <grid> |
96 | <property stdset="1"> | 282 | <property stdset="1"> |
97 | <name>margin</name> | 283 | <name>margin</name> |
98 | <number>0</number> | 284 | <number>0</number> |
99 | </property> | 285 | </property> |
100 | <property stdset="1"> | 286 | <property stdset="1"> |
101 | <name>spacing</name> | 287 | <name>spacing</name> |
102 | <number>2</number> | 288 | <number>6</number> |
103 | </property> | 289 | </property> |
104 | <widget row="0" column="0" > | 290 | <widget row="0" column="1" > |
105 | <class>QComboBox</class> | 291 | <class>QLabel</class> |
106 | <property stdset="1"> | ||
107 | <name>name</name> | ||
108 | <cstring>interfaceName</cstring> | ||
109 | </property> | ||
110 | <property stdset="1"> | ||
111 | <name>enabled</name> | ||
112 | <bool>true</bool> | ||
113 | </property> | ||
114 | <property> | ||
115 | <name>whatsThis</name> | ||
116 | <string>Choose the interface used for sniffing.</string> | ||
117 | </property> | ||
118 | </widget> | ||
119 | <widget row="4" column="0" rowspan="1" colspan="2" > | ||
120 | <class>QCheckBox</class> | ||
121 | <property stdset="1"> | 292 | <property stdset="1"> |
122 | <name>name</name> | 293 | <name>name</name> |
123 | <cstring>activeScanning</cstring> | 294 | <cstring>TextLabel1</cstring> |
124 | </property> | ||
125 | <property stdset="1"> | ||
126 | <name>enabled</name> | ||
127 | <bool>false</bool> | ||
128 | </property> | 295 | </property> |
129 | <property stdset="1"> | 296 | <property stdset="1"> |
130 | <name>text</name> | 297 | <name>text</name> |
131 | <string>Active Scanning (caution!)</string> | 298 | <string>sound on new net</string> |
132 | </property> | 299 | </property> |
133 | </widget> | 300 | </widget> |
134 | <widget row="1" column="0" > | 301 | <widget row="1" column="0" > |
135 | <class>QComboBox</class> | 302 | <class>QComboBox</class> |
136 | <item> | 303 | <item> |
137 | <property> | 304 | <property> |
138 | <name>text</name> | 305 | <name>text</name> |
139 | <string><select></string> | 306 | <string>Ignore</string> |
140 | </property> | 307 | </property> |
141 | </item> | 308 | </item> |
142 | <item> | 309 | <item> |
143 | <property> | 310 | <property> |
144 | <name>text</name> | 311 | <name>text</name> |
145 | <string>cisco</string> | 312 | <string>Touch</string> |
146 | </property> | 313 | </property> |
147 | </item> | 314 | </item> |
148 | <item> | 315 | <item> |
149 | <property> | 316 | <property> |
150 | <name>text</name> | 317 | <name>text</name> |
151 | <string>wlan-ng</string> | 318 | <string>Key</string> |
152 | </property> | 319 | </property> |
153 | </item> | 320 | </item> |
154 | <item> | 321 | <item> |
155 | <property> | 322 | <property> |
156 | <name>text</name> | 323 | <name>text</name> |
157 | <string>hostap</string> | 324 | <string>Alarm</string> |
158 | </property> | 325 | </property> |
159 | </item> | 326 | </item> |
327 | <property stdset="1"> | ||
328 | <name>name</name> | ||
329 | <cstring>beaconSound</cstring> | ||
330 | </property> | ||
331 | </widget> | ||
332 | <widget row="0" column="0" > | ||
333 | <class>QComboBox</class> | ||
160 | <item> | 334 | <item> |
161 | <property> | 335 | <property> |
162 | <name>text</name> | 336 | <name>text</name> |
163 | <string>orinoco</string> | 337 | <string>Ignore</string> |
164 | </property> | 338 | </property> |
165 | </item> | 339 | </item> |
166 | <item> | 340 | <item> |
167 | <property> | 341 | <property> |
168 | <name>text</name> | 342 | <name>text</name> |
169 | <string><manual></string> | 343 | <string>Touch</string> |
170 | </property> | 344 | </property> |
171 | </item> | 345 | </item> |
172 | <item> | 346 | <item> |
173 | <property> | 347 | <property> |
174 | <name>text</name> | 348 | <name>text</name> |
175 | <string><file></string> | 349 | <string>Key</string> |
350 | </property> | ||
351 | </item> | ||
352 | <item> | ||
353 | <property> | ||
354 | <name>text</name> | ||
355 | <string>Alarm</string> | ||
176 | </property> | 356 | </property> |
177 | </item> | 357 | </item> |
178 | <property stdset="1"> | 358 | <property stdset="1"> |
179 | <name>name</name> | 359 | <name>name</name> |
180 | <cstring>deviceType</cstring> | 360 | <cstring>netSound</cstring> |
181 | </property> | ||
182 | <property stdset="1"> | ||
183 | <name>enabled</name> | ||
184 | <bool>true</bool> | ||
185 | </property> | ||
186 | <property> | ||
187 | <name>whatsThis</name> | ||
188 | <string>Choose the type of driver used for sniffing.</string> | ||
189 | </property> | ||
190 | </widget> | ||
191 | <widget row="3" column="0" rowspan="1" colspan="2" > | ||
192 | <class>QCheckBox</class> | ||
193 | <property stdset="1"> | ||
194 | <name>name</name> | ||
195 | <cstring>additionalInfo</cstring> | ||
196 | </property> | ||
197 | <property stdset="1"> | ||
198 | <name>enabled</name> | ||
199 | <bool>false</bool> | ||
200 | </property> | ||
201 | <property stdset="1"> | ||
202 | <name>text</name> | ||
203 | <string>Gather Additional Info</string> | ||
204 | </property> | ||
205 | </widget> | ||
206 | <widget row="2" column="0" > | ||
207 | <class>QSpinBox</class> | ||
208 | <property stdset="1"> | ||
209 | <name>name</name> | ||
210 | <cstring>hopInterval</cstring> | ||
211 | </property> | ||
212 | <property stdset="1"> | ||
213 | <name>enabled</name> | ||
214 | <bool>true</bool> | ||
215 | </property> | ||
216 | <property stdset="1"> | ||
217 | <name>suffix</name> | ||
218 | <string> ms</string> | ||
219 | </property> | ||
220 | <property stdset="1"> | ||
221 | <name>maxValue</name> | ||
222 | <number>2000</number> | ||
223 | </property> | ||
224 | <property stdset="1"> | ||
225 | <name>minValue</name> | ||
226 | <number>100</number> | ||
227 | </property> | ||
228 | <property stdset="1"> | ||
229 | <name>lineStep</name> | ||
230 | <number>100</number> | ||
231 | </property> | ||
232 | <property> | ||
233 | <name>whatsThis</name> | ||
234 | <string>Choose the channel hop interval.</string> | ||
235 | </property> | 361 | </property> |
236 | </widget> | 362 | </widget> |
237 | <widget row="2" column="1" > | 363 | <widget row="1" column="1" > |
238 | <class>QLabel</class> | 364 | <class>QLabel</class> |
239 | <property stdset="1"> | 365 | <property stdset="1"> |
240 | <name>name</name> | 366 | <name>name</name> |
241 | <cstring>TextLabel3_3</cstring> | 367 | <cstring>TextLabel1_3</cstring> |
242 | </property> | ||
243 | <property stdset="1"> | ||
244 | <name>enabled</name> | ||
245 | <bool>true</bool> | ||
246 | </property> | 368 | </property> |
247 | <property stdset="1"> | 369 | <property stdset="1"> |
248 | <name>text</name> | 370 | <name>text</name> |
249 | <string>Hop Interval</string> | 371 | <string>sound on beacon</string> |
250 | </property> | 372 | </property> |
251 | </widget> | 373 | </widget> |
252 | <widget row="1" column="1" > | 374 | </grid> |
253 | <class>QLabel</class> | 375 | </widget> |
376 | <widget row="8" column="0" rowspan="1" colspan="3" > | ||
377 | <class>QLayoutWidget</class> | ||
378 | <property stdset="1"> | ||
379 | <name>name</name> | ||
380 | <cstring>Layout7</cstring> | ||
381 | </property> | ||
382 | <hbox> | ||
383 | <property stdset="1"> | ||
384 | <name>margin</name> | ||
385 | <number>0</number> | ||
386 | </property> | ||
387 | <property stdset="1"> | ||
388 | <name>spacing</name> | ||
389 | <number>6</number> | ||
390 | </property> | ||
391 | <widget> | ||
392 | <class>QCheckBox</class> | ||
254 | <property stdset="1"> | 393 | <property stdset="1"> |
255 | <name>name</name> | 394 | <name>name</name> |
256 | <cstring>TextLabel2_3</cstring> | 395 | <cstring>writeCaptureFile</cstring> |
257 | </property> | 396 | </property> |
258 | <property stdset="1"> | 397 | <property stdset="1"> |
259 | <name>enabled</name> | 398 | <name>enabled</name> |
260 | <bool>true</bool> | 399 | <bool>true</bool> |
261 | </property> | 400 | </property> |
262 | <property stdset="1"> | 401 | <property stdset="1"> |
263 | <name>text</name> | 402 | <name>text</name> |
264 | <string>Device Type</string> | 403 | <string>Write Capture File</string> |
265 | </property> | 404 | </property> |
266 | </widget> | 405 | </widget> |
267 | <widget row="0" column="1" > | 406 | <widget> |
268 | <class>QLabel</class> | 407 | <class>QToolButton</class> |
269 | <property stdset="1"> | 408 | <property stdset="1"> |
270 | <name>name</name> | 409 | <name>name</name> |
271 | <cstring>TextLabel1_2</cstring> | 410 | <cstring>getCaptureFileName</cstring> |
272 | </property> | 411 | </property> |
273 | <property stdset="1"> | 412 | <property stdset="1"> |
274 | <name>enabled</name> | 413 | <name>enabled</name> |
275 | <bool>true</bool> | 414 | <bool>false</bool> |
276 | </property> | 415 | </property> |
277 | <property stdset="1"> | 416 | <property stdset="1"> |
278 | <name>text</name> | 417 | <name>text</name> |
279 | <string>Interface Name</string> | 418 | <string>...</string> |
280 | </property> | 419 | </property> |
281 | </widget> | 420 | </widget> |
282 | </grid> | 421 | </hbox> |
283 | </widget> | 422 | </widget> |
284 | <widget> | 423 | <widget row="7" column="0" rowspan="1" colspan="3" > |
285 | <class>QLayoutWidget</class> | 424 | <class>QLayoutWidget</class> |
286 | <property stdset="1"> | 425 | <property stdset="1"> |
287 | <name>name</name> | 426 | <name>name</name> |
288 | <cstring>Layout6</cstring> | 427 | <cstring>Layout6</cstring> |
289 | </property> | 428 | </property> |
290 | <property> | 429 | <property> |
291 | <name>layoutSpacing</name> | 430 | <name>layoutSpacing</name> |
292 | </property> | 431 | </property> |
293 | <hbox> | 432 | <hbox> |
294 | <property stdset="1"> | 433 | <property stdset="1"> |
295 | <name>margin</name> | 434 | <name>margin</name> |
296 | <number>0</number> | 435 | <number>0</number> |
297 | </property> | 436 | </property> |
298 | <property stdset="1"> | 437 | <property stdset="1"> |
299 | <name>spacing</name> | 438 | <name>spacing</name> |
300 | <number>2</number> | 439 | <number>2</number> |
301 | </property> | 440 | </property> |
302 | <widget> | 441 | <widget> |
303 | <class>QLabel</class> | 442 | <class>QLabel</class> |
304 | <property stdset="1"> | 443 | <property stdset="1"> |
305 | <name>name</name> | 444 | <name>name</name> |
306 | <cstring>TextLabel3_2_2</cstring> | 445 | <cstring>TextLabel3_2_2</cstring> |
307 | </property> | 446 | </property> |
308 | <property stdset="1"> | 447 | <property stdset="1"> |
309 | <name>sizePolicy</name> | 448 | <name>sizePolicy</name> |
310 | <sizepolicy> | 449 | <sizepolicy> |
311 | <hsizetype>4</hsizetype> | 450 | <hsizetype>4</hsizetype> |
312 | <vsizetype>1</vsizetype> | 451 | <vsizetype>1</vsizetype> |
313 | </sizepolicy> | 452 | </sizepolicy> |
314 | </property> | 453 | </property> |
315 | <property stdset="1"> | 454 | <property stdset="1"> |
316 | <name>text</name> | 455 | <name>text</name> |
317 | <string>GUI</string> | 456 | <string>GUI</string> |
318 | </property> | 457 | </property> |
319 | </widget> | 458 | </widget> |
320 | <widget> | 459 | <widget> |
321 | <class>Line</class> | 460 | <class>Line</class> |
322 | <property stdset="1"> | 461 | <property stdset="1"> |
323 | <name>name</name> | 462 | <name>name</name> |
324 | <cstring>Line9_2</cstring> | 463 | <cstring>Line9_2</cstring> |
325 | </property> | 464 | </property> |
326 | <property stdset="1"> | 465 | <property stdset="1"> |
327 | <name>orientation</name> | 466 | <name>orientation</name> |
328 | <enum>Horizontal</enum> | 467 | <enum>Horizontal</enum> |
329 | </property> | 468 | </property> |
330 | </widget> | 469 | </widget> |
331 | </hbox> | 470 | </hbox> |
332 | </widget> | 471 | </widget> |
333 | <widget> | 472 | <spacer row="6" column="2" > |
334 | <class>QCheckBox</class> | 473 | <property> |
335 | <property stdset="1"> | ||
336 | <name>name</name> | 474 | <name>name</name> |
337 | <cstring>groupNetworks</cstring> | 475 | <cstring>Spacer1</cstring> |
338 | </property> | ||
339 | <property stdset="1"> | ||
340 | <name>enabled</name> | ||
341 | <bool>false</bool> | ||
342 | </property> | 476 | </property> |
343 | <property stdset="1"> | 477 | <property stdset="1"> |
344 | <name>text</name> | 478 | <name>orientation</name> |
345 | <string>Group Detected Networks</string> | 479 | <enum>Vertical</enum> |
346 | </property> | 480 | </property> |
347 | </widget> | ||
348 | <widget> | ||
349 | <class>QCheckBox</class> | ||
350 | <property stdset="1"> | 481 | <property stdset="1"> |
351 | <name>name</name> | 482 | <name>sizeType</name> |
352 | <cstring>enableActivity</cstring> | 483 | <enum>Expanding</enum> |
353 | </property> | 484 | </property> |
354 | <property stdset="1"> | 485 | <property> |
355 | <name>enabled</name> | 486 | <name>sizeHint</name> |
356 | <bool>false</bool> | 487 | <size> |
357 | </property> | 488 | <width>20</width> |
358 | <property stdset="1"> | 489 | <height>20</height> |
359 | <name>text</name> | 490 | </size> |
360 | <string>Enable Activity Display</string> | ||
361 | </property> | 491 | </property> |
362 | </widget> | 492 | </spacer> |
363 | <widget> | 493 | <widget row="9" column="0" rowspan="1" colspan="3" > |
364 | <class>QLayoutWidget</class> | 494 | <class>QLayoutWidget</class> |
365 | <property stdset="1"> | 495 | <property stdset="1"> |
366 | <name>name</name> | 496 | <name>name</name> |
367 | <cstring>Layout5</cstring> | 497 | <cstring>Layout7</cstring> |
368 | </property> | 498 | </property> |
369 | <grid> | 499 | <hbox> |
370 | <property stdset="1"> | 500 | <property stdset="1"> |
371 | <name>margin</name> | 501 | <name>margin</name> |
372 | <number>0</number> | 502 | <number>0</number> |
373 | </property> | 503 | </property> |
374 | <property stdset="1"> | 504 | <property stdset="1"> |
375 | <name>spacing</name> | 505 | <name>spacing</name> |
376 | <number>6</number> | 506 | <number>6</number> |
377 | </property> | 507 | </property> |
378 | <widget row="0" column="1" > | 508 | <widget> |
379 | <class>QLabel</class> | 509 | <class>QLabel</class> |
380 | <property stdset="1"> | 510 | <property stdset="1"> |
381 | <name>name</name> | 511 | <name>name</name> |
382 | <cstring>TextLabel1</cstring> | 512 | <cstring>TextLabel1_4</cstring> |
383 | </property> | 513 | </property> |
384 | <property stdset="1"> | 514 | <property stdset="1"> |
385 | <name>text</name> | 515 | <name>text</name> |
386 | <string>sound on new net</string> | 516 | <string>CaptureFile:</string> |
387 | </property> | ||
388 | </widget> | ||
389 | <widget row="1" column="0" > | ||
390 | <class>QComboBox</class> | ||
391 | <item> | ||
392 | <property> | ||
393 | <name>text</name> | ||
394 | <string>Ignore</string> | ||
395 | </property> | ||
396 | </item> | ||
397 | <item> | ||
398 | <property> | ||
399 | <name>text</name> | ||
400 | <string>Touch</string> | ||
401 | </property> | ||
402 | </item> | ||
403 | <item> | ||
404 | <property> | ||
405 | <name>text</name> | ||
406 | <string>Key</string> | ||
407 | </property> | ||
408 | </item> | ||
409 | <item> | ||
410 | <property> | ||
411 | <name>text</name> | ||
412 | <string>Alarm</string> | ||
413 | </property> | ||
414 | </item> | ||
415 | <property stdset="1"> | ||
416 | <name>name</name> | ||
417 | <cstring>beaconSound</cstring> | ||
418 | </property> | ||
419 | </widget> | ||
420 | <widget row="0" column="0" > | ||
421 | <class>QComboBox</class> | ||
422 | <item> | ||
423 | <property> | ||
424 | <name>text</name> | ||
425 | <string>Ignore</string> | ||
426 | </property> | ||
427 | </item> | ||
428 | <item> | ||
429 | <property> | ||
430 | <name>text</name> | ||
431 | <string>Touch</string> | ||
432 | </property> | ||
433 | </item> | ||
434 | <item> | ||
435 | <property> | ||
436 | <name>text</name> | ||
437 | <string>Key</string> | ||
438 | </property> | ||
439 | </item> | ||
440 | <item> | ||
441 | <property> | ||
442 | <name>text</name> | ||
443 | <string>Alarm</string> | ||
444 | </property> | ||
445 | </item> | ||
446 | <property stdset="1"> | ||
447 | <name>name</name> | ||
448 | <cstring>netSound</cstring> | ||
449 | </property> | 517 | </property> |
450 | </widget> | 518 | </widget> |
451 | <widget row="1" column="1" > | 519 | <widget> |
452 | <class>QLabel</class> | 520 | <class>QLineEdit</class> |
453 | <property stdset="1"> | 521 | <property stdset="1"> |
454 | <name>name</name> | 522 | <name>name</name> |
455 | <cstring>TextLabel1_3</cstring> | 523 | <cstring>captureFileName</cstring> |
456 | </property> | 524 | </property> |
457 | <property stdset="1"> | 525 | <property stdset="1"> |
458 | <name>text</name> | 526 | <name>enabled</name> |
459 | <string>sound on beacon</string> | 527 | <bool>false</bool> |
460 | </property> | 528 | </property> |
461 | </widget> | 529 | </widget> |
462 | </grid> | 530 | </hbox> |
463 | </widget> | 531 | </widget> |
464 | </vbox> | 532 | </grid> |
465 | </widget> | 533 | </widget> |
534 | <connections> | ||
535 | <connection> | ||
536 | <sender>writeCaptureFile</sender> | ||
537 | <signal>toggled(bool)</signal> | ||
538 | <receiver>getCaptureFileName</receiver> | ||
539 | <slot>setEnabled(bool)</slot> | ||
540 | </connection> | ||
541 | <connection> | ||
542 | <sender>activeScanning</sender> | ||
543 | <signal>toggled(bool)</signal> | ||
544 | <receiver>MAC</receiver> | ||
545 | <slot>setEnabled(bool)</slot> | ||
546 | </connection> | ||
547 | <connection> | ||
548 | <sender>writeCaptureFile</sender> | ||
549 | <signal>toggled(bool)</signal> | ||
550 | <receiver>captureFileName</receiver> | ||
551 | <slot>setEnabled(bool)</slot> | ||
552 | </connection> | ||
553 | </connections> | ||
466 | </UI> | 554 | </UI> |
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 4aca526..716618e 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp | |||
@@ -1,126 +1,140 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | /* LOCAL */ | 16 | /* LOCAL */ |
17 | #include "configwindow.h" | 17 | #include "configwindow.h" |
18 | #include "mainwindow.h" | 18 | #include "mainwindow.h" |
19 | 19 | ||
20 | /* QT */ | 20 | /* QT */ |
21 | #include <qapplication.h> | 21 | #include <qapplication.h> |
22 | #include <qcombobox.h> | 22 | #include <qcombobox.h> |
23 | #include <qfile.h> | 23 | #include <qfile.h> |
24 | #include <qlineedit.h> | ||
24 | #include <qlayout.h> | 25 | #include <qlayout.h> |
25 | #include <qmap.h> | 26 | #include <qmap.h> |
26 | #include <qpushbutton.h> | 27 | #include <qpushbutton.h> |
28 | #include <qtoolbutton.h> | ||
27 | #include <qspinbox.h> | 29 | #include <qspinbox.h> |
28 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
29 | 31 | ||
30 | /* OPIE */ | 32 | /* OPIE */ |
31 | #include <opie2/onetwork.h> | 33 | #include <opie2/onetwork.h> |
32 | 34 | ||
33 | WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; | 35 | WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; |
34 | 36 | ||
35 | WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) | 37 | WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) |
36 | :WellenreiterConfigBase( parent, name, true, f ) | 38 | :WellenreiterConfigBase( parent, name, true, f ) |
37 | { | 39 | { |
38 | _devicetype[ "cisco" ] = DEVTYPE_CISCO; | 40 | _devicetype[ "cisco" ] = DEVTYPE_CISCO; |
39 | _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG; | 41 | _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG; |
40 | _devicetype[ "hostap" ] = DEVTYPE_HOSTAP; | 42 | _devicetype[ "hostap" ] = DEVTYPE_HOSTAP; |
41 | _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO; | 43 | _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO; |
42 | _devicetype[ "<manual>" ] = DEVTYPE_MANUAL; | 44 | _devicetype[ "<manual>" ] = DEVTYPE_MANUAL; |
43 | _devicetype[ "<file>" ] = DEVTYPE_FILE; | 45 | _devicetype[ "<file>" ] = DEVTYPE_FILE; |
44 | 46 | ||
45 | // gather possible interface names from ONetwork | 47 | // gather possible interface names from ONetwork |
46 | ONetwork* net = ONetwork::instance(); | 48 | ONetwork* net = ONetwork::instance(); |
47 | ONetwork::InterfaceIterator it = net->iterator(); | 49 | ONetwork::InterfaceIterator it = net->iterator(); |
48 | while ( it.current() ) | 50 | while ( it.current() ) |
49 | { | 51 | { |
50 | if ( it.current()->isWireless() ) | 52 | if ( it.current()->isWireless() ) |
51 | interfaceName->insertItem( it.current()->name() ); | 53 | interfaceName->insertItem( it.current()->name() ); |
52 | ++it; | 54 | ++it; |
53 | } | 55 | } |
54 | 56 | ||
55 | // try to guess device type | 57 | // try to guess device type |
56 | QFile m( "/proc/modules" ); | 58 | QFile m( "/proc/modules" ); |
57 | if ( m.open( IO_ReadOnly ) ) | 59 | if ( m.open( IO_ReadOnly ) ) |
58 | { | 60 | { |
59 | int devicetype(0); | 61 | int devicetype(0); |
60 | QString line; | 62 | QString line; |
61 | QTextStream modules( &m ); | 63 | QTextStream modules( &m ); |
62 | while( !modules.atEnd() && !devicetype ) | 64 | while( !modules.atEnd() && !devicetype ) |
63 | { | 65 | { |
64 | modules >> line; | 66 | modules >> line; |
65 | if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO; | 67 | if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO; |
66 | else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP; | 68 | else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP; |
67 | else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG; | 69 | else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG; |
68 | else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO; | 70 | else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO; |
69 | } | 71 | } |
70 | if ( devicetype ) | 72 | if ( devicetype ) |
71 | { | 73 | { |
72 | deviceType->setCurrentItem( devicetype ); | 74 | deviceType->setCurrentItem( devicetype ); |
73 | _guess = devicetype; | 75 | _guess = devicetype; |
74 | qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); | 76 | qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); |
75 | } | 77 | } |
76 | } | 78 | } |
77 | 79 | ||
78 | #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here | 80 | #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here |
79 | QPushButton* okButton = new QPushButton( "ok", this ); | 81 | QPushButton* okButton = new QPushButton( "ok", this ); |
80 | okButton->show(); | 82 | okButton->show(); |
81 | Layout5_2->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui | 83 | Layout5_2->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui |
82 | connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); | 84 | connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); |
83 | #endif | 85 | #endif |
84 | 86 | ||
85 | WellenreiterConfigWindow::_instance = this; | 87 | WellenreiterConfigWindow::_instance = this; |
86 | 88 | ||
87 | connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); | 89 | connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); |
90 | connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); | ||
88 | }; | 91 | }; |
89 | 92 | ||
90 | 93 | ||
91 | int WellenreiterConfigWindow::daemonDeviceType() | 94 | int WellenreiterConfigWindow::daemonDeviceType() |
92 | { | 95 | { |
93 | QString name = deviceType->currentText(); | 96 | QString name = deviceType->currentText(); |
94 | if ( _devicetype.contains( name ) ) | 97 | if ( _devicetype.contains( name ) ) |
95 | { | 98 | { |
96 | return _devicetype[name]; | 99 | return _devicetype[name]; |
97 | } | 100 | } |
98 | else | 101 | else |
99 | { | 102 | { |
100 | return 0; | 103 | return 0; |
101 | } | 104 | } |
102 | }; | 105 | }; |
103 | 106 | ||
104 | 107 | ||
105 | int WellenreiterConfigWindow::daemonHopInterval() | 108 | int WellenreiterConfigWindow::daemonHopInterval() |
106 | { | 109 | { |
107 | return hopInterval->cleanText().toInt(); | 110 | return hopInterval->cleanText().toInt(); |
108 | } | 111 | } |
109 | 112 | ||
110 | 113 | ||
111 | void WellenreiterConfigWindow::changedDeviceType(int t) | 114 | void WellenreiterConfigWindow::changedDeviceType(int t) |
112 | { | 115 | { |
113 | if ( t != DEVTYPE_FILE ) return; | 116 | if ( t != DEVTYPE_FILE ) return; |
114 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); | 117 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); |
115 | if ( !name.isNull() && QFile::exists( name ) ) | 118 | if ( !name.isEmpty() && QFile::exists( name ) ) |
116 | { | 119 | { |
117 | interfaceName->insertItem( name ); | 120 | interfaceName->insertItem( name ); |
118 | interfaceName->setCurrentItem( interfaceName->count()-1 ); | 121 | interfaceName->setCurrentItem( interfaceName->count()-1 ); |
119 | } | 122 | } |
120 | else | 123 | else |
121 | { | 124 | { |
122 | deviceType->setCurrentItem( _guess ); | 125 | deviceType->setCurrentItem( _guess ); |
123 | } | 126 | } |
124 | 127 | ||
125 | } | 128 | } |
126 | 129 | ||
130 | |||
131 | void WellenreiterConfigWindow::getCaptureFileNameClicked() | ||
132 | { | ||
133 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); | ||
134 | qDebug( "name = %s", (const char*) name ); | ||
135 | if ( !name.isEmpty() ) | ||
136 | { | ||
137 | captureFileName->setText( name ); | ||
138 | } | ||
139 | } | ||
140 | |||
diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h index 7df1a80..c7c70a6 100644 --- a/noncore/net/wellenreiter/gui/configwindow.h +++ b/noncore/net/wellenreiter/gui/configwindow.h | |||
@@ -1,56 +1,57 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef WELLENREITERCONFIGWINDOW_H | 16 | #ifndef WELLENREITERCONFIGWINDOW_H |
17 | #define WELLENREITERCONFIGWINDOW_H | 17 | #define WELLENREITERCONFIGWINDOW_H |
18 | 18 | ||
19 | #include "configbase.h" | 19 | #include "configbase.h" |
20 | #include <qmap.h> | 20 | #include <qmap.h> |
21 | #include <qcombobox.h> | 21 | #include <qcombobox.h> |
22 | #include <qstring.h> | 22 | #include <qstring.h> |
23 | 23 | ||
24 | const int DEVTYPE_SELECT = 0; | 24 | const int DEVTYPE_SELECT = 0; |
25 | const int DEVTYPE_CISCO = 1; | 25 | const int DEVTYPE_CISCO = 1; |
26 | const int DEVTYPE_WLAN_NG = 2; | 26 | const int DEVTYPE_WLAN_NG = 2; |
27 | const int DEVTYPE_HOSTAP = 3; | 27 | const int DEVTYPE_HOSTAP = 3; |
28 | const int DEVTYPE_ORINOCO = 4; | 28 | const int DEVTYPE_ORINOCO = 4; |
29 | const int DEVTYPE_MANUAL = 5; | 29 | const int DEVTYPE_MANUAL = 5; |
30 | const int DEVTYPE_FILE = 6; | 30 | const int DEVTYPE_FILE = 6; |
31 | 31 | ||
32 | class WellenreiterConfigWindow; | 32 | class WellenreiterConfigWindow; |
33 | 33 | ||
34 | class WellenreiterConfigWindow : public WellenreiterConfigBase | 34 | class WellenreiterConfigWindow : public WellenreiterConfigBase |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | 37 | ||
38 | public: | 38 | public: |
39 | WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); | 39 | WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); |
40 | int daemonDeviceType(); | 40 | int daemonDeviceType(); |
41 | int daemonHopInterval(); | 41 | int daemonHopInterval(); |
42 | const QString soundOnNetwork() const { return netSound->currentText(); }; | 42 | const QString soundOnNetwork() const { return netSound->currentText(); }; |
43 | const QString soundOnBeacon() const { return beaconSound->currentText(); }; | 43 | const QString soundOnBeacon() const { return beaconSound->currentText(); }; |
44 | static WellenreiterConfigWindow* instance() { return _instance; }; | 44 | static WellenreiterConfigWindow* instance() { return _instance; }; |
45 | 45 | ||
46 | public slots: | 46 | public slots: |
47 | void changedDeviceType(int); | 47 | void changedDeviceType(int); |
48 | void getCaptureFileNameClicked(); | ||
48 | 49 | ||
49 | protected: | 50 | protected: |
50 | QMap<QString, int> _devicetype; | 51 | QMap<QString, int> _devicetype; |
51 | static WellenreiterConfigWindow* _instance; | 52 | static WellenreiterConfigWindow* _instance; |
52 | int _guess; | 53 | int _guess; |
53 | 54 | ||
54 | }; | 55 | }; |
55 | 56 | ||
56 | #endif | 57 | #endif |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 5c10c3b..be2a86e 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -1,131 +1,133 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ***********************************************************************/ | 14 | ***********************************************************************/ |
15 | 15 | ||
16 | // Opie | 16 | // Opie |
17 | 17 | ||
18 | #ifdef QWS | 18 | #ifdef QWS |
19 | #include <opie/odevice.h> | 19 | #include <opie/odevice.h> |
20 | using namespace Opie; | 20 | using namespace Opie; |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | #ifdef QWS | 23 | #ifdef QWS |
24 | #include <opie2/oapplication.h> | 24 | #include <opie2/oapplication.h> |
25 | #else | 25 | #else |
26 | #include <qapplication.h> | 26 | #include <qapplication.h> |
27 | #endif | 27 | #endif |
28 | #include <opie2/onetwork.h> | 28 | #include <opie2/onetwork.h> |
29 | #include <opie2/opcap.h> | 29 | #include <opie2/opcap.h> |
30 | 30 | ||
31 | // Qt | 31 | // Qt |
32 | 32 | ||
33 | #include <qcheckbox.h> | ||
34 | #include <qcombobox.h> | ||
33 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | #include <qlineedit.h> | ||
34 | #include <qmessagebox.h> | 37 | #include <qmessagebox.h> |
35 | #include <qcombobox.h> | ||
36 | #include <qspinbox.h> | 38 | #include <qspinbox.h> |
37 | #include <qtoolbutton.h> | 39 | #include <qtoolbutton.h> |
38 | #include <qmainwindow.h> | 40 | #include <qmainwindow.h> |
39 | 41 | ||
40 | // Standard | 42 | // Standard |
41 | 43 | ||
42 | #include <assert.h> | 44 | #include <assert.h> |
43 | #include <errno.h> | 45 | #include <errno.h> |
44 | #include <unistd.h> | 46 | #include <unistd.h> |
45 | #include <string.h> | 47 | #include <string.h> |
46 | #include <sys/types.h> | 48 | #include <sys/types.h> |
47 | #include <stdlib.h> | 49 | #include <stdlib.h> |
48 | 50 | ||
49 | // Local | 51 | // Local |
50 | 52 | ||
51 | #include "wellenreiter.h" | 53 | #include "wellenreiter.h" |
52 | #include "scanlist.h" | 54 | #include "scanlist.h" |
53 | #include "logwindow.h" | 55 | #include "logwindow.h" |
54 | #include "hexwindow.h" | 56 | #include "hexwindow.h" |
55 | #include "configwindow.h" | 57 | #include "configwindow.h" |
56 | #include "statwindow.h" | 58 | #include "statwindow.h" |
57 | #include "manufacturers.h" | 59 | #include "manufacturers.h" |
58 | 60 | ||
59 | Wellenreiter::Wellenreiter( QWidget* parent ) | 61 | Wellenreiter::Wellenreiter( QWidget* parent ) |
60 | : WellenreiterBase( parent, 0, 0 ), | 62 | : WellenreiterBase( parent, 0, 0 ), |
61 | sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) | 63 | sniffing( false ), iface( 0 ), manufacturerdb( 0 ), configwindow( 0 ) |
62 | { | 64 | { |
63 | 65 | ||
64 | // | 66 | // |
65 | // construct manufacturer database | 67 | // construct manufacturer database |
66 | // | 68 | // |
67 | 69 | ||
68 | QString manufile; | 70 | QString manufile; |
69 | #ifdef QWS | 71 | #ifdef QWS |
70 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); | 72 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); |
71 | #else | 73 | #else |
72 | manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); | 74 | manufile.sprintf( "/usr/local/share/wellenreiter/manufacturers.dat" ); |
73 | #endif | 75 | #endif |
74 | manufacturerdb = new ManufacturerDB( manufile ); | 76 | manufacturerdb = new ManufacturerDB( manufile ); |
75 | 77 | ||
76 | logwindow->log( "(i) Wellenreiter has been started." ); | 78 | logwindow->log( "(i) Wellenreiter has been started." ); |
77 | 79 | ||
78 | // | 80 | // |
79 | // detect operating system | 81 | // detect operating system |
80 | // | 82 | // |
81 | 83 | ||
82 | #ifdef QWS | 84 | #ifdef QWS |
83 | QString sys; | 85 | QString sys; |
84 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); | 86 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); |
85 | _system = ODevice::inst()->system(); | 87 | _system = ODevice::inst()->system(); |
86 | logwindow->log( sys ); | 88 | logwindow->log( sys ); |
87 | #endif | 89 | #endif |
88 | 90 | ||
89 | // setup GUI | 91 | // setup GUI |
90 | netview->setColumnWidthMode( 1, QListView::Manual ); | 92 | netview->setColumnWidthMode( 1, QListView::Manual ); |
91 | 93 | ||
92 | if ( manufacturerdb ) | 94 | if ( manufacturerdb ) |
93 | netview->setManufacturerDB( manufacturerdb ); | 95 | netview->setManufacturerDB( manufacturerdb ); |
94 | 96 | ||
95 | pcap = new OPacketCapturer(); | 97 | pcap = new OPacketCapturer(); |
96 | 98 | ||
97 | } | 99 | } |
98 | 100 | ||
99 | 101 | ||
100 | Wellenreiter::~Wellenreiter() | 102 | Wellenreiter::~Wellenreiter() |
101 | { | 103 | { |
102 | // no need to delete child widgets, Qt does it all for us | 104 | // no need to delete child widgets, Qt does it all for us |
103 | 105 | ||
104 | delete manufacturerdb; | 106 | delete manufacturerdb; |
105 | delete pcap; | 107 | delete pcap; |
106 | } | 108 | } |
107 | 109 | ||
108 | 110 | ||
109 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | 111 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) |
110 | { | 112 | { |
111 | configwindow = cw; | 113 | configwindow = cw; |
112 | } | 114 | } |
113 | 115 | ||
114 | 116 | ||
115 | void Wellenreiter::channelHopped(int c) | 117 | void Wellenreiter::channelHopped(int c) |
116 | { | 118 | { |
117 | QString title = "Wellenreiter II -scan- ["; | 119 | QString title = "Wellenreiter II -scan- ["; |
118 | QString left; | 120 | QString left; |
119 | if ( c > 1 ) left.fill( '.', c-1 ); | 121 | if ( c > 1 ) left.fill( '.', c-1 ); |
120 | title.append( left ); | 122 | title.append( left ); |
121 | title.append( '|' ); | 123 | title.append( '|' ); |
122 | if ( c < iface->channels() ) | 124 | if ( c < iface->channels() ) |
123 | { | 125 | { |
124 | QString right; | 126 | QString right; |
125 | right.fill( '.', iface->channels()-c ); | 127 | right.fill( '.', iface->channels()-c ); |
126 | title.append( right ); | 128 | title.append( right ); |
127 | } | 129 | } |
128 | title.append( "]" ); | 130 | title.append( "]" ); |
129 | //title.append( QString().sprintf( " %02d", c ) ); | 131 | //title.append( QString().sprintf( " %02d", c ) ); |
130 | assert( parent() ); | 132 | assert( parent() ); |
131 | ( (QMainWindow*) parent() )->setCaption( title ); | 133 | ( (QMainWindow*) parent() )->setCaption( title ); |
@@ -227,139 +229,150 @@ void Wellenreiter::stopClicked() | |||
227 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 229 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
228 | iface->setChannelHopping(); // stop hopping channels | 230 | iface->setChannelHopping(); // stop hopping channels |
229 | } | 231 | } |
230 | else | 232 | else |
231 | killTimers(); | 233 | killTimers(); |
232 | 234 | ||
233 | pcap->close(); | 235 | pcap->close(); |
234 | sniffing = false; | 236 | sniffing = false; |
235 | 237 | ||
236 | if ( iface ) | 238 | if ( iface ) |
237 | { | 239 | { |
238 | // switch off monitor mode | 240 | // switch off monitor mode |
239 | iface->setMonitorMode( false ); | 241 | iface->setMonitorMode( false ); |
240 | // switch off promisc flag | 242 | // switch off promisc flag |
241 | iface->setPromiscuousMode( false ); | 243 | iface->setPromiscuousMode( false ); |
242 | 244 | ||
243 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess | 245 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess |
244 | } | 246 | } |
245 | 247 | ||
246 | logwindow->log( "(i) Stopped Scanning." ); | 248 | logwindow->log( "(i) Stopped Scanning." ); |
247 | assert( parent() ); | 249 | assert( parent() ); |
248 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); | 250 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); |
249 | 251 | ||
250 | // message the user | 252 | // message the user |
251 | QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); | 253 | QMessageBox::information( this, "Wellenreiter II", "Your wireless card\nshould now be usable again." ); |
252 | 254 | ||
253 | sniffing = false; | 255 | sniffing = false; |
254 | emit( stoppedSniffing() ); | 256 | emit( stoppedSniffing() ); |
255 | 257 | ||
256 | // print out statistics | 258 | // print out statistics |
257 | statwindow->log( "-----------------------------------------" ); | 259 | statwindow->log( "-----------------------------------------" ); |
258 | statwindow->log( "- Wellenreiter II Capturing Statistic -" ); | 260 | statwindow->log( "- Wellenreiter II Capturing Statistic -" ); |
259 | statwindow->log( "-----------------------------------------" ); | 261 | statwindow->log( "-----------------------------------------" ); |
260 | statwindow->log( "Packet Type | Receive Count" ); | 262 | statwindow->log( "Packet Type | Receive Count" ); |
261 | 263 | ||
262 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) | 264 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) |
263 | { | 265 | { |
264 | QString left; | 266 | QString left; |
265 | left.sprintf( "%s", (const char*) it.key() ); | 267 | left.sprintf( "%s", (const char*) it.key() ); |
266 | left = left.leftJustify( 20 ); | 268 | left = left.leftJustify( 20 ); |
267 | left.append( '|' ); | 269 | left.append( '|' ); |
268 | QString right; | 270 | QString right; |
269 | right.sprintf( "%d", it.data() ); | 271 | right.sprintf( "%d", it.data() ); |
270 | right = right.rightJustify( 7 ); | 272 | right = right.rightJustify( 7 ); |
271 | statwindow->log( left + right ); | 273 | statwindow->log( left + right ); |
272 | } | 274 | } |
273 | 275 | ||
274 | } | 276 | } |
275 | 277 | ||
276 | 278 | ||
277 | void Wellenreiter::startClicked() | 279 | void Wellenreiter::startClicked() |
278 | { | 280 | { |
279 | // get configuration from config window | 281 | // get configuration from config window |
280 | 282 | ||
281 | const QString& interface = configwindow->interfaceName->currentText(); | 283 | const QString& interface = configwindow->interfaceName->currentText(); |
282 | const int cardtype = configwindow->daemonDeviceType(); | 284 | const int cardtype = configwindow->daemonDeviceType(); |
283 | const int interval = configwindow->daemonHopInterval(); | 285 | const int interval = configwindow->daemonHopInterval(); |
284 | 286 | ||
285 | if ( ( interface == "" ) || ( cardtype == 0 ) ) | 287 | if ( ( interface == "" ) || ( cardtype == 0 ) ) |
286 | { | 288 | { |
287 | QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); | 289 | QMessageBox::information( this, "Wellenreiter II", "Your device is not\nproperly configured. Please reconfigure!" ); |
288 | return; | 290 | return; |
289 | } | 291 | } |
290 | 292 | ||
291 | // configure device | 293 | // configure device |
292 | 294 | ||
293 | ONetwork* net = ONetwork::instance(); | 295 | ONetwork* net = ONetwork::instance(); |
294 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); | 296 | iface = static_cast<OWirelessNetworkInterface*>(net->interface( interface )); |
295 | 297 | ||
296 | // set monitor mode | 298 | // set monitor mode |
297 | 299 | ||
298 | switch ( cardtype ) | 300 | switch ( cardtype ) |
299 | { | 301 | { |
300 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; | 302 | case DEVTYPE_CISCO: iface->setMonitoring( new OCiscoMonitoringInterface( iface ) ); break; |
301 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; | 303 | case DEVTYPE_WLAN_NG: iface->setMonitoring( new OWlanNGMonitoringInterface( iface ) ); break; |
302 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; | 304 | case DEVTYPE_HOSTAP: iface->setMonitoring( new OHostAPMonitoringInterface( iface ) ); break; |
303 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; | 305 | case DEVTYPE_ORINOCO: iface->setMonitoring( new OOrinocoMonitoringInterface( iface ) ); break; |
304 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); break; | 306 | case DEVTYPE_MANUAL: QMessageBox::information( this, "Wellenreiter II", "Bring your device into\nmonitor mode now." ); break; |
305 | case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; | 307 | case DEVTYPE_FILE: qDebug( "Wellenreiter: Capturing from file '%s'", (const char*) interface ); break; |
306 | default: assert( 0 ); // shouldn't reach this | 308 | default: assert( 0 ); // shouldn't reach this |
307 | } | 309 | } |
308 | 310 | ||
309 | // switch device into monitor mode | 311 | // switch device into monitor mode |
310 | if ( cardtype < DEVTYPE_FILE ) | 312 | if ( cardtype < DEVTYPE_FILE ) |
311 | { | 313 | { |
312 | if ( cardtype != DEVTYPE_MANUAL ) | 314 | if ( cardtype != DEVTYPE_MANUAL ) |
313 | iface->setMonitorMode( true ); | 315 | iface->setMonitorMode( true ); |
314 | if ( !iface->monitorMode() ) | 316 | if ( !iface->monitorMode() ) |
315 | { | 317 | { |
316 | QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." ); | 318 | QMessageBox::warning( this, "Wellenreiter II", "Can't set device into monitor mode." ); |
317 | return; | 319 | return; |
318 | } | 320 | } |
319 | } | 321 | } |
320 | 322 | ||
321 | // open pcap and start sniffing | 323 | // open pcap and start sniffing |
322 | if ( cardtype != DEVTYPE_FILE ) | 324 | if ( cardtype != DEVTYPE_FILE ) |
323 | pcap->open( interface ); | 325 | { |
326 | if ( configwindow->writeCaptureFile->isEnabled() ) | ||
327 | { | ||
328 | pcap->open( interface, configwindow->captureFileName->text() ); | ||
329 | } | ||
330 | else | ||
331 | { | ||
332 | pcap->open( interface ); | ||
333 | } | ||
334 | } | ||
324 | else | 335 | else |
336 | { | ||
325 | pcap->open( QFile( interface ) ); | 337 | pcap->open( QFile( interface ) ); |
338 | } | ||
326 | 339 | ||
327 | if ( !pcap->isOpen() ) | 340 | if ( !pcap->isOpen() ) |
328 | { | 341 | { |
329 | QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); | 342 | QMessageBox::warning( this, "Wellenreiter II", "Can't open packet capturer:\n" + QString(strerror( errno ) )); |
330 | return; | 343 | return; |
331 | } | 344 | } |
332 | 345 | ||
333 | // set capturer to non-blocking mode | 346 | // set capturer to non-blocking mode |
334 | pcap->setBlocking( false ); | 347 | pcap->setBlocking( false ); |
335 | 348 | ||
336 | // start channel hopper | 349 | // start channel hopper |
337 | if ( cardtype != DEVTYPE_FILE ) | 350 | if ( cardtype != DEVTYPE_FILE ) |
338 | iface->setChannelHopping( 1000 ); //use interval from config window | 351 | iface->setChannelHopping( 1000 ); //use interval from config window |
339 | 352 | ||
340 | if ( cardtype != DEVTYPE_FILE ) | 353 | if ( cardtype != DEVTYPE_FILE ) |
341 | { | 354 | { |
342 | // connect socket notifier and start channel hopper | 355 | // connect socket notifier and start channel hopper |
343 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 356 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); |
344 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 357 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
345 | } | 358 | } |
346 | else | 359 | else |
347 | { | 360 | { |
348 | // start timer for reading packets | 361 | // start timer for reading packets |
349 | startTimer( 100 ); | 362 | startTimer( 100 ); |
350 | } | 363 | } |
351 | 364 | ||
352 | logwindow->log( "(i) Started Scanning." ); | 365 | logwindow->log( "(i) Started Scanning." ); |
353 | sniffing = true; | 366 | sniffing = true; |
354 | emit( startedSniffing() ); | 367 | emit( startedSniffing() ); |
355 | } | 368 | } |
356 | 369 | ||
357 | 370 | ||
358 | void Wellenreiter::timerEvent( QTimerEvent* ) | 371 | void Wellenreiter::timerEvent( QTimerEvent* ) |
359 | { | 372 | { |
360 | qDebug( "Wellenreiter::timerEvent()" ); | 373 | qDebug( "Wellenreiter::timerEvent()" ); |
361 | OPacket* p = pcap->next(); | 374 | OPacket* p = pcap->next(); |
362 | receivePacket( p ); | 375 | receivePacket( p ); |
363 | delete p; | 376 | delete p; |
364 | } | 377 | } |
365 | 378 | ||