author | mickeyl <mickeyl> | 2002-12-28 18:57:11 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2002-12-28 18:57:11 (UTC) |
commit | f70916f3ab05917a3d0dda64beb8db5ac16448ab (patch) (unidiff) | |
tree | bd138c1a901de7ea49b012b32e48d3f4b8b073f8 | |
parent | 1362726346f1ab497ad5822db1a9b284f5bdaa1a (diff) | |
download | opie-f70916f3ab05917a3d0dda64beb8db5ac16448ab.zip opie-f70916f3ab05917a3d0dda64beb8db5ac16448ab.tar.gz opie-f70916f3ab05917a3d0dda64beb8db5ac16448ab.tar.bz2 |
- refactored a number of classes
- removed dumb polling ==> QSocketNotifier rocks
- switched to parsing the daemon stuff in the gui,
since libwellenreiter still has problems.
-rw-r--r-- | noncore/net/wellenreiter/gui/cardconfig.cpp | 29 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/cardconfig.h | 58 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configbase.ui | 10 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/gui-x11.pro | 6 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 6 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 100 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.h | 11 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 213 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 18 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.h | 13 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wlan.cpp | 57 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wlan.h | 38 |
14 files changed, 403 insertions, 165 deletions
diff --git a/noncore/net/wellenreiter/gui/cardconfig.cpp b/noncore/net/wellenreiter/gui/cardconfig.cpp new file mode 100644 index 0000000..1ca1d27 --- a/dev/null +++ b/noncore/net/wellenreiter/gui/cardconfig.cpp | |||
@@ -0,0 +1,29 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Opie Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | **********************************************************************/ | ||
15 | |||
16 | #include "cardconfig.h" | ||
17 | |||
18 | #include <qstring.h> | ||
19 | |||
20 | CardConfig::CardConfig( const QString& interface, Type type, int hopinterval ) | ||
21 | :_interface( interface ), _type( type ), _hopinterval( hopinterval ) | ||
22 | { | ||
23 | |||
24 | } | ||
25 | |||
26 | CardConfig::~CardConfig() | ||
27 | { | ||
28 | } | ||
29 | |||
diff --git a/noncore/net/wellenreiter/gui/cardconfig.h b/noncore/net/wellenreiter/gui/cardconfig.h new file mode 100644 index 0000000..f54ebac --- a/dev/null +++ b/noncore/net/wellenreiter/gui/cardconfig.h | |||
@@ -0,0 +1,58 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Opie Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | **********************************************************************/ | ||
15 | |||
16 | #ifndef CARDCONFIG_H | ||
17 | #define CARDCONFIG_H | ||
18 | |||
19 | #include <qstring.h> | ||
20 | |||
21 | #ifdef QWS | ||
22 | #include <opie/odevice.h> | ||
23 | using namespace Opie; | ||
24 | #endif | ||
25 | |||
26 | class CardConfig | ||
27 | { | ||
28 | public: | ||
29 | |||
30 | typedef enum { Prism, Orinoco, HostAP, Manual } Type; | ||
31 | |||
32 | public: | ||
33 | |||
34 | CardConfig( const QString& interface, Type type = Manual, int hopinterval = 100 ); | ||
35 | virtual ~CardConfig(); | ||
36 | |||
37 | const QString& interface() { return _interface; }; | ||
38 | int hopinterval() { return _hopinterval; }; | ||
39 | Type type() { return _type; }; | ||
40 | |||
41 | #ifdef QWS | ||
42 | OSystem system() { return _system; }; | ||
43 | #endif | ||
44 | |||
45 | private: | ||
46 | |||
47 | QString _interface; | ||
48 | Type _type; | ||
49 | int _hopinterval; | ||
50 | |||
51 | #ifdef QWS | ||
52 | OSystem _system; | ||
53 | #endif | ||
54 | |||
55 | }; | ||
56 | |||
57 | #endif | ||
58 | |||
diff --git a/noncore/net/wellenreiter/gui/configbase.ui b/noncore/net/wellenreiter/gui/configbase.ui index e2f734a..8dcf513 100644 --- a/noncore/net/wellenreiter/gui/configbase.ui +++ b/noncore/net/wellenreiter/gui/configbase.ui | |||
@@ -1,435 +1,429 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>WellenreiterConfigBase</class> | 2 | <class>WellenreiterConfigBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QWidget</class> | 4 | <class>QWidget</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>232</width> | 14 | <width>228</width> |
15 | <height>267</height> | 15 | <height>267</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 | <vbox> |
29 | <property stdset="1"> | 29 | <property stdset="1"> |
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>4</number> | 31 | <number>4</number> |
32 | </property> | 32 | </property> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>0</number> | 35 | <number>1</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
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> |
87 | <class>QLayoutWidget</class> | 87 | <class>QLayoutWidget</class> |
88 | <property stdset="1"> | 88 | <property stdset="1"> |
89 | <name>name</name> | 89 | <name>name</name> |
90 | <cstring>Layout7</cstring> | 90 | <cstring>Layout7</cstring> |
91 | </property> | 91 | </property> |
92 | <property> | 92 | <property> |
93 | <name>layoutSpacing</name> | 93 | <name>layoutSpacing</name> |
94 | </property> | 94 | </property> |
95 | <grid> | 95 | <grid> |
96 | <property stdset="1"> | 96 | <property stdset="1"> |
97 | <name>margin</name> | 97 | <name>margin</name> |
98 | <number>0</number> | 98 | <number>0</number> |
99 | </property> | 99 | </property> |
100 | <property stdset="1"> | 100 | <property stdset="1"> |
101 | <name>spacing</name> | 101 | <name>spacing</name> |
102 | <number>2</number> | 102 | <number>2</number> |
103 | </property> | 103 | </property> |
104 | <widget row="0" column="0" > | 104 | <widget row="0" column="0" > |
105 | <class>QComboBox</class> | 105 | <class>QComboBox</class> |
106 | <item> | 106 | <item> |
107 | <property> | 107 | <property> |
108 | <name>text</name> | 108 | <name>text</name> |
109 | <string><select></string> | 109 | <string><select></string> |
110 | </property> | 110 | </property> |
111 | </item> | 111 | </item> |
112 | <item> | 112 | <item> |
113 | <property> | 113 | <property> |
114 | <name>text</name> | 114 | <name>text</name> |
115 | <string>eth0</string> | 115 | <string>eth0</string> |
116 | </property> | 116 | </property> |
117 | </item> | 117 | </item> |
118 | <item> | 118 | <item> |
119 | <property> | 119 | <property> |
120 | <name>text</name> | 120 | <name>text</name> |
121 | <string>eth1</string> | 121 | <string>eth1</string> |
122 | </property> | 122 | </property> |
123 | </item> | 123 | </item> |
124 | <item> | 124 | <item> |
125 | <property> | 125 | <property> |
126 | <name>text</name> | 126 | <name>text</name> |
127 | <string>wlan0</string> | 127 | <string>wlan0</string> |
128 | </property> | 128 | </property> |
129 | </item> | 129 | </item> |
130 | <item> | 130 | <item> |
131 | <property> | 131 | <property> |
132 | <name>text</name> | 132 | <name>text</name> |
133 | <string>wlan1</string> | 133 | <string>wlan1</string> |
134 | </property> | 134 | </property> |
135 | </item> | 135 | </item> |
136 | <item> | 136 | <item> |
137 | <property> | 137 | <property> |
138 | <name>text</name> | 138 | <name>text</name> |
139 | <string>wifi0</string> | 139 | <string>wifi0</string> |
140 | </property> | 140 | </property> |
141 | </item> | 141 | </item> |
142 | <item> | 142 | <item> |
143 | <property> | 143 | <property> |
144 | <name>text</name> | 144 | <name>text</name> |
145 | <string>wifi1</string> | 145 | <string>wifi1</string> |
146 | </property> | 146 | </property> |
147 | </item> | 147 | </item> |
148 | <property stdset="1"> | 148 | <property stdset="1"> |
149 | <name>name</name> | 149 | <name>name</name> |
150 | <cstring>interfaceName</cstring> | 150 | <cstring>interfaceName</cstring> |
151 | </property> | 151 | </property> |
152 | <property stdset="1"> | 152 | <property stdset="1"> |
153 | <name>enabled</name> | 153 | <name>enabled</name> |
154 | <bool>true</bool> | 154 | <bool>true</bool> |
155 | </property> | 155 | </property> |
156 | </widget> | 156 | </widget> |
157 | <widget row="4" column="0" rowspan="1" colspan="2" > | 157 | <widget row="4" column="0" rowspan="1" colspan="2" > |
158 | <class>QCheckBox</class> | 158 | <class>QCheckBox</class> |
159 | <property stdset="1"> | 159 | <property stdset="1"> |
160 | <name>name</name> | 160 | <name>name</name> |
161 | <cstring>activeScanning</cstring> | 161 | <cstring>activeScanning</cstring> |
162 | </property> | 162 | </property> |
163 | <property stdset="1"> | 163 | <property stdset="1"> |
164 | <name>enabled</name> | 164 | <name>enabled</name> |
165 | <bool>false</bool> | 165 | <bool>false</bool> |
166 | </property> | 166 | </property> |
167 | <property stdset="1"> | 167 | <property stdset="1"> |
168 | <name>text</name> | 168 | <name>text</name> |
169 | <string>Active Scanning (caution!)</string> | 169 | <string>Active Scanning (caution!)</string> |
170 | </property> | 170 | </property> |
171 | </widget> | 171 | </widget> |
172 | <widget row="1" column="0" > | 172 | <widget row="1" column="0" > |
173 | <class>QComboBox</class> | 173 | <class>QComboBox</class> |
174 | <item> | 174 | <item> |
175 | <property> | 175 | <property> |
176 | <name>text</name> | 176 | <name>text</name> |
177 | <string><select></string> | 177 | <string><select></string> |
178 | </property> | 178 | </property> |
179 | </item> | 179 | </item> |
180 | <item> | 180 | <item> |
181 | <property> | 181 | <property> |
182 | <name>text</name> | 182 | <name>text</name> |
183 | <string>cisco</string> | ||
184 | </property> | ||
185 | </item> | ||
186 | <item> | ||
187 | <property> | ||
188 | <name>text</name> | ||
189 | <string>orinoco</string> | 183 | <string>orinoco</string> |
190 | </property> | 184 | </property> |
191 | </item> | 185 | </item> |
192 | <item> | 186 | <item> |
193 | <property> | 187 | <property> |
194 | <name>text</name> | 188 | <name>text</name> |
195 | <string>prism</string> | 189 | <string>prism</string> |
196 | </property> | 190 | </property> |
197 | </item> | 191 | </item> |
198 | <item> | 192 | <item> |
199 | <property> | 193 | <property> |
200 | <name>text</name> | 194 | <name>text</name> |
201 | <string><manual></string> | 195 | <string><manual></string> |
202 | </property> | 196 | </property> |
203 | </item> | 197 | </item> |
204 | <property stdset="1"> | 198 | <property stdset="1"> |
205 | <name>name</name> | 199 | <name>name</name> |
206 | <cstring>deviceType</cstring> | 200 | <cstring>deviceType</cstring> |
207 | </property> | 201 | </property> |
208 | <property stdset="1"> | 202 | <property stdset="1"> |
209 | <name>enabled</name> | 203 | <name>enabled</name> |
210 | <bool>true</bool> | 204 | <bool>true</bool> |
211 | </property> | 205 | </property> |
212 | </widget> | 206 | </widget> |
213 | <widget row="3" column="0" rowspan="1" colspan="2" > | 207 | <widget row="3" column="0" rowspan="1" colspan="2" > |
214 | <class>QCheckBox</class> | 208 | <class>QCheckBox</class> |
215 | <property stdset="1"> | 209 | <property stdset="1"> |
216 | <name>name</name> | 210 | <name>name</name> |
217 | <cstring>additionalInfo</cstring> | 211 | <cstring>additionalInfo</cstring> |
218 | </property> | 212 | </property> |
219 | <property stdset="1"> | 213 | <property stdset="1"> |
220 | <name>enabled</name> | 214 | <name>enabled</name> |
221 | <bool>false</bool> | 215 | <bool>false</bool> |
222 | </property> | 216 | </property> |
223 | <property stdset="1"> | 217 | <property stdset="1"> |
224 | <name>text</name> | 218 | <name>text</name> |
225 | <string>Gather Additional Info</string> | 219 | <string>Gather Additional Info</string> |
226 | </property> | 220 | </property> |
227 | </widget> | 221 | </widget> |
228 | <widget row="2" column="0" > | 222 | <widget row="2" column="0" > |
229 | <class>QSpinBox</class> | 223 | <class>QSpinBox</class> |
230 | <property stdset="1"> | 224 | <property stdset="1"> |
231 | <name>name</name> | 225 | <name>name</name> |
232 | <cstring>hopInterval</cstring> | 226 | <cstring>hopInterval</cstring> |
233 | </property> | 227 | </property> |
234 | <property stdset="1"> | 228 | <property stdset="1"> |
235 | <name>enabled</name> | 229 | <name>enabled</name> |
236 | <bool>true</bool> | 230 | <bool>true</bool> |
237 | </property> | 231 | </property> |
238 | <property stdset="1"> | 232 | <property stdset="1"> |
239 | <name>suffix</name> | 233 | <name>suffix</name> |
240 | <string> ms</string> | 234 | <string> ms</string> |
241 | </property> | 235 | </property> |
242 | <property stdset="1"> | 236 | <property stdset="1"> |
243 | <name>maxValue</name> | 237 | <name>maxValue</name> |
244 | <number>2000</number> | 238 | <number>2000</number> |
245 | </property> | 239 | </property> |
246 | <property stdset="1"> | 240 | <property stdset="1"> |
247 | <name>minValue</name> | 241 | <name>minValue</name> |
248 | <number>100</number> | 242 | <number>100</number> |
249 | </property> | 243 | </property> |
250 | <property stdset="1"> | 244 | <property stdset="1"> |
251 | <name>lineStep</name> | 245 | <name>lineStep</name> |
252 | <number>100</number> | 246 | <number>100</number> |
253 | </property> | 247 | </property> |
254 | </widget> | 248 | </widget> |
255 | <widget row="2" column="1" > | 249 | <widget row="2" column="1" > |
256 | <class>QLabel</class> | 250 | <class>QLabel</class> |
257 | <property stdset="1"> | 251 | <property stdset="1"> |
258 | <name>name</name> | 252 | <name>name</name> |
259 | <cstring>TextLabel3_3</cstring> | 253 | <cstring>TextLabel3_3</cstring> |
260 | </property> | 254 | </property> |
261 | <property stdset="1"> | 255 | <property stdset="1"> |
262 | <name>enabled</name> | 256 | <name>enabled</name> |
263 | <bool>true</bool> | 257 | <bool>true</bool> |
264 | </property> | 258 | </property> |
265 | <property stdset="1"> | 259 | <property stdset="1"> |
266 | <name>text</name> | 260 | <name>text</name> |
267 | <string>Hop Interval</string> | 261 | <string>Hop Interval</string> |
268 | </property> | 262 | </property> |
269 | </widget> | 263 | </widget> |
270 | <widget row="1" column="1" > | 264 | <widget row="1" column="1" > |
271 | <class>QLabel</class> | 265 | <class>QLabel</class> |
272 | <property stdset="1"> | 266 | <property stdset="1"> |
273 | <name>name</name> | 267 | <name>name</name> |
274 | <cstring>TextLabel2_3</cstring> | 268 | <cstring>TextLabel2_3</cstring> |
275 | </property> | 269 | </property> |
276 | <property stdset="1"> | 270 | <property stdset="1"> |
277 | <name>enabled</name> | 271 | <name>enabled</name> |
278 | <bool>true</bool> | 272 | <bool>true</bool> |
279 | </property> | 273 | </property> |
280 | <property stdset="1"> | 274 | <property stdset="1"> |
281 | <name>text</name> | 275 | <name>text</name> |
282 | <string>Device Type</string> | 276 | <string>Device Type</string> |
283 | </property> | 277 | </property> |
284 | </widget> | 278 | </widget> |
285 | <widget row="0" column="1" > | 279 | <widget row="0" column="1" > |
286 | <class>QLabel</class> | 280 | <class>QLabel</class> |
287 | <property stdset="1"> | 281 | <property stdset="1"> |
288 | <name>name</name> | 282 | <name>name</name> |
289 | <cstring>TextLabel1_2</cstring> | 283 | <cstring>TextLabel1_2</cstring> |
290 | </property> | 284 | </property> |
291 | <property stdset="1"> | 285 | <property stdset="1"> |
292 | <name>enabled</name> | 286 | <name>enabled</name> |
293 | <bool>true</bool> | 287 | <bool>true</bool> |
294 | </property> | 288 | </property> |
295 | <property stdset="1"> | 289 | <property stdset="1"> |
296 | <name>text</name> | 290 | <name>text</name> |
297 | <string>Interface Name</string> | 291 | <string>Interface Name</string> |
298 | </property> | 292 | </property> |
299 | </widget> | 293 | </widget> |
300 | </grid> | 294 | </grid> |
301 | </widget> | 295 | </widget> |
302 | <widget> | 296 | <widget> |
303 | <class>QLayoutWidget</class> | 297 | <class>QLayoutWidget</class> |
304 | <property stdset="1"> | 298 | <property stdset="1"> |
305 | <name>name</name> | 299 | <name>name</name> |
306 | <cstring>Layout6</cstring> | 300 | <cstring>Layout6</cstring> |
307 | </property> | 301 | </property> |
308 | <property> | 302 | <property> |
309 | <name>layoutSpacing</name> | 303 | <name>layoutSpacing</name> |
310 | </property> | 304 | </property> |
311 | <hbox> | 305 | <hbox> |
312 | <property stdset="1"> | 306 | <property stdset="1"> |
313 | <name>margin</name> | 307 | <name>margin</name> |
314 | <number>0</number> | 308 | <number>0</number> |
315 | </property> | 309 | </property> |
316 | <property stdset="1"> | 310 | <property stdset="1"> |
317 | <name>spacing</name> | 311 | <name>spacing</name> |
318 | <number>2</number> | 312 | <number>2</number> |
319 | </property> | 313 | </property> |
320 | <widget> | 314 | <widget> |
321 | <class>QLabel</class> | 315 | <class>QLabel</class> |
322 | <property stdset="1"> | 316 | <property stdset="1"> |
323 | <name>name</name> | 317 | <name>name</name> |
324 | <cstring>TextLabel3_2_2</cstring> | 318 | <cstring>TextLabel3_2_2</cstring> |
325 | </property> | 319 | </property> |
326 | <property stdset="1"> | 320 | <property stdset="1"> |
327 | <name>sizePolicy</name> | 321 | <name>sizePolicy</name> |
328 | <sizepolicy> | 322 | <sizepolicy> |
329 | <hsizetype>4</hsizetype> | 323 | <hsizetype>4</hsizetype> |
330 | <vsizetype>1</vsizetype> | 324 | <vsizetype>1</vsizetype> |
331 | </sizepolicy> | 325 | </sizepolicy> |
332 | </property> | 326 | </property> |
333 | <property stdset="1"> | 327 | <property stdset="1"> |
334 | <name>text</name> | 328 | <name>text</name> |
335 | <string>GUI</string> | 329 | <string>GUI</string> |
336 | </property> | 330 | </property> |
337 | </widget> | 331 | </widget> |
338 | <widget> | 332 | <widget> |
339 | <class>Line</class> | 333 | <class>Line</class> |
340 | <property stdset="1"> | 334 | <property stdset="1"> |
341 | <name>name</name> | 335 | <name>name</name> |
342 | <cstring>Line9_2</cstring> | 336 | <cstring>Line9_2</cstring> |
343 | </property> | 337 | </property> |
344 | <property stdset="1"> | 338 | <property stdset="1"> |
345 | <name>orientation</name> | 339 | <name>orientation</name> |
346 | <enum>Horizontal</enum> | 340 | <enum>Horizontal</enum> |
347 | </property> | 341 | </property> |
348 | </widget> | 342 | </widget> |
349 | </hbox> | 343 | </hbox> |
350 | </widget> | 344 | </widget> |
351 | <widget> | 345 | <widget> |
352 | <class>QLayoutWidget</class> | 346 | <class>QLayoutWidget</class> |
353 | <property stdset="1"> | 347 | <property stdset="1"> |
354 | <name>name</name> | 348 | <name>name</name> |
355 | <cstring>Layout5</cstring> | 349 | <cstring>Layout5</cstring> |
356 | </property> | 350 | </property> |
357 | <property> | 351 | <property> |
358 | <name>layoutSpacing</name> | 352 | <name>layoutSpacing</name> |
359 | </property> | 353 | </property> |
360 | <vbox> | 354 | <vbox> |
361 | <property stdset="1"> | 355 | <property stdset="1"> |
362 | <name>margin</name> | 356 | <name>margin</name> |
363 | <number>0</number> | 357 | <number>0</number> |
364 | </property> | 358 | </property> |
365 | <property stdset="1"> | 359 | <property stdset="1"> |
366 | <name>spacing</name> | 360 | <name>spacing</name> |
367 | <number>-1</number> | 361 | <number>-1</number> |
368 | </property> | 362 | </property> |
369 | <widget> | 363 | <widget> |
370 | <class>QCheckBox</class> | 364 | <class>QCheckBox</class> |
371 | <property stdset="1"> | 365 | <property stdset="1"> |
372 | <name>name</name> | 366 | <name>name</name> |
373 | <cstring>groupNetworks</cstring> | 367 | <cstring>groupNetworks</cstring> |
374 | </property> | 368 | </property> |
375 | <property stdset="1"> | 369 | <property stdset="1"> |
376 | <name>enabled</name> | 370 | <name>enabled</name> |
377 | <bool>false</bool> | 371 | <bool>false</bool> |
378 | </property> | 372 | </property> |
379 | <property stdset="1"> | 373 | <property stdset="1"> |
380 | <name>text</name> | 374 | <name>text</name> |
381 | <string>Group Detected Networks</string> | 375 | <string>Group Detected Networks</string> |
382 | </property> | 376 | </property> |
383 | </widget> | 377 | </widget> |
384 | <widget> | 378 | <widget> |
385 | <class>QCheckBox</class> | 379 | <class>QCheckBox</class> |
386 | <property stdset="1"> | 380 | <property stdset="1"> |
387 | <name>name</name> | 381 | <name>name</name> |
388 | <cstring>enableActivity</cstring> | 382 | <cstring>enableActivity</cstring> |
389 | </property> | 383 | </property> |
390 | <property stdset="1"> | 384 | <property stdset="1"> |
391 | <name>enabled</name> | 385 | <name>enabled</name> |
392 | <bool>false</bool> | 386 | <bool>false</bool> |
393 | </property> | 387 | </property> |
394 | <property stdset="1"> | 388 | <property stdset="1"> |
395 | <name>text</name> | 389 | <name>text</name> |
396 | <string>Enable Activity Display</string> | 390 | <string>Enable Activity Display</string> |
397 | </property> | 391 | </property> |
398 | </widget> | 392 | </widget> |
399 | <widget> | 393 | <widget> |
400 | <class>QCheckBox</class> | 394 | <class>QCheckBox</class> |
401 | <property stdset="1"> | 395 | <property stdset="1"> |
402 | <name>name</name> | 396 | <name>name</name> |
403 | <cstring>beepOnFound</cstring> | 397 | <cstring>beepOnFound</cstring> |
404 | </property> | 398 | </property> |
405 | <property stdset="1"> | 399 | <property stdset="1"> |
406 | <name>text</name> | 400 | <name>text</name> |
407 | <string>Beep on new network</string> | 401 | <string>Beep on new network</string> |
408 | </property> | 402 | </property> |
409 | </widget> | 403 | </widget> |
410 | </vbox> | 404 | </vbox> |
411 | </widget> | 405 | </widget> |
412 | <spacer> | 406 | <spacer> |
413 | <property> | 407 | <property> |
414 | <name>name</name> | 408 | <name>name</name> |
415 | <cstring>Spacer2</cstring> | 409 | <cstring>Spacer2</cstring> |
416 | </property> | 410 | </property> |
417 | <property stdset="1"> | 411 | <property stdset="1"> |
418 | <name>orientation</name> | 412 | <name>orientation</name> |
419 | <enum>Vertical</enum> | 413 | <enum>Vertical</enum> |
420 | </property> | 414 | </property> |
421 | <property stdset="1"> | 415 | <property stdset="1"> |
422 | <name>sizeType</name> | 416 | <name>sizeType</name> |
423 | <enum>Expanding</enum> | 417 | <enum>Expanding</enum> |
424 | </property> | 418 | </property> |
425 | <property> | 419 | <property> |
426 | <name>sizeHint</name> | 420 | <name>sizeHint</name> |
427 | <size> | 421 | <size> |
428 | <width>20</width> | 422 | <width>20</width> |
429 | <height>20</height> | 423 | <height>20</height> |
430 | </size> | 424 | </size> |
431 | </property> | 425 | </property> |
432 | </spacer> | 426 | </spacer> |
433 | </vbox> | 427 | </vbox> |
434 | </widget> | 428 | </widget> |
435 | </UI> | 429 | </UI> |
diff --git a/noncore/net/wellenreiter/gui/gui-x11.pro b/noncore/net/wellenreiter/gui/gui-x11.pro index 6b4a7bf..523bf15 100644 --- a/noncore/net/wellenreiter/gui/gui-x11.pro +++ b/noncore/net/wellenreiter/gui/gui-x11.pro | |||
@@ -1,11 +1,11 @@ | |||
1 | DESTDIR = . | 1 | DESTDIR = . |
2 | TEMPLATE = app | 2 | TEMPLATE = app |
3 | CONFIG = qt warn_on debug | 3 | CONFIG = qt warn_on debug |
4 | #CONFIG = qt warn_on release | 4 | #CONFIG = qt warn_on release |
5 | HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h configwindow.h resource.h | 5 | HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h configwindow.h resource.h wlan.h cardconfig.h |
6 | SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp resource.cpp | 6 | SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp resource.cpp wlan.cpp cardconfig.cpp |
7 | INCLUDEPATH += ../ | 7 | INCLUDEPATH += ../ |
8 | DEPENDPATH += ../ | 8 | DEPENDPATH += ../ |
9 | LIBS += -lwellenreiter | 9 | LIBS += -L. -lwellenreiter |
10 | INTERFACES = configbase.ui | 10 | INTERFACES = configbase.ui |
11 | TARGET = wellenreiter | 11 | TARGET = wellenreiter |
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index b6e884d..ce1c387 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro | |||
@@ -1,11 +1,11 @@ | |||
1 | DESTDIR = $(OPIEDIR)/bin | 1 | DESTDIR = $(OPIEDIR)/bin |
2 | TEMPLATE = app | 2 | TEMPLATE = app |
3 | CONFIG = qt warn_on debug | 3 | CONFIG = qt warn_on debug |
4 | #CONFIG = qt warn_on release | 4 | #CONFIG = qt warn_on release |
5 | HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h configwindow.h | 5 | HEADERS = wellenreiterbase.h wellenreiter.h scanlistitem.h scanlist.h logwindow.h hexwindow.h configwindow.h wlan.h cardconfig.h |
6 | SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp | 6 | SOURCES = main.cpp wellenreiterbase.cpp wellenreiter.cpp scanlistitem.cpp scanlist.cpp logwindow.cpp hexwindow.cpp configwindow.cpp wlan.cpp cardconfig.cpp |
7 | INCLUDEPATH += $(OPIEDIR)/include ../ | 7 | INCLUDEPATH += $(OPIEDIR)/include ../ |
8 | DEPENDPATH += $(OPIEDIR)/include ../ | 8 | DEPENDPATH += $(OPIEDIR)/include ../ |
9 | LIBS += -lqpe -lopie -lwellenreiter | 9 | LIBS += -lqpe -lopie -L. -lwellenreiter |
10 | INTERFACES = configbase.ui | 10 | INTERFACES = configbase.ui |
11 | TARGET = wellenreiter | 11 | TARGET = wellenreiter |
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index f907afc..6d032aa 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -1,17 +1,117 @@ | |||
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 | #include "scanlist.h" | 16 | #include "scanlist.h" |
17 | #include "scanlistitem.h" | ||
18 | |||
19 | #include <assert.h> | ||
20 | |||
21 | MScanListView::MScanListView( QWidget* parent, const char* name ) | ||
22 | :QListView( parent, name ) | ||
23 | { | ||
24 | }; | ||
25 | |||
26 | MScanListView::~MScanListView() | ||
27 | { | ||
28 | }; | ||
29 | |||
30 | void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) | ||
31 | { | ||
32 | // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...) | ||
33 | |||
34 | qDebug( "MScanList::addNewItem( %s / %s / %s [%d]", | ||
35 | (const char*) type, | ||
36 | (const char*) essid, | ||
37 | (const char*) macaddr, | ||
38 | channel ); | ||
39 | |||
40 | // search, if we already have seen this net | ||
41 | |||
42 | QString s; | ||
43 | MScanListItem* network; | ||
44 | MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); | ||
45 | |||
46 | while ( item && ( item->text( 0 ) != essid ) ) | ||
47 | { | ||
48 | qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); | ||
49 | item = static_cast<MScanListItem*> ( item->itemBelow() ); | ||
50 | } | ||
51 | if ( item ) | ||
52 | { | ||
53 | // animate the item | ||
54 | |||
55 | /* | ||
56 | |||
57 | const QPixmap* pixmap = item->pixmap( 0 ); | ||
58 | const QPixmap* nextpixmap = ani2; | ||
59 | if ( pixmap == ani1 ) | ||
60 | nextpixmap = ani2; | ||
61 | else if ( pixmap == ani2 ) | ||
62 | nextpixmap = ani3; | ||
63 | else if ( pixmap == ani3 ) | ||
64 | nextpixmap = ani4; | ||
65 | else if ( pixmap == ani4 ) | ||
66 | nextpixmap = ani1; | ||
67 | item->setPixmap( 0, *nextpixmap ); */ | ||
68 | |||
69 | //qDebug( "current pixmap %d, next %d", pixmap, nextpixmap ); | ||
70 | |||
71 | // we have already seen this net, check all childs if MAC exists | ||
72 | |||
73 | network = item; | ||
74 | |||
75 | item = static_cast<MScanListItem*> ( item->firstChild() ); | ||
76 | assert( item ); // this shouldn't fail | ||
77 | |||
78 | while ( item && ( item->text( 2 ) != macaddr ) ) | ||
79 | { | ||
80 | qDebug( "subitemtext: %s", (const char*) item->text( 2 ) ); | ||
81 | item = static_cast<MScanListItem*> ( item->itemBelow() ); | ||
82 | } | ||
83 | |||
84 | if ( item ) | ||
85 | { | ||
86 | // we have already seen this item, it's a dupe | ||
87 | qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); | ||
88 | return; | ||
89 | } | ||
90 | } | ||
91 | else | ||
92 | { | ||
93 | s.sprintf( "(i) new network: '%s'", (const char*) essid ); | ||
94 | |||
95 | network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 ); | ||
96 | } | ||
97 | |||
98 | |||
99 | // insert new station as child from network | ||
100 | |||
101 | // no essid to reduce clutter, maybe later we have a nick or stationname to display!? | ||
102 | |||
103 | qDebug( "inserting new station %s", (const char*) macaddr ); | ||
104 | |||
105 | new MScanListItem( network, type, "", macaddr, wep, channel, signal ); | ||
106 | |||
107 | if ( type == "managed" ) | ||
108 | { | ||
109 | s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel ); | ||
110 | } | ||
111 | else | ||
112 | { | ||
113 | s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel ); | ||
114 | } | ||
115 | |||
116 | } | ||
17 | 117 | ||
diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h index 5cf3053..6fe6930 100644 --- a/noncore/net/wellenreiter/gui/scanlist.h +++ b/noncore/net/wellenreiter/gui/scanlist.h | |||
@@ -1,28 +1,37 @@ | |||
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 SCANLIST_H | 16 | #ifndef SCANLIST_H |
17 | #define SCANLIST_H | 17 | #define SCANLIST_H |
18 | 18 | ||
19 | #include <qlistview.h> | 19 | #include <qlistview.h> |
20 | 20 | ||
21 | class QString; | 21 | class QString; |
22 | 22 | ||
23 | class MScanList: public QListView | 23 | class MScanListView: public QListView |
24 | { | 24 | { |
25 | Q_OBJECT | ||
26 | |||
27 | public: | ||
28 | MScanListView( QWidget* parent = 0, const char* name = 0 ); | ||
29 | virtual ~MScanListView(); | ||
30 | |||
31 | public slots: | ||
32 | void addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); | ||
33 | |||
25 | }; | 34 | }; |
26 | 35 | ||
27 | #endif | 36 | #endif |
28 | 37 | ||
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp index 1e2a52e..f4b43a6 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.cpp +++ b/noncore/net/wellenreiter/gui/scanlistitem.cpp | |||
@@ -1,78 +1,79 @@ | |||
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 | #include "scanlistitem.h" | 16 | #include "scanlistitem.h" |
17 | #include <assert.h> | 17 | #include <assert.h> |
18 | #include <qpixmap.h> | 18 | #include <qpixmap.h> |
19 | 19 | ||
20 | #ifdef QWS | 20 | #ifdef QWS |
21 | #include <qpe/resource.h> | 21 | #include <qpe/resource.h> |
22 | #else | 22 | #else |
23 | #include "resource.h" | 23 | #include "resource.h" |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | const int col_type = 0; | 26 | const int col_type = 0; |
27 | const int col_essid = 0; | 27 | const int col_essid = 0; |
28 | const int col_sig = 1; | 28 | const int col_sig = 1; |
29 | const int col_ap = 2; | 29 | const int col_ap = 2; |
30 | const int col_channel = 3; | 30 | const int col_channel = 3; |
31 | const int col_wep = 4; | 31 | const int col_wep = 4; |
32 | const int col_traffic = 5; | 32 | const int col_traffic = 5; |
33 | 33 | ||
34 | MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, | 34 | MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, |
35 | bool wep, int channel, int signal ) | 35 | bool wep, int channel, int signal ) |
36 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) | 36 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) |
37 | { | 37 | { |
38 | qDebug( "creating scanlist item" ); | 38 | qDebug( "creating scanlist item" ); |
39 | decorateItem( type, essid, macaddr, wep, channel, signal ); | 39 | decorateItem( type, essid, macaddr, wep, channel, signal ); |
40 | } | 40 | } |
41 | 41 | ||
42 | MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, | 42 | MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, |
43 | bool wep, int channel, int signal ) | 43 | bool wep, int channel, int signal ) |
44 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) | 44 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) |
45 | { | 45 | { |
46 | qDebug( "creating scanlist item" ); | 46 | qDebug( "creating scanlist item" ); |
47 | decorateItem( type, essid, macaddr, wep, channel, signal ); | 47 | decorateItem( type, essid, macaddr, wep, channel, signal ); |
48 | } | 48 | } |
49 | 49 | ||
50 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) | 50 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) |
51 | { | 51 | { |
52 | qDebug( "decorating scanlist item %s / %s / %s [%d]", | 52 | qDebug( "decorating scanlist item %s / %s / %s [%d]", |
53 | (const char*) type, | 53 | (const char*) type, |
54 | (const char*) essid, | 54 | (const char*) essid, |
55 | (const char*) macaddr, | 55 | (const char*) macaddr, |
56 | channel ); | 56 | channel ); |
57 | 57 | ||
58 | // set icon for managed or adhoc mode | 58 | // set icon for managed or adhoc mode |
59 | QString name; | 59 | QString name; |
60 | name.sprintf( "wellenreiter/%s", (const char*) type ); | 60 | name.sprintf( "wellenreiter/%s", (const char*) type ); |
61 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 61 | setPixmap( col_type, Resource::loadPixmap( name ) ); |
62 | 62 | ||
63 | // set icon for wep (wireless encryption protocol) | 63 | // set icon for wep (wireless encryption protocol) |
64 | if ( wep ) | 64 | if ( wep ) |
65 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); // rename the pixmap! | 65 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); // rename the pixmap! |
66 | 66 | ||
67 | // set channel and signal text | 67 | // set channel and signal text |
68 | 68 | ||
69 | if ( signal != -1 ) | 69 | if ( signal != -1 ) |
70 | setText( col_sig, QString::number( signal ) ); | 70 | setText( col_sig, QString::number( signal ) ); |
71 | if ( channel != -1 ) | 71 | if ( channel != -1 ) |
72 | setText( col_channel, QString::number( channel ) ); | 72 | setText( col_channel, QString::number( channel ) ); |
73 | 73 | ||
74 | listView()->triggerUpdate(); | 74 | listView()->triggerUpdate(); |
75 | 75 | ||
76 | this->type = type; | 76 | this->type = type; |
77 | 77 | ||
78 | } | 78 | } |
79 | |||
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 0fd929f..2d9bbee 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -1,335 +1,268 @@ | |||
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 | // Qt | 16 | // Qt |
17 | 17 | ||
18 | #include <qpushbutton.h> | 18 | #include <qpushbutton.h> |
19 | #include <qmessagebox.h> | 19 | #include <qmessagebox.h> |
20 | #include <qcombobox.h> | 20 | #include <qcombobox.h> |
21 | #include <qspinbox.h> | 21 | #include <qspinbox.h> |
22 | #include <qsocketnotifier.h> | ||
22 | 23 | ||
23 | // Qtopia | 24 | // Qtopia |
24 | 25 | ||
25 | #ifdef QWS | 26 | #ifdef QWS |
26 | #include <qpe/global.h> | 27 | #include <qpe/global.h> |
27 | #endif | 28 | #endif |
28 | 29 | ||
30 | // Opie | ||
31 | |||
32 | #ifdef QWS | ||
33 | #include <opie/odevice.h> | ||
34 | using namespace Opie; | ||
35 | #endif | ||
36 | |||
29 | // Standard | 37 | // Standard |
30 | 38 | ||
31 | #include <assert.h> | 39 | #include <assert.h> |
32 | #include <errno.h> | 40 | #include <errno.h> |
33 | #include <unistd.h> | 41 | #include <unistd.h> |
34 | #include <string.h> | 42 | #include <string.h> |
35 | #include <sys/types.h> | 43 | #include <sys/types.h> |
44 | #include <sys/socket.h> | ||
36 | #include <stdlib.h> | 45 | #include <stdlib.h> |
46 | #include <fcntl.h> | ||
37 | 47 | ||
38 | // Local | 48 | // Local |
39 | 49 | ||
40 | #include "wellenreiter.h" | 50 | #include "wellenreiter.h" |
41 | #include "scanlistitem.h" | 51 | #include "scanlist.h" |
42 | #include "logwindow.h" | 52 | #include "logwindow.h" |
43 | #include "hexwindow.h" | 53 | #include "hexwindow.h" |
44 | #include "configwindow.h" | 54 | #include "configwindow.h" |
45 | 55 | ||
46 | #include <libwellenreiter/source/wl_sock.hh> | 56 | #include <libwellenreiter/source/wl_sock.hh> |
47 | #include <libwellenreiter/source/wl_proto.hh> | 57 | #include <libwellenreiter/source/wl_proto.hh> |
48 | #include <daemon/source/config.hh> | 58 | #include <daemon/source/config.hh> |
49 | 59 | ||
50 | Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | 60 | Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) |
51 | : WellenreiterBase( parent, name, fl ), daemonRunning( false ) | 61 | : WellenreiterBase( parent, name, fl ), daemonRunning( false ) |
52 | { | 62 | { |
53 | 63 | ||
54 | logwindow->log( "(i) Wellenreiter has been started." ); | 64 | logwindow->log( "(i) Wellenreiter has been started." ); |
55 | 65 | ||
56 | connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); | ||
57 | netview->setColumnWidthMode( 1, QListView::Manual ); | ||
58 | |||
59 | // | 66 | // |
60 | // setup socket for daemon communication and start poller | 67 | // detect operating system |
68 | // | ||
69 | |||
70 | #ifdef QWS | ||
71 | QString sys; | ||
72 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); | ||
73 | _system = ODevice::inst()->system(); | ||
74 | logwindow->log( sys ); | ||
75 | #endif | ||
76 | |||
77 | // | ||
78 | // setup socket for daemon communication, register socket notifier | ||
61 | // | 79 | // |
62 | 80 | ||
63 | daemon_fd = wl_setupsock( GUIADDR, GUIPORT ); | 81 | daemon_fd = wl_setupsock( GUIADDR, GUIPORT ); |
64 | if ( daemon_fd == -1 ) | 82 | if ( daemon_fd == -1 ) |
65 | { | 83 | { |
66 | logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); | 84 | logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); |
67 | qDebug( "D'oh! Could not get file descriptor for daemon-->gui communication socket." ); | ||
68 | } | 85 | } |
69 | else | 86 | else |
70 | startTimer( 700 ); | 87 | { |
88 | int flags; | ||
89 | flags = fcntl( daemon_fd, F_GETFL, 0 ); | ||
90 | fcntl( daemon_fd, F_SETFL, flags | O_NONBLOCK ); | ||
91 | QSocketNotifier *sn = new QSocketNotifier( daemon_fd, QSocketNotifier::Read, parent ); | ||
92 | connect( sn, SIGNAL( activated( int ) ), this, SLOT( dataReceived() ) ); | ||
93 | } | ||
71 | 94 | ||
95 | // setup GUI | ||
96 | |||
97 | connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); | ||
98 | button->setEnabled( false ); | ||
99 | netview->setColumnWidthMode( 1, QListView::Manual ); | ||
100 | |||
72 | } | 101 | } |
73 | 102 | ||
74 | Wellenreiter::~Wellenreiter() | 103 | Wellenreiter::~Wellenreiter() |
75 | { | 104 | { |
76 | // no need to delete child widgets, Qt does it all for us | 105 | // no need to delete child widgets, Qt does it all for us |
77 | } | 106 | } |
78 | 107 | ||
79 | void Wellenreiter::handleMessage() | 108 | void Wellenreiter::handleMessage() |
80 | { | 109 | { |
81 | // FIXME: receive message and handle it | 110 | // FIXME: receive message and handle it |
82 | 111 | ||
83 | qDebug( "received message from daemon." ); | 112 | qDebug( "received message from daemon." ); |
84 | 113 | ||
85 | char buffer[128]; | 114 | char buffer[10000]; |
86 | 115 | memset( &buffer, 0, sizeof( buffer ) ); | |
87 | int result = wl_recv( &daemon_fd, (char*) &buffer, sizeof(buffer) ); | ||
88 | qDebug( "received %d from recvcomm", result ); | ||
89 | 116 | ||
117 | // int result = #wl_recv( &daemon_fd, (char*) &buffer, sizeof(buffer) ); | ||
118 | |||
119 | struct sockaddr from; | ||
120 | socklen_t len; | ||
121 | |||
122 | int result = recvfrom( daemon_fd, &buffer, 8192, MSG_WAITALL, &from, &len ); | ||
123 | |||
124 | qDebug( "received %d from recv [%d bytes]", result, len ); | ||
125 | |||
126 | if ( result == -1 ) | ||
127 | { | ||
128 | qDebug( "Warning: %s", strerror( errno ) ); | ||
129 | return; | ||
130 | } | ||
131 | |||
132 | int command = buffer[1] - 48; | ||
133 | |||
90 | /* | 134 | /* |
91 | typedef struct { | 135 | typedef struct { |
92 | int net_type; 1 = Accesspoint ; 2 = Ad-Hoc | 136 | int net_type; 1 = Accesspoint ; 2 = Ad-Hoc |
93 | int ssid_len; Length of SSID | 137 | int ssid_len; Length of SSID |
94 | int channel; Channel | 138 | int channel; Channel |
95 | int wep; 1 = WEP enabled ; 0 = disabled | 139 | int wep; 1 = WEP enabled ; 0 = disabled |
96 | char mac[64]; MAC address of Accesspoint | 140 | char mac[64]; MAC address of Accesspoint |
97 | char bssid[128]; BSSID of Accesspoint | 141 | char bssid[128]; BSSID of Accesspoint |
98 | } wl_network_t; | 142 | } wl_network_t; |
99 | */ | 143 | */ |
100 | 144 | ||
101 | // qDebug( "Sniffer sent: '%s'", (const char*) buffer ); | 145 | qDebug( "Recv result: %d", ( result ) ); |
146 | qDebug( "Sniffer sent: '%s'", (const char*) buffer ); | ||
102 | hexwindow->log( (const char*) &buffer ); | 147 | hexwindow->log( (const char*) &buffer ); |
103 | 148 | ||
104 | if ( result == NETFOUND ) /* new network found */ | 149 | if ( command == NETFOUND ) /* new network found */ |
105 | { | 150 | { |
106 | qDebug( "Sniffer said: new network found." ); | 151 | qDebug( "Sniffer said: new network found." ); |
107 | wl_network_t n; | 152 | wl_network_t n; |
108 | get_network_found( &n, (char*) &buffer ); | 153 | get_network_found( &n, (char*) &buffer ); |
109 | 154 | ||
110 | qDebug( "Sniffer said: net_type is %d.", n.net_type ); | 155 | qDebug( "Sniffer said: net_type is %d.", n.net_type ); |
111 | qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); | 156 | qDebug( "Sniffer said: MAC is %s", (const char*) &n.mac ); |
112 | 157 | ||
113 | //n.bssid[n.ssid_len] = "\0"; | 158 | //n.bssid[n.ssid_len] = "\0"; |
114 | 159 | ||
115 | QString type; | 160 | QString type; |
116 | 161 | ||
117 | if ( n.net_type == 1 ) | 162 | if ( n.net_type == 1 ) |
118 | type = "managed"; | 163 | type = "managed"; |
119 | else | 164 | else |
120 | type = "adhoc"; | 165 | type = "adhoc"; |
121 | 166 | ||
122 | addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 ); | 167 | netview->addNewItem( type, n.bssid, QString( (const char*) &n.mac ), n.wep, n.channel, 0 ); |
123 | 168 | ||
124 | } | 169 | } |
125 | 170 | ||
126 | else | 171 | else |
127 | 172 | ||
128 | { | 173 | { |
129 | qDebug( "unknown sniffer command." ); | 174 | qDebug( "unknown sniffer command." ); |
130 | } | 175 | } |
131 | 176 | ||
132 | } | 177 | } |
133 | 178 | ||
134 | 179 | void Wellenreiter::dataReceived() | |
135 | bool Wellenreiter::hasMessage() | ||
136 | { | 180 | { |
137 | 181 | logwindow->log( "(d) Received data from daemon" ); | |
138 | // FIXME: do this in libwellenreiter, not here!!! | 182 | handleMessage(); |
139 | |||
140 | fd_set rfds; | ||
141 | FD_ZERO( &rfds ); | ||
142 | FD_SET( daemon_fd, &rfds ); | ||
143 | struct timeval tv; | ||
144 | tv.tv_sec = 0; | ||
145 | tv.tv_usec = 10; | ||
146 | int result = select( daemon_fd+1, &rfds, NULL, NULL, &tv ); | ||
147 | |||
148 | if ( result == 0 ) | ||
149 | { | ||
150 | return false; | ||
151 | } | ||
152 | else if ( result == -1 ) | ||
153 | { | ||
154 | qDebug( "selected returned: %s", strerror( errno ) ); | ||
155 | return false; | ||
156 | } | ||
157 | else | ||
158 | return true; //FD_ISSET( daemon_fd, &rfds ); gibbet 'eh nur einen Deskriptor | ||
159 | } | 183 | } |
160 | 184 | ||
161 | void Wellenreiter::timerEvent( QTimerEvent* e ) | 185 | void Wellenreiter::buttonClicked() |
162 | { | ||
163 | //qDebug( "checking for message..." ); | ||
164 | if ( hasMessage() ) | ||
165 | { | ||
166 | //qDebug( "got message from daemon" ); | ||
167 | handleMessage(); | ||
168 | } | ||
169 | else | ||
170 | { | ||
171 | //qDebug( "no message..." ); | ||
172 | } | ||
173 | } | ||
174 | |||
175 | void Wellenreiter::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) | ||
176 | { | 186 | { |
177 | // FIXME: this code belongs in customized QListView, not into this class | 187 | /* |
178 | // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...) | 188 | // add some test stations, so that we can see if the GUI part works |
179 | 189 | addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); | |
180 | qDebug( "Wellenreiter::addNewItem( %s / %s / %s [%d]", | 190 | addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 ); |
181 | (const char*) type, | 191 | addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); |
182 | (const char*) essid, | 192 | addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); |
183 | (const char*) macaddr, | 193 | addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); |
184 | channel ); | 194 | */ |
185 | |||
186 | // search, if we already have seen this net | ||
187 | |||
188 | QString s; | ||
189 | MScanListItem* network; | ||
190 | MScanListItem* item = static_cast<MScanListItem*> ( netview->firstChild() ); | ||
191 | |||
192 | while ( item && ( item->text( 0 ) != essid ) ) | ||
193 | { | ||
194 | qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); | ||
195 | item = static_cast<MScanListItem*> ( item->itemBelow() ); | ||
196 | } | ||
197 | if ( item ) | ||
198 | { | ||
199 | // we have already seen this net, check all childs if MAC exists | ||
200 | |||
201 | network = item; | ||
202 | |||
203 | item = static_cast<MScanListItem*> ( item->firstChild() ); | ||
204 | assert( item ); // this shouldn't fail | ||
205 | |||
206 | while ( item && ( item->text( 2 ) != macaddr ) ) | ||
207 | { | ||
208 | qDebug( "subitemtext: %s", (const char*) item->text( 2 ) ); | ||
209 | item = static_cast<MScanListItem*> ( item->itemBelow() ); | ||
210 | } | ||
211 | |||
212 | if ( item ) | ||
213 | { | ||
214 | // we have already seen this item, it's a dupe | ||
215 | qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); | ||
216 | return; | ||
217 | } | ||
218 | } | ||
219 | else | ||
220 | { | ||
221 | s.sprintf( "(i) new network: '%s'", (const char*) essid ); | ||
222 | logwindow->log( s ); | ||
223 | |||
224 | network = new MScanListItem( netview, "networks", essid, QString::null, 0, 0, 0 ); | ||
225 | } | ||
226 | |||
227 | |||
228 | // insert new station as child from network | ||
229 | |||
230 | // no essid to reduce clutter, maybe later we have a nick or stationname to display!? | ||
231 | |||
232 | qDebug( "inserting new station %s", (const char*) macaddr ); | ||
233 | |||
234 | new MScanListItem( network, type, "", macaddr, wep, channel, signal ); | ||
235 | |||
236 | if ( type == "managed" ) | ||
237 | { | ||
238 | s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel ); | ||
239 | } | ||
240 | else | ||
241 | { | ||
242 | s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel ); | ||
243 | } | ||
244 | |||
245 | logwindow->log( s ); | ||
246 | 195 | ||
247 | } | ||
248 | 196 | ||
249 | void Wellenreiter::buttonClicked() | ||
250 | { | ||
251 | if ( daemonRunning ) | 197 | if ( daemonRunning ) |
252 | { | 198 | { |
199 | daemonRunning = false; | ||
200 | |||
253 | logwindow->log( "(i) Daemon has been stopped." ); | 201 | logwindow->log( "(i) Daemon has been stopped." ); |
254 | button->setText( "Start Scanning" ); | 202 | button->setText( "Start Scanning" ); |
255 | 203 | ||
256 | // Stop daemon - ugly for now... later better | 204 | // Stop daemon - ugly for now... later better |
257 | 205 | ||
258 | system( "killall orinoco_hopper" ); | 206 | system( "killall orinoco_hopper" ); |
259 | system( "killall wellenreiterd" ); | 207 | system( "killall wellenreiterd" ); |
260 | 208 | ||
261 | // FIXME: reset the card trying to get into a usable state again | 209 | // FIXME: reset the card trying to get into a usable state again |
262 | 210 | ||
263 | // for now, just message the user | 211 | // for now, just message the user |
264 | 212 | ||
265 | QMessageBox::information( this, "Wellenreiter/Opie", "You should reset your\ndevice before using it again." ); | 213 | QMessageBox::information( this, "Wellenreiter/Opie", "You should reset your\ndevice before using it again." ); |
266 | } | 214 | } |
267 | 215 | ||
268 | else | 216 | else |
269 | { | 217 | { |
270 | 218 | ||
271 | logwindow->log( "(i) Daemon has been started." ); | 219 | logwindow->log( "(i) Daemon has been started." ); |
272 | daemonRunning = true; | 220 | daemonRunning = true; |
273 | button->setText( "Stop Scanning" ); | 221 | button->setText( "Stop Scanning" ); |
274 | 222 | ||
275 | // get configuration from config window | 223 | // get configuration from config window |
276 | 224 | ||
277 | const QString& interface = configwindow->interfaceName->currentText(); | 225 | const QString& interface = configwindow->interfaceName->currentText(); |
278 | const QString& cardtype = configwindow->deviceType->currentText(); | 226 | const QString& cardtype = configwindow->deviceType->currentText(); |
279 | const QString& interval = configwindow->hopInterval->cleanText(); | 227 | const QString& interval = configwindow->hopInterval->cleanText(); |
280 | 228 | ||
281 | if ( ( interface == "<select>" ) || ( cardtype == "<select>" ) ) | 229 | if ( ( interface == "<select>" ) || ( cardtype == "<select>" ) ) |
282 | { | 230 | { |
283 | QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); | 231 | QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); |
284 | return; | 232 | return; |
285 | } | 233 | } |
286 | 234 | ||
287 | // set interface into monitor mode | 235 | // set interface into monitor mode |
288 | /* Global::Execute definitely does not work very well with non-gui stuff! :( */ | 236 | /* Global::Execute definitely does not work very well with non-gui stuff! :( */ |
289 | 237 | ||
290 | QString cmdline; | 238 | QString cmdline; |
291 | 239 | ||
292 | cmdline.sprintf( "iwpriv %s monitor 2", (const char*) interface ); | 240 | cmdline.sprintf( "iwpriv %s monitor 2", (const char*) interface ); |
293 | system( cmdline ); | 241 | system( cmdline ); |
294 | cmdline.sprintf( "iwpriv %s monitor 2 1", (const char*) interface ); | 242 | cmdline.sprintf( "iwpriv %s monitor 2 1", (const char*) interface ); |
295 | system( cmdline ); | 243 | system( cmdline ); |
296 | 244 | ||
297 | // start channel hopper | 245 | // start channel hopper |
298 | 246 | ||
299 | cmdline = "orinoco_hopper "; | 247 | cmdline = "orinoco_hopper "; |
300 | cmdline += interface; | 248 | cmdline += interface; |
301 | cmdline += " -i "; | 249 | cmdline += " -i "; |
302 | cmdline += interval; | 250 | cmdline += interval; |
303 | cmdline += " &"; | 251 | cmdline += " &"; |
304 | qDebug( "execute: %s", (const char*) cmdline ); | 252 | qDebug( "execute: %s", (const char*) cmdline ); |
305 | system( cmdline ); | 253 | system( cmdline ); |
306 | qDebug( "done" ); | 254 | qDebug( "done" ); |
307 | 255 | ||
308 | // start daemon | 256 | // start daemon |
309 | 257 | ||
310 | cmdline = "wellenreiterd "; | 258 | cmdline = "wellenreiterd "; |
311 | cmdline += interface; | 259 | cmdline += interface; |
312 | cmdline += " 3"; | 260 | cmdline += " 3"; |
313 | cmdline += " &"; | 261 | cmdline += " &"; |
314 | 262 | ||
315 | qDebug( "execute: %s", (const char*) cmdline ); | 263 | qDebug( "execute: %s", (const char*) cmdline ); |
316 | system( cmdline ); | 264 | system( cmdline ); |
317 | qDebug( "done" ); | 265 | qDebug( "done" ); |
318 | 266 | ||
319 | /* | ||
320 | |||
321 | // add some test stations, so that we can see if the GUI part works | ||
322 | |||
323 | addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); | ||
324 | addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 ); | ||
325 | addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); | ||
326 | addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); | ||
327 | addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); | ||
328 | |||
329 | QString command ("98"); | ||
330 | |||
331 | //sendcomm( DAEMONADDR, DAEMONPORT, (const char*) command ); | ||
332 | |||
333 | */ | ||
334 | } | 267 | } |
335 | } | 268 | } |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 052a242..2296892 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h | |||
@@ -1,50 +1,56 @@ | |||
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 WELLENREITER_H | 16 | #ifndef WELLENREITER_H |
17 | #define WELLENREITER_H | 17 | #define WELLENREITER_H |
18 | 18 | ||
19 | #include "wellenreiterbase.h" | 19 | #include "wellenreiterbase.h" |
20 | 20 | ||
21 | #ifdef QWS | ||
22 | #include <opie/odevice.h> | ||
23 | using namespace Opie; | ||
24 | #endif | ||
25 | |||
21 | class QTimerEvent; | 26 | class QTimerEvent; |
27 | class QPixmap; | ||
22 | 28 | ||
23 | class Wellenreiter : public WellenreiterBase { | 29 | class Wellenreiter : public WellenreiterBase { |
24 | Q_OBJECT | 30 | Q_OBJECT |
25 | 31 | ||
26 | public: | 32 | public: |
27 | 33 | ||
28 | Wellenreiter( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 34 | Wellenreiter( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
29 | ~Wellenreiter(); | 35 | ~Wellenreiter(); |
30 | 36 | ||
31 | protected: | 37 | protected: |
32 | virtual void timerEvent( QTimerEvent* ); | ||
33 | 38 | ||
34 | bool daemonRunning; | 39 | bool daemonRunning; |
35 | 40 | ||
36 | public slots: | 41 | public slots: |
37 | void buttonClicked(); | 42 | void buttonClicked(); |
38 | void addNewItem( QString type, QString essid, QString ap, bool wep, int channel, int signal ); | 43 | void dataReceived(); |
39 | 44 | ||
40 | private: | 45 | private: |
41 | int daemon_fd; // socket filedescriptor for udp communication socket | 46 | int daemon_fd; // socket filedescriptor for udp communication socket |
42 | 47 | #ifdef QWS | |
43 | bool hasMessage(); | 48 | OSystem _system; // Opie Operating System identifier |
49 | #endif | ||
44 | void handleMessage(); | 50 | void handleMessage(); |
45 | 51 | ||
46 | //void readConfig(); | 52 | //void readConfig(); |
47 | //void writeConfig(); | 53 | //void writeConfig(); |
48 | }; | 54 | }; |
49 | 55 | ||
50 | #endif | 56 | #endif |
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index 5017b08..d6b9891 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |||
@@ -1,191 +1,197 @@ | |||
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 | #include "wellenreiterbase.h" | 16 | #include "wellenreiterbase.h" |
17 | 17 | ||
18 | #include <qheader.h> | 18 | #include <qheader.h> |
19 | #include <qlabel.h> | 19 | #include <qlabel.h> |
20 | #include <qlistview.h> | 20 | #include <qlistview.h> |
21 | #include <qmultilineedit.h> | 21 | #include <qmultilineedit.h> |
22 | #include <qpushbutton.h> | 22 | #include <qpushbutton.h> |
23 | #include <qlayout.h> | 23 | #include <qlayout.h> |
24 | #include <qvariant.h> | 24 | #include <qvariant.h> |
25 | #include <qtooltip.h> | 25 | #include <qtooltip.h> |
26 | #include <qwhatsthis.h> | 26 | #include <qwhatsthis.h> |
27 | #include <qimage.h> | 27 | #include <qimage.h> |
28 | #include <qpixmap.h> | 28 | #include <qpixmap.h> |
29 | 29 | ||
30 | #include "logwindow.h" | 30 | #include "logwindow.h" |
31 | #include "hexwindow.h" | 31 | #include "hexwindow.h" |
32 | #include "configwindow.h" | 32 | #include "configwindow.h" |
33 | #include "scanlist.h" | ||
33 | 34 | ||
34 | #ifdef QWS | 35 | #ifdef QWS |
35 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
36 | #include <opie/otabwidget.h> | 37 | #include <opie/otabwidget.h> |
37 | #else | 38 | #else |
38 | #include "resource.h" | 39 | #include "resource.h" |
39 | #include <qtabwidget.h> | 40 | #include <qtabwidget.h> |
40 | #endif | 41 | #endif |
41 | 42 | ||
42 | 43 | ||
43 | /* | 44 | /* |
44 | * Constructs a WellenreiterBase which is a child of 'parent', with the | 45 | * Constructs a WellenreiterBase which is a child of 'parent', with the |
45 | * name 'name' and widget flags set to 'f' | 46 | * name 'name' and widget flags set to 'f' |
46 | */ | 47 | */ |
47 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) | 48 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) |
48 | : QWidget( parent, name, fl ) | 49 | : QWidget( parent, name, fl ) |
49 | { | 50 | { |
51 | ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); | ||
52 | ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); | ||
53 | ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); | ||
54 | ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); | ||
55 | |||
50 | if ( !name ) | 56 | if ( !name ) |
51 | setName( "WellenreiterBase" ); | 57 | setName( "WellenreiterBase" ); |
52 | resize( 191, 294 ); | 58 | resize( 191, 294 ); |
53 | setCaption( tr( "Wellenreiter" ) ); | 59 | setCaption( tr( "Wellenreiter" ) ); |
54 | WellenreiterBaseLayout = new QVBoxLayout( this ); | 60 | WellenreiterBaseLayout = new QVBoxLayout( this ); |
55 | WellenreiterBaseLayout->setSpacing( 2 ); | 61 | WellenreiterBaseLayout->setSpacing( 2 ); |
56 | WellenreiterBaseLayout->setMargin( 0 ); | 62 | WellenreiterBaseLayout->setMargin( 0 ); |
57 | #ifdef QWS | 63 | #ifdef QWS |
58 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); | 64 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); |
59 | #else | 65 | #else |
60 | TabWidget = new QTabWidget( this, "TabWidget" ); | 66 | TabWidget = new QTabWidget( this, "TabWidget" ); |
61 | #endif | 67 | #endif |
62 | ap = new QWidget( TabWidget, "ap" ); | 68 | ap = new QWidget( TabWidget, "ap" ); |
63 | apLayout = new QVBoxLayout( ap ); | 69 | apLayout = new QVBoxLayout( ap ); |
64 | apLayout->setSpacing( 2 ); | 70 | apLayout->setSpacing( 2 ); |
65 | apLayout->setMargin( 2 ); | 71 | apLayout->setMargin( 2 ); |
66 | 72 | ||
67 | //--------- NETVIEW TAB -------------- | 73 | //--------- NETVIEW TAB -------------- |
68 | 74 | ||
69 | netview = new QListView( ap, "netview" ); | 75 | netview = new MScanListView( ap ); |
70 | netview->addColumn( tr( "SSID" ) ); | 76 | netview->addColumn( tr( "SSID" ) ); |
71 | netview->setColumnAlignment( 0, AlignLeft || AlignVCenter ); | 77 | netview->setColumnAlignment( 0, AlignLeft || AlignVCenter ); |
72 | netview->addColumn( tr( "Sig" ) ); | 78 | netview->addColumn( tr( "Sig" ) ); |
73 | netview->setColumnAlignment( 1, AlignCenter ); | 79 | netview->setColumnAlignment( 1, AlignCenter ); |
74 | netview->addColumn( tr( "AP" ) ); | 80 | netview->addColumn( tr( "AP" ) ); |
75 | netview->setColumnAlignment( 2, AlignCenter ); | 81 | netview->setColumnAlignment( 2, AlignCenter ); |
76 | netview->addColumn( tr( "Chn" ) ); | 82 | netview->addColumn( tr( "Chn" ) ); |
77 | netview->setColumnAlignment( 3, AlignCenter ); | 83 | netview->setColumnAlignment( 3, AlignCenter ); |
78 | netview->addColumn( tr( "W" ) ); | 84 | netview->addColumn( tr( "W" ) ); |
79 | netview->setColumnAlignment( 4, AlignCenter ); | 85 | netview->setColumnAlignment( 4, AlignCenter ); |
80 | netview->addColumn( tr( "T" ) ); | 86 | netview->addColumn( tr( "T" ) ); |
81 | netview->setColumnAlignment( 5, AlignCenter ); | 87 | netview->setColumnAlignment( 5, AlignCenter ); |
82 | 88 | ||
83 | netview->setFrameShape( QListView::StyledPanel ); | 89 | netview->setFrameShape( QListView::StyledPanel ); |
84 | netview->setFrameShadow( QListView::Sunken ); | 90 | netview->setFrameShadow( QListView::Sunken ); |
85 | netview->setRootIsDecorated( TRUE ); | 91 | netview->setRootIsDecorated( TRUE ); |
86 | apLayout->addWidget( netview ); | 92 | apLayout->addWidget( netview ); |
87 | 93 | ||
88 | 94 | ||
89 | //--------- LOG TAB -------------- | 95 | //--------- LOG TAB -------------- |
90 | 96 | ||
91 | logwindow = new MLogWindow( TabWidget, "Log" ); | 97 | logwindow = new MLogWindow( TabWidget, "Log" ); |
92 | 98 | ||
93 | 99 | ||
94 | //--------- HEX TAB -------------- | 100 | //--------- HEX TAB -------------- |
95 | 101 | ||
96 | hexwindow = new MHexWindow( TabWidget, "Hex" ); | 102 | hexwindow = new MHexWindow( TabWidget, "Hex" ); |
97 | 103 | ||
98 | //--------- CONFIG TAB -------------- | 104 | //--------- CONFIG TAB -------------- |
99 | 105 | ||
100 | configwindow = new WellenreiterConfigWindow( TabWidget, "Config" ); | 106 | configwindow = new WellenreiterConfigWindow( TabWidget, "Config" ); |
101 | 107 | ||
102 | //--------- ABOUT TAB -------------- | 108 | //--------- ABOUT TAB -------------- |
103 | 109 | ||
104 | about = new QWidget( TabWidget, "about" ); | 110 | about = new QWidget( TabWidget, "about" ); |
105 | aboutLayout = new QGridLayout( about ); | 111 | aboutLayout = new QGridLayout( about ); |
106 | aboutLayout->setSpacing( 6 ); | 112 | aboutLayout->setSpacing( 6 ); |
107 | aboutLayout->setMargin( 11 ); | 113 | aboutLayout->setMargin( 11 ); |
108 | 114 | ||
109 | PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); | 115 | PixmapLabel1_3_2 = new QLabel( about, "PixmapLabel1_3_2" ); |
110 | PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); | 116 | PixmapLabel1_3_2->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, PixmapLabel1_3_2->sizePolicy().hasHeightForWidth() ) ); |
111 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); | 117 | PixmapLabel1_3_2->setFrameShape( QLabel::Panel ); |
112 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); | 118 | PixmapLabel1_3_2->setFrameShadow( QLabel::Sunken ); |
113 | PixmapLabel1_3_2->setLineWidth( 2 ); | 119 | PixmapLabel1_3_2->setLineWidth( 2 ); |
114 | PixmapLabel1_3_2->setMargin( 0 ); | 120 | PixmapLabel1_3_2->setMargin( 0 ); |
115 | PixmapLabel1_3_2->setMidLineWidth( 0 ); | 121 | PixmapLabel1_3_2->setMidLineWidth( 0 ); |
116 | PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); | 122 | PixmapLabel1_3_2->setPixmap( Resource::loadPixmap( "wellenreiter/logo" ) ); |
117 | PixmapLabel1_3_2->setScaledContents( TRUE ); | 123 | PixmapLabel1_3_2->setScaledContents( TRUE ); |
118 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); | 124 | PixmapLabel1_3_2->setAlignment( int( QLabel::AlignCenter ) ); |
119 | 125 | ||
120 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); | 126 | aboutLayout->addWidget( PixmapLabel1_3_2, 0, 0 ); |
121 | 127 | ||
122 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); | 128 | TextLabel1_4_2 = new QLabel( about, "TextLabel1_4_2" ); |
123 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 129 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
124 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 130 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
125 | TextLabel1_4_2_font.setPointSize( 10 ); | 131 | TextLabel1_4_2_font.setPointSize( 10 ); |
126 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 132 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
127 | TextLabel1_4_2->setText( tr( "<p align=center>\n" | 133 | TextLabel1_4_2->setText( tr( "<p align=center>\n" |
128 | "<hr>\n" | 134 | "<hr>\n" |
129 | "Max Moser<br>\n" | 135 | "Max Moser<br>\n" |
130 | "Martin J. Muench<br>\n" | 136 | "Martin J. Muench<br>\n" |
131 | "Michael Lauer<br><hr>\n" | 137 | "Michael Lauer<br><hr>\n" |
132 | "<b>www.remote-exploit.org</b>\n" | 138 | "<b>www.remote-exploit.org</b>\n" |
133 | "</p>" ) ); | 139 | "</p>" ) ); |
134 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); | 140 | TextLabel1_4_2->setAlignment( int( QLabel::AlignCenter ) ); |
135 | 141 | ||
136 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); | 142 | aboutLayout->addWidget( TextLabel1_4_2, 1, 0 ); |
137 | 143 | ||
138 | button = new QPushButton( this, "button" ); | 144 | button = new QPushButton( this, "button" ); |
139 | button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, button->sizePolicy().hasHeightForWidth() ) ); | 145 | button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, button->sizePolicy().hasHeightForWidth() ) ); |
140 | button->setText( tr( "Start Scanning" ) ); | 146 | button->setText( tr( "Start Scanning" ) ); |
141 | 147 | ||
142 | #ifdef QWS | 148 | #ifdef QWS |
143 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Networks" ) ); | 149 | TabWidget->addTab( ap, "wellenreiter/networks", tr( "Networks" ) ); |
144 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); | 150 | TabWidget->addTab( logwindow, "wellenreiter/log", tr( "Log" ) ); |
145 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); | 151 | TabWidget->addTab( hexwindow, "wellenreiter/hex", tr( "Hex" ) ); |
146 | TabWidget->addTab( configwindow, "wellenreiter/config", tr( "Config" ) ); | 152 | TabWidget->addTab( configwindow, "wellenreiter/config", tr( "Config" ) ); |
147 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); | 153 | TabWidget->addTab( about, "wellenreiter/about", tr( "About" ) ); |
148 | #else | 154 | #else |
149 | TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); | 155 | TabWidget->addTab( ap, /* "wellenreiter/networks", */ tr( "Networks" ) ); |
150 | TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); | 156 | TabWidget->addTab( logwindow, /* "wellenreiter/log", */ tr( "Log" ) ); |
151 | TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); | 157 | TabWidget->addTab( hexwindow, /* "wellenreiter/hex", */ tr( "Hex" ) ); |
152 | TabWidget->addTab( configwindow, /* "wellenreiter/config", */ tr( "Config" ) ); | 158 | TabWidget->addTab( configwindow, /* "wellenreiter/config", */ tr( "Config" ) ); |
153 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); | 159 | TabWidget->addTab( about, /* "wellenreiter/about", */ tr( "About" ) ); |
154 | #endif | 160 | #endif |
155 | WellenreiterBaseLayout->addWidget( TabWidget ); | 161 | WellenreiterBaseLayout->addWidget( TabWidget ); |
156 | WellenreiterBaseLayout->addWidget( button ); | 162 | WellenreiterBaseLayout->addWidget( button ); |
157 | 163 | ||
158 | #ifdef QWS | 164 | #ifdef QWS |
159 | TabWidget->setCurrentTab( tr( "Networks" ) ); | 165 | TabWidget->setCurrentTab( tr( "Networks" ) ); |
160 | #endif | 166 | #endif |
161 | 167 | ||
162 | } | 168 | } |
163 | 169 | ||
164 | /* | 170 | /* |
165 | * Destroys the object and frees any allocated resources | 171 | * Destroys the object and frees any allocated resources |
166 | */ | 172 | */ |
167 | WellenreiterBase::~WellenreiterBase() | 173 | WellenreiterBase::~WellenreiterBase() |
168 | { | 174 | { |
169 | // no need to delete child widgets, Qt does it all for us | 175 | // no need to delete child widgets, Qt does it all for us |
170 | } | 176 | } |
171 | 177 | ||
172 | /* | 178 | /* |
173 | * Main event handler. Reimplemented to handle application | 179 | * Main event handler. Reimplemented to handle application |
174 | * font changes | 180 | * font changes |
175 | */ | 181 | */ |
176 | bool WellenreiterBase::event( QEvent* ev ) | 182 | bool WellenreiterBase::event( QEvent* ev ) |
177 | { | 183 | { |
178 | bool ret = QWidget::event( ev ); | 184 | bool ret = QWidget::event( ev ); |
179 | if ( ev->type() == QEvent::ApplicationFontChange ) { | 185 | if ( ev->type() == QEvent::ApplicationFontChange ) { |
180 | //QFont Log_2_font( Log_2->font() ); | 186 | //QFont Log_2_font( Log_2->font() ); |
181 | //Log_2_font.setFamily( "adobe-courier" ); | 187 | //Log_2_font.setFamily( "adobe-courier" ); |
182 | //Log_2_font.setPointSize( 8 ); | 188 | //Log_2_font.setPointSize( 8 ); |
183 | //Log_2->setFont( Log_2_font ); | 189 | //Log_2->setFont( Log_2_font ); |
184 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); | 190 | QFont TextLabel1_4_2_font( TextLabel1_4_2->font() ); |
185 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); | 191 | TextLabel1_4_2_font.setFamily( "adobe-helvetica" ); |
186 | TextLabel1_4_2_font.setPointSize( 10 ); | 192 | TextLabel1_4_2_font.setPointSize( 10 ); |
187 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); | 193 | TextLabel1_4_2->setFont( TextLabel1_4_2_font ); |
188 | } | 194 | } |
189 | return ret; | 195 | return ret; |
190 | } | 196 | } |
191 | 197 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.h b/noncore/net/wellenreiter/gui/wellenreiterbase.h index fce25d1..edb2930 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.h +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.h | |||
@@ -1,68 +1,75 @@ | |||
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 WELLENREITERBASE_H | 16 | #ifndef WELLENREITERBASE_H |
17 | #define WELLENREITERBASE_H | 17 | #define WELLENREITERBASE_H |
18 | 18 | ||
19 | #include <qvariant.h> | 19 | #include <qvariant.h> |
20 | #include <qwidget.h> | 20 | #include <qwidget.h> |
21 | class QVBoxLayout; | 21 | class QVBoxLayout; |
22 | class QHBoxLayout; | 22 | class QHBoxLayout; |
23 | class QGridLayout; | 23 | class QGridLayout; |
24 | class QLabel; | 24 | class QLabel; |
25 | class QListView; | 25 | class MScanListView; |
26 | class QListViewItem; | 26 | class MScanListItem; |
27 | class QPushButton; | 27 | class QPushButton; |
28 | class MLogWindow; | 28 | class MLogWindow; |
29 | class MHexWindow; | 29 | class MHexWindow; |
30 | class WellenreiterConfigWindow; | 30 | class WellenreiterConfigWindow; |
31 | 31 | ||
32 | #ifdef QWS | 32 | #ifdef QWS |
33 | class OTabWidget; | 33 | class OTabWidget; |
34 | #else | 34 | #else |
35 | class QTabWidget; | 35 | class QTabWidget; |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | class WellenreiterBase : public QWidget | 38 | class WellenreiterBase : public QWidget |
39 | { | 39 | { |
40 | Q_OBJECT | 40 | Q_OBJECT |
41 | 41 | ||
42 | public: | 42 | public: |
43 | WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 43 | WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
44 | ~WellenreiterBase(); | 44 | ~WellenreiterBase(); |
45 | 45 | ||
46 | #ifdef QWS | 46 | #ifdef QWS |
47 | OTabWidget* TabWidget; | 47 | OTabWidget* TabWidget; |
48 | #else | 48 | #else |
49 | QTabWidget* TabWidget; | 49 | QTabWidget* TabWidget; |
50 | #endif | 50 | #endif |
51 | QWidget* ap; | 51 | QWidget* ap; |
52 | QListView* netview; | 52 | MScanListView* netview; |
53 | MLogWindow* logwindow; | 53 | MLogWindow* logwindow; |
54 | MHexWindow* hexwindow; | 54 | MHexWindow* hexwindow; |
55 | WellenreiterConfigWindow* configwindow; | 55 | WellenreiterConfigWindow* configwindow; |
56 | QWidget* about; | 56 | QWidget* about; |
57 | QLabel* PixmapLabel1_3_2; | 57 | QLabel* PixmapLabel1_3_2; |
58 | QLabel* TextLabel1_4_2; | 58 | QLabel* TextLabel1_4_2; |
59 | QPushButton* button; | 59 | QPushButton* button; |
60 | 60 | ||
61 | protected: | 61 | protected: |
62 | QVBoxLayout* WellenreiterBaseLayout; | 62 | QVBoxLayout* WellenreiterBaseLayout; |
63 | QVBoxLayout* apLayout; | 63 | QVBoxLayout* apLayout; |
64 | QGridLayout* aboutLayout; | 64 | QGridLayout* aboutLayout; |
65 | bool event( QEvent* ); | 65 | bool event( QEvent* ); |
66 | |||
67 | QPixmap* ani1; | ||
68 | QPixmap* ani2; | ||
69 | QPixmap* ani3; | ||
70 | QPixmap* ani4; | ||
71 | |||
72 | |||
66 | }; | 73 | }; |
67 | 74 | ||
68 | #endif // WELLENREITERBASE_H | 75 | #endif // WELLENREITERBASE_H |
diff --git a/noncore/net/wellenreiter/gui/wlan.cpp b/noncore/net/wellenreiter/gui/wlan.cpp new file mode 100644 index 0000000..b046cc8 --- a/dev/null +++ b/noncore/net/wellenreiter/gui/wlan.cpp | |||
@@ -0,0 +1,57 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Opie Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | **********************************************************************/ | ||
15 | |||
16 | #include "wlan.h" | ||
17 | #include "cardconfig.h" | ||
18 | |||
19 | // Qt | ||
20 | #include <qstring.h> | ||
21 | |||
22 | // Qtopia | ||
23 | #ifdef QWS | ||
24 | #include <opie/odevice.h> | ||
25 | using namespace Opie; | ||
26 | #endif | ||
27 | |||
28 | WLAN::WLAN( const QString& interface ) | ||
29 | { | ||
30 | _configuration = new CardConfig( interface ); | ||
31 | } | ||
32 | |||
33 | WLAN::WLAN( const CardConfig* configuration ) | ||
34 | { | ||
35 | _configuration = configuration; | ||
36 | |||
37 | } | ||
38 | |||
39 | WLAN::~WLAN() | ||
40 | { | ||
41 | delete _configuration; | ||
42 | |||
43 | } | ||
44 | |||
45 | void WLAN::setMonitorMode( bool enabled ) | ||
46 | { | ||
47 | |||
48 | /* | ||
49 | |||
50 | if ( _configuration->system() == System_OpenZaurus && _configuration->type() == CardConfig::Prism ) | ||
51 | { | ||
52 | } | ||
53 | |||
54 | */ | ||
55 | |||
56 | } | ||
57 | |||
diff --git a/noncore/net/wellenreiter/gui/wlan.h b/noncore/net/wellenreiter/gui/wlan.h new file mode 100644 index 0000000..139e218 --- a/dev/null +++ b/noncore/net/wellenreiter/gui/wlan.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Opie Environment. | ||
5 | ** | ||
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 | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
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. | ||
13 | ** | ||
14 | **********************************************************************/ | ||
15 | |||
16 | #ifndef WLAN_H | ||
17 | #define WLAN_H | ||
18 | |||
19 | class QString; | ||
20 | class CardConfig; | ||
21 | |||
22 | class WLAN | ||
23 | { | ||
24 | public: | ||
25 | |||
26 | WLAN( const QString& interface ); | ||
27 | WLAN( const CardConfig* ); | ||
28 | virtual ~WLAN(); | ||
29 | void setMonitorMode( bool enabled ); | ||
30 | |||
31 | private: | ||
32 | |||
33 | const CardConfig* _configuration; | ||
34 | |||
35 | }; | ||
36 | |||
37 | #endif | ||
38 | |||