Diffstat (limited to 'noncore/net/wellenreiter/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 52 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 2 |
2 files changed, 27 insertions, 27 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index ed9ec14..c605111 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -100,24 +100,24 @@ MScanListView::~MScanListView() | |||
100 | OListViewItem* MScanListView::childFactory() | 100 | OListViewItem* MScanListView::childFactory() |
101 | { | 101 | { |
102 | return new MScanListItem( this ); | 102 | return new MScanListItem( this ); |
103 | } | 103 | } |
104 | 104 | ||
105 | 105 | ||
106 | void MScanListView::serializeTo( QDataStream& s) const | 106 | void MScanListView::serializeTo( QDataStream& s) const |
107 | { | 107 | { |
108 | odebug << "serializing MScanListView" << oendl; | 108 | odebug << "serializing MScanListView" << oendl; |
109 | OListView::serializeTo( s ); | 109 | OListView::serializeTo( s ); |
110 | } | 110 | } |
111 | 111 | ||
112 | 112 | ||
113 | void MScanListView::serializeFrom( QDataStream& s) | 113 | void MScanListView::serializeFrom( QDataStream& s) |
114 | { | 114 | { |
115 | odebug << "serializing MScanListView" << oendl; | 115 | odebug << "serializing MScanListView" << oendl; |
116 | OListView::serializeFrom( s ); | 116 | OListView::serializeFrom( s ); |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | void MScanListView::addNewItem( const QString& type, | 120 | void MScanListView::addNewItem( const QString& type, |
121 | const QString& essid, | 121 | const QString& essid, |
122 | const OMacAddress& mac, | 122 | const OMacAddress& mac, |
123 | bool wep, | 123 | bool wep, |
@@ -137,42 +137,42 @@ void MScanListView::addNewItem( const QString& type, | |||
137 | 137 | ||
138 | QString s; | 138 | QString s; |
139 | MScanListItem* network; | 139 | MScanListItem* network; |
140 | MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); | 140 | MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); |
141 | 141 | ||
142 | while ( item && ( item->text( col_essid ) != essid ) ) | 142 | while ( item && ( item->text( col_essid ) != essid ) ) |
143 | { | 143 | { |
144 | #ifdef DEBUG | 144 | #ifdef DEBUG |
145 | odebug << "itemtext: " << item->text( col_essid ) << "" << oendl; | 145 | odebug << "itemtext: " << item->text( col_essid ) << "" << oendl; |
146 | #endif | 146 | #endif |
147 | item = static_cast<MScanListItem*> ( item->nextSibling() ); | 147 | item = static_cast<MScanListItem*> ( item->nextSibling() ); |
148 | } | 148 | } |
149 | if ( item ) | 149 | if ( item ) |
150 | { | 150 | { |
151 | // we have already seen this net, check all childs if MAC exists | 151 | // we have already seen this net, check all childs if MAC exists |
152 | 152 | ||
153 | network = item; | 153 | network = item; |
154 | 154 | ||
155 | item = static_cast<MScanListItem*> ( item->firstChild() ); | 155 | item = static_cast<MScanListItem*> ( item->firstChild() ); |
156 | assert( item ); // this shouldn't fail | 156 | assert( item ); // this shouldn't fail |
157 | 157 | ||
158 | while ( item && ( item->text( col_ap ) != macaddr ) ) | 158 | while ( item && ( item->text( col_ap ) != macaddr ) ) |
159 | { | 159 | { |
160 | #ifdef DEBUG | 160 | #ifdef DEBUG |
161 | odebug << "subitemtext: " << item->text( col_ap ) << "" << oendl; | 161 | odebug << "subitemtext: " << item->text( col_ap ) << "" << oendl; |
162 | #endif | 162 | #endif |
163 | item = static_cast<MScanListItem*> ( item->nextSibling() ); | 163 | item = static_cast<MScanListItem*> ( item->nextSibling() ); |
164 | } | 164 | } |
165 | 165 | ||
166 | if ( item ) | 166 | if ( item ) |
167 | { | 167 | { |
168 | // we have already seen this item, it's a dupe | 168 | // we have already seen this item, it's a dupe |
169 | #ifdef DEBUG | 169 | #ifdef DEBUG |
170 | odebug << "" << macaddr << " is a dupe - ignoring..." << oendl; | 170 | odebug << "" << macaddr << " is a dupe - ignoring..." << oendl; |
171 | #endif | 171 | #endif |
172 | item->receivedBeacon(); | 172 | item->receivedBeacon(); |
173 | return; | 173 | return; |
174 | } | 174 | } |
175 | } | 175 | } |
176 | else | 176 | else |
177 | { | 177 | { |
178 | s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid ); | 178 | s.sprintf( "(i) New network: ESSID '%s'", (const char*) essid ); |
@@ -180,17 +180,17 @@ void MScanListView::addNewItem( const QString& type, | |||
180 | network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe ); | 180 | network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe ); |
181 | } | 181 | } |
182 | 182 | ||
183 | 183 | ||
184 | // insert new station as child from network | 184 | // insert new station as child from network |
185 | // no essid to reduce clutter, maybe later we have a nick or stationname to display!? | 185 | // no essid to reduce clutter, maybe later we have a nick or stationname to display!? |
186 | 186 | ||
187 | #ifdef DEBUG | 187 | #ifdef DEBUG |
188 | odebug << "inserting new station " << macaddr << "" << oendl; | 188 | odebug << "inserting new station " << macaddr << "" << oendl; |
189 | #endif | 189 | #endif |
190 | 190 | ||
191 | MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); | 191 | MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); |
192 | station->setManufacturer( mac.manufacturer() ); | 192 | station->setManufacturer( mac.manufacturer() ); |
193 | station->setLocation( loc.dmsPosition() ); | 193 | station->setLocation( loc.dmsPosition() ); |
194 | 194 | ||
195 | if ( type == "managed" ) | 195 | if ( type == "managed" ) |
196 | { | 196 | { |
@@ -206,26 +206,26 @@ void MScanListView::addNewItem( const QString& type, | |||
206 | 206 | ||
207 | void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type ) | 207 | void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& addr, const QString& type ) |
208 | { | 208 | { |
209 | MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() ); | 209 | MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() ); |
210 | 210 | ||
211 | while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) ) | 211 | while ( subitem && ( subitem->text( col_ap ) != addr.toString(true) ) ) |
212 | { | 212 | { |
213 | #ifdef DEBUG | 213 | #ifdef DEBUG |
214 | odebug << "subitemtext: " << subitem->text( col_ap ) << "" << oendl; | 214 | odebug << "subitemtext: " << subitem->text( col_ap ) << "" << oendl; |
215 | #endif | 215 | #endif |
216 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); | 216 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); |
217 | } | 217 | } |
218 | 218 | ||
219 | if ( subitem ) | 219 | if ( subitem ) |
220 | { | 220 | { |
221 | // we have already seen this item, it's a dupe | 221 | // we have already seen this item, it's a dupe |
222 | #ifdef DEBUG | 222 | #ifdef DEBUG |
223 | odebug << "" << addr.toString(true) << " is a dupe - ignoring..." << oendl; | 223 | odebug << "" << addr.toString(true) << " is a dupe - ignoring..." << oendl; |
224 | #endif | 224 | #endif |
225 | subitem->receivedBeacon(); //FIXME: sent data bit | 225 | subitem->receivedBeacon(); //FIXME: sent data bit |
226 | return; | 226 | return; |
227 | } | 227 | } |
228 | 228 | ||
229 | // Hey, it seems to be a new item :-D | 229 | // Hey, it seems to be a new item :-D |
230 | MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr.toString(true), false, -1, -1 ); | 230 | MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr.toString(true), false, -1, -1 ); |
231 | station->setManufacturer( addr.manufacturer() ); | 231 | station->setManufacturer( addr.manufacturer() ); |
@@ -240,17 +240,17 @@ void MScanListView::addIfNotExisting( MScanListItem* network, const OMacAddress& | |||
240 | s.sprintf( "(i) New Wireless Station in '%s' [xx]", (const char*) network->text( col_essid ) ); | 240 | s.sprintf( "(i) New Wireless Station in '%s' [xx]", (const char*) network->text( col_essid ) ); |
241 | } | 241 | } |
242 | MLogWindow::logwindow()->log( s ); | 242 | MLogWindow::logwindow()->log( s ); |
243 | } | 243 | } |
244 | 244 | ||
245 | 245 | ||
246 | void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) | 246 | void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ) |
247 | { | 247 | { |
248 | odebug << "WDSTraffic: " << (const char*) viaFrom.toString() << " and " << viaTo.toString() << " seem to form a WDS" << oendl; | 248 | odebug << "WDSTraffic: " << (const char*) viaFrom.toString() << " and " << viaTo.toString() << " seem to form a WDS" << oendl; |
249 | QString s; | 249 | QString s; |
250 | MScanListItem* network; | 250 | MScanListItem* network; |
251 | 251 | ||
252 | QListViewItemIterator it( this ); | 252 | QListViewItemIterator it( this ); |
253 | while ( it.current() && | 253 | while ( it.current() && |
254 | it.current()->text( col_ap ) != viaFrom.toString(true) && | 254 | it.current()->text( col_ap ) != viaFrom.toString(true) && |
255 | it.current()->text( col_ap ) != viaTo.toString(true) ) ++it; | 255 | it.current()->text( col_ap ) != viaTo.toString(true) ) ++it; |
256 | 256 | ||
@@ -258,17 +258,17 @@ void MScanListView::WDStraffic( const OMacAddress& from, const OMacAddress& to, | |||
258 | 258 | ||
259 | if ( item ) // Either viaFrom or viaTo AP has shown up yet, so just add our two new stations | 259 | if ( item ) // Either viaFrom or viaTo AP has shown up yet, so just add our two new stations |
260 | { | 260 | { |
261 | addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from ); | 261 | addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from ); |
262 | addIfNotExisting( static_cast<MScanListItem*>(item->parent()), to ); | 262 | addIfNotExisting( static_cast<MScanListItem*>(item->parent()), to ); |
263 | } | 263 | } |
264 | else | 264 | else |
265 | { | 265 | { |
266 | odebug << "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" << oendl; | 266 | odebug << "D'Oh! Stations without AP... ignoring for now... will handle this in 1.1 version :-D" << oendl; |
267 | MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" ); | 267 | MLogWindow::logwindow()->log( "WARNING: Unhandled WSD traffic!" ); |
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | 271 | ||
272 | void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) | 272 | void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) |
273 | { | 273 | { |
274 | QString s; | 274 | QString s; |
@@ -280,17 +280,17 @@ void MScanListView::toDStraffic( const OMacAddress& from, const OMacAddress& to, | |||
280 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); | 280 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); |
281 | 281 | ||
282 | if ( item ) // AP has shown up yet, so just add our new "from" - station | 282 | if ( item ) // AP has shown up yet, so just add our new "from" - station |
283 | { | 283 | { |
284 | addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "adhoc" ); | 284 | addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "adhoc" ); |
285 | } | 285 | } |
286 | else | 286 | else |
287 | { | 287 | { |
288 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; | 288 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; |
289 | MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" ); | 289 | MLogWindow::logwindow()->log( "WARNING: Unhandled toDS traffic!" ); |
290 | 290 | ||
291 | } | 291 | } |
292 | } | 292 | } |
293 | 293 | ||
294 | 294 | ||
295 | void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) | 295 | void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) |
296 | { | 296 | { |
@@ -303,91 +303,91 @@ void MScanListView::fromDStraffic( const OMacAddress& from, const OMacAddress& t | |||
303 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); | 303 | MScanListItem* item = static_cast<MScanListItem*>( it.current() ); |
304 | 304 | ||
305 | if ( item ) // AP has shown up yet, so just add our new "from" - station | 305 | if ( item ) // AP has shown up yet, so just add our new "from" - station |
306 | { | 306 | { |
307 | addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "station" ); | 307 | addIfNotExisting( static_cast<MScanListItem*>(item->parent()), from, "station" ); |
308 | } | 308 | } |
309 | else | 309 | else |
310 | { | 310 | { |
311 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; | 311 | odebug << "D'Oh! Station without AP... ignoring for now... will handle this in 1.1 :-D" << oendl; |
312 | MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" ); | 312 | MLogWindow::logwindow()->log( "WARNING: Unhandled fromDS traffic!" ); |
313 | } | 313 | } |
314 | } | 314 | } |
315 | 315 | ||
316 | 316 | ||
317 | void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) | 317 | void MScanListView::IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ) |
318 | { | 318 | { |
319 | owarn << "D'oh! Not yet implemented..." << oendl; | 319 | owarn << "D'oh! Not yet implemented..." << oendl; |
320 | MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" ); | 320 | MLogWindow::logwindow()->log( "WARNING: Unhandled IBSS traffic!" ); |
321 | } | 321 | } |
322 | 322 | ||
323 | 323 | ||
324 | void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) | 324 | void MScanListView::identify( const OMacAddress& macaddr, const QString& ip ) |
325 | { | 325 | { |
326 | odebug << "identify " << (const char*) macaddr.toString() << " = " << ip << "" << oendl; | 326 | odebug << "identify " << (const char*) macaddr.toString() << " = " << ip << "" << oendl; |
327 | 327 | ||
328 | QListViewItemIterator it( this ); | 328 | QListViewItemIterator it( this ); |
329 | for ( ; it.current(); ++it ) | 329 | for ( ; it.current(); ++it ) |
330 | { | 330 | { |
331 | if ( it.current()->text( col_ap ) == macaddr.toString(true) ) | 331 | if ( it.current()->text( col_ap ) == macaddr.toString(true) ) |
332 | { | 332 | { |
333 | it.current()->setText( col_ip, ip ); | 333 | it.current()->setText( col_ip, ip ); |
334 | return; | 334 | return; |
335 | } | 335 | } |
336 | } | 336 | } |
337 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; | 337 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; |
338 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", | 338 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled identification %s = %s!", |
339 | (const char*) macaddr.toString(), (const char*) ip ) ); | 339 | (const char*) macaddr.toString(), (const char*) ip ) ); |
340 | } | 340 | } |
341 | 341 | ||
342 | 342 | ||
343 | void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) | 343 | void MScanListView::addService( const QString& name, const OMacAddress& macaddr, const QString& ip ) |
344 | { | 344 | { |
345 | odebug << "addService '" << (const char*) name << "', Server = " << (const char*) macaddr.toString() << " = " << ip << "" << oendl; | 345 | odebug << "addService '" << (const char*) name << "', Server = " << (const char*) macaddr.toString() << " = " << ip << "" << oendl; |
346 | 346 | ||
347 | //TODO: Refactor that out, we need it all over the place. | 347 | //TODO: Refactor that out, we need it all over the place. |
348 | // Best to do it in a more comfortable abstraction in OListView | 348 | // Best to do it in a more comfortable abstraction in OListView |
349 | // (Hmm, didn't I already start something in this direction?) | 349 | // (Hmm, didn't I already start something in this direction?) |
350 | 350 | ||
351 | QListViewItemIterator it( this ); | 351 | QListViewItemIterator it( this ); |
352 | for ( ; it.current(); ++it ) | 352 | for ( ; it.current(); ++it ) |
353 | { | 353 | { |
354 | if ( it.current()->text( col_ap ) == macaddr.toString(true) ) | 354 | if ( it.current()->text( col_ap ) == macaddr.toString(true) ) |
355 | { | 355 | { |
356 | 356 | ||
357 | MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() ); | 357 | MScanListItem* subitem = static_cast<MScanListItem*>( it.current()->firstChild() ); |
358 | 358 | ||
359 | while ( subitem && ( subitem->text( col_essid ) != name ) ) | 359 | while ( subitem && ( subitem->text( col_essid ) != name ) ) |
360 | { | 360 | { |
361 | #ifdef DEBUG | 361 | #ifdef DEBUG |
362 | odebug << "subitemtext: " << subitem->text( col_essid ) << "" << oendl; | 362 | odebug << "subitemtext: " << subitem->text( col_essid ) << "" << oendl; |
363 | #endif | 363 | #endif |
364 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); | 364 | subitem = static_cast<MScanListItem*> ( subitem->nextSibling() ); |
365 | } | 365 | } |
366 | 366 | ||
367 | if ( subitem ) | 367 | if ( subitem ) |
368 | { | 368 | { |
369 | // we have already seen this item, it's a dupe | 369 | // we have already seen this item, it's a dupe |
370 | #ifdef DEBUG | 370 | #ifdef DEBUG |
371 | odebug << "" << name << " is a dupe - ignoring..." << oendl; | 371 | odebug << "" << name << " is a dupe - ignoring..." << oendl; |
372 | #endif | 372 | #endif |
373 | subitem->receivedBeacon(); //FIXME: sent data bit | 373 | subitem->receivedBeacon(); //FIXME: sent data bit |
374 | return; | 374 | return; |
375 | } | 375 | } |
376 | 376 | ||
377 | // never seen that - add new item | 377 | // never seen that - add new item |
378 | 378 | ||
379 | MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 ); | 379 | MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 ); |
380 | item->setText( col_essid, name ); | 380 | item->setText( col_essid, name ); |
381 | 381 | ||
382 | return; | 382 | return; |
383 | } | 383 | } |
384 | } | 384 | } |
385 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; | 385 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; |
386 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", | 386 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", |
387 | (const char*) macaddr.toString(), (const char*) ip ) ); | 387 | (const char*) macaddr.toString(), (const char*) ip ) ); |
388 | } | 388 | } |
389 | 389 | ||
390 | 390 | ||
391 | void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) | 391 | void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) |
392 | { | 392 | { |
393 | if ( !item ) return; | 393 | if ( !item ) return; |
@@ -415,31 +415,31 @@ void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, in | |||
415 | 415 | ||
416 | MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr, | 416 | MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr, |
417 | bool wep, int channel, int signal, bool probed ) | 417 | bool wep, int channel, int signal, bool probed ) |
418 | :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), | 418 | :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), |
419 | _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), | 419 | _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), |
420 | _channel( channel ), _signal( signal ), _beacons( 1 ) | 420 | _channel( channel ), _signal( signal ), _beacons( 1 ) |
421 | { | 421 | { |
422 | #ifdef DEBUG | 422 | #ifdef DEBUG |
423 | odebug << "creating scanlist item" << oendl; | 423 | odebug << "creating scanlist item" << oendl; |
424 | #endif | 424 | #endif |
425 | 425 | ||
426 | if ( WellenreiterConfigWindow::instance() ) | 426 | if ( WellenreiterConfigWindow::instance() ) |
427 | WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here | 427 | WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here |
428 | 428 | ||
429 | decorateItem( type, essid, macaddr, wep, channel, signal, probed ); | 429 | decorateItem( type, essid, macaddr, wep, channel, signal, probed ); |
430 | } | 430 | } |
431 | 431 | ||
432 | MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr, | 432 | MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr, |
433 | bool wep, int channel, int signal ) | 433 | bool wep, int channel, int signal ) |
434 | :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) | 434 | :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) |
435 | { | 435 | { |
436 | #ifdef DEBUG | 436 | #ifdef DEBUG |
437 | odebug << "creating scanlist item" << oendl; | 437 | odebug << "creating scanlist item" << oendl; |
438 | #endif | 438 | #endif |
439 | if ( WellenreiterConfigWindow::instance() ) | 439 | if ( WellenreiterConfigWindow::instance() ) |
440 | WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here | 440 | WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here |
441 | 441 | ||
442 | decorateItem( type, essid, macaddr, wep, channel, signal, false ); | 442 | decorateItem( type, essid, macaddr, wep, channel, signal, false ); |
443 | } | 443 | } |
444 | 444 | ||
445 | const QString& MScanListItem::essid() const | 445 | const QString& MScanListItem::essid() const |
@@ -453,34 +453,34 @@ const QString& MScanListItem::essid() const | |||
453 | OListViewItem* MScanListItem::childFactory() | 453 | OListViewItem* MScanListItem::childFactory() |
454 | { | 454 | { |
455 | return new MScanListItem( this ); | 455 | return new MScanListItem( this ); |
456 | } | 456 | } |
457 | 457 | ||
458 | void MScanListItem::serializeTo( QDataStream& s ) const | 458 | void MScanListItem::serializeTo( QDataStream& s ) const |
459 | { | 459 | { |
460 | #ifdef DEBUG | 460 | #ifdef DEBUG |
461 | odebug << "serializing MScanListItem" << oendl; | 461 | odebug << "serializing MScanListItem" << oendl; |
462 | #endif | 462 | #endif |
463 | OListViewItem::serializeTo( s ); | 463 | OListViewItem::serializeTo( s ); |
464 | 464 | ||
465 | s << _type; | 465 | s << _type; |
466 | s << (Q_UINT8) ( _wep ? 'y' : 'n' ); | 466 | s << (Q_UINT8) ( _wep ? 'y' : 'n' ); |
467 | } | 467 | } |
468 | 468 | ||
469 | void MScanListItem::serializeFrom( QDataStream& s ) | 469 | void MScanListItem::serializeFrom( QDataStream& s ) |
470 | { | 470 | { |
471 | #ifdef DEBUG | 471 | #ifdef DEBUG |
472 | odebug << "serializing MScanListItem" << oendl; | 472 | odebug << "serializing MScanListItem" << oendl; |
473 | #endif | 473 | #endif |
474 | OListViewItem::serializeFrom( s ); | 474 | OListViewItem::serializeFrom( s ); |
475 | 475 | ||
476 | char wep; | 476 | Q_UINT8 wep; |
477 | s >> _type; | 477 | s >> _type; |
478 | s >> (Q_UINT8) wep; | 478 | s >> wep; |
479 | _wep = (wep == 'y'); | 479 | _wep = (wep == 'y'); |
480 | 480 | ||
481 | QString name; | 481 | QString name; |
482 | name.sprintf( "wellenreiter/%s", (const char*) _type ); | 482 | name.sprintf( "wellenreiter/%s", (const char*) _type ); |
483 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 483 | setPixmap( col_type, Resource::loadPixmap( name ) ); |
484 | if ( _wep ) | 484 | if ( _wep ) |
485 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! | 485 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! |
486 | listView()->triggerUpdate(); | 486 | listView()->triggerUpdate(); |
@@ -550,17 +550,17 @@ void MScanListItem::setLocation( const QString& location ) | |||
550 | setText( col_location, location ); | 550 | setText( col_location, location ); |
551 | } | 551 | } |
552 | 552 | ||
553 | 553 | ||
554 | void MScanListItem::receivedBeacon() | 554 | void MScanListItem::receivedBeacon() |
555 | { | 555 | { |
556 | _beacons++; | 556 | _beacons++; |
557 | #ifdef DEBUG | 557 | #ifdef DEBUG |
558 | odebug << "MScanListItem " << _macaddr << ": received beacon #" << _beacons << "" << oendl; | 558 | odebug << "MScanListItem " << _macaddr << ": received beacon #" << _beacons << "" << oendl; |
559 | #endif | 559 | #endif |
560 | setText( col_sig, QString::number( _beacons ) ); | 560 | setText( col_sig, QString::number( _beacons ) ); |
561 | setText( col_lastseen, QTime::currentTime().toString() ); | 561 | setText( col_lastseen, QTime::currentTime().toString() ); |
562 | 562 | ||
563 | MScanListItem* p = (MScanListItem*) parent(); | 563 | MScanListItem* p = (MScanListItem*) parent(); |
564 | if ( p ) p->receivedBeacon(); | 564 | if ( p ) p->receivedBeacon(); |
565 | 565 | ||
566 | } | 566 | } |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 822bde8..40cd105 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -581,17 +581,17 @@ void Wellenreiter::startClicked() | |||
581 | else // write it anyway ;) | 581 | else // write it anyway ;) |
582 | { | 582 | { |
583 | dumpname = "/var/log/dump.wellenreiter"; | 583 | dumpname = "/var/log/dump.wellenreiter"; |
584 | } | 584 | } |
585 | 585 | ||
586 | if ( cardtype != DEVTYPE_FILE ) | 586 | if ( cardtype != DEVTYPE_FILE ) |
587 | pcap->open( interface ); | 587 | pcap->open( interface ); |
588 | else | 588 | else |
589 | pcap->open( QFile( interface ) ); | 589 | pcap->openCaptureFile( interface ); |
590 | 590 | ||
591 | odebug << "Wellenreiter:: dumping to " << dumpname << "" << oendl; | 591 | odebug << "Wellenreiter:: dumping to " << dumpname << "" << oendl; |
592 | pcap->openDumpFile( dumpname ); | 592 | pcap->openDumpFile( dumpname ); |
593 | 593 | ||
594 | if ( !pcap->isOpen() ) | 594 | if ( !pcap->isOpen() ) |
595 | { | 595 | { |
596 | QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg( | 596 | QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg( |
597 | cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) )); | 597 | cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) )); |