summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/scanlist.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index f24e09f..587faad 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -381,58 +381,51 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr,
381 381
382 // never seen that - add new item 382 // never seen that - add new item
383 383
384 MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 ); 384 MScanListItem* item = new MScanListItem( it.current(), "service", "N/A", " ", false, -1, -1 );
385 item->setText( col_essid, name ); 385 item->setText( col_essid, name );
386 386
387 return; 387 return;
388 } 388 }
389 } 389 }
390 odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; 390 odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl;
391 MLogWindow::logwindow()->log( QString("WARNING: Unhandled service addition %s = %s!") 391 MLogWindow::logwindow()->log( QString("WARNING: Unhandled service addition %s = %s!")
392 .arg( macaddr.toString() ).arg( ip ) ); 392 .arg( macaddr.toString() ).arg( ip ) );
393} 393}
394 394
395 395
396void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) 396void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col )
397{ 397{
398 if ( !item ) return; 398 if ( !item ) return;
399 399
400 MScanListItem* itm = static_cast<MScanListItem*>( item ); 400 MScanListItem* itm = static_cast<MScanListItem*>( item );
401 401
402 odebug << "contextMenuRequested on item '" << itm->text(0) << "' (" 402 odebug << "contextMenuRequested on item '" << itm->text(0) << "' ("
403 << itm->type << ") in column: '" << col << "'" << oendl; 403 << itm->type << ") in column: '" << col << "'" << oendl;
404 404
405 if ( itm->type == "adhoc" || itm->type == "managed" ) 405 /* do something meaningful */
406 {
407 QString entry = QString( "&Join %1 Net '%2'..." ).arg( itm->type ).arg( itm->essid() );
408 406
409 QPopupMenu m( this ); 407 return;
410 m.insertItem( entry, 37773, 0 );
411 int result = m.exec( QCursor::pos() );
412 if ( result == 37773 )
413 emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() );
414 }
415} 408}
416 409
417//============================================================ 410//============================================================
418// MScanListItem 411// MScanListItem
419//============================================================ 412//============================================================
420 413
421MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr, 414MScanListItem::MScanListItem( QListView* parent, const QString& type, const QString& essid, const QString& macaddr,
422 bool wep, int channel, int signal, bool probed ) 415 bool wep, int channel, int signal, bool probed )
423 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), 416 :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ),
424 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), 417 _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ),
425 _channel( channel ), _signal( signal ), _beacons( 1 ) 418 _channel( channel ), _signal( signal ), _beacons( 1 )
426{ 419{
427 #ifdef DEBUG 420 #ifdef DEBUG
428 odebug << "creating scanlist item" << oendl; 421 odebug << "creating scanlist item" << oendl;
429 #endif 422 #endif
430 423
431 if ( WellenreiterConfigWindow::instance() ) 424 if ( WellenreiterConfigWindow::instance() )
432 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here 425 WellenreiterConfigWindow::instance()->performAction( type, essid, macaddr, wep, channel, signal ); // better use signal/slot combination here
433 426
434 decorateItem( type, essid, macaddr, wep, channel, signal, probed ); 427 decorateItem( type, essid, macaddr, wep, channel, signal, probed );
435} 428}
436 429
437MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr, 430MScanListItem::MScanListItem( QListViewItem* parent, const QString& type, const QString& essid, const QString& macaddr,
438 bool wep, int channel, int signal ) 431 bool wep, int channel, int signal )