-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 17 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 9 |
2 files changed, 11 insertions, 15 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index c605111..9e8aa72 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -120,26 +120,27 @@ void MScanListView::serializeFrom( QDataStream& s) | |||
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, |
124 | int channel, | 124 | int channel, |
125 | int signal, | 125 | int signal, |
126 | const GpsLocation& loc, | 126 | const GpsLocation& loc, |
127 | bool probe ) | 127 | bool probe ) |
128 | { | 128 | { |
129 | QString macaddr = mac.toString(true); | 129 | QString macaddr = mac.toString(true); |
130 | 130 | ||
131 | #ifdef DEBUG | 131 | #ifdef DEBUG |
132 | qDebug( "MScanList::addNewItem( %s / %s / %s [%d]", (const char*) type, | 132 | odebug << "MScanList::addNewItem( " << (const char*) type << " / " |
133 | (const char*) essid, (const char*) macaddr, channel ); | 133 | << (const char*) essid << " / " << (const char*) macaddr |
134 | << " [" << channel << "]" << oendl; | ||
134 | #endif | 135 | #endif |
135 | 136 | ||
136 | // search, if we already have seen this net | 137 | // search, if we already have seen this net |
137 | 138 | ||
138 | QString s; | 139 | QString s; |
139 | MScanListItem* network; | 140 | MScanListItem* network; |
140 | MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); | 141 | MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); |
141 | 142 | ||
142 | while ( item && ( item->text( col_essid ) != essid ) ) | 143 | while ( item && ( item->text( col_essid ) != essid ) ) |
143 | { | 144 | { |
144 | #ifdef DEBUG | 145 | #ifdef DEBUG |
145 | odebug << "itemtext: " << item->text( col_essid ) << "" << oendl; | 146 | odebug << "itemtext: " << item->text( col_essid ) << "" << oendl; |
@@ -385,26 +386,26 @@ void MScanListView::addService( const QString& name, const OMacAddress& macaddr, | |||
385 | odebug << "D'oh! Received identification, but item not yet in list... ==> Handle this!" << oendl; | 386 | 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!", | 387 | MLogWindow::logwindow()->log( QString().sprintf( "WARNING: Unhandled service addition %s = %s!", |
387 | (const char*) macaddr.toString(), (const char*) ip ) ); | 388 | (const char*) macaddr.toString(), (const char*) ip ) ); |
388 | } | 389 | } |
389 | 390 | ||
390 | 391 | ||
391 | void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) | 392 | void MScanListView::contextMenuRequested( QListViewItem* item, const QPoint&, int col ) |
392 | { | 393 | { |
393 | if ( !item ) return; | 394 | if ( !item ) return; |
394 | 395 | ||
395 | MScanListItem* itm = static_cast<MScanListItem*>( item ); | 396 | MScanListItem* itm = static_cast<MScanListItem*>( item ); |
396 | 397 | ||
397 | qDebug( "contextMenuRequested on item '%s' (%s) in column: '%d'", | 398 | odebug << "contextMenuRequested on item '" << (const char*) itm->text(0) << "' (" |
398 | (const char*) itm->text(0), (const char*) itm->type, col ); | 399 | << (const char*) itm->type << ") in column: '" << col << "'" << oendl; |
399 | 400 | ||
400 | if ( itm->type == "adhoc" || itm->type == "managed" ) | 401 | if ( itm->type == "adhoc" || itm->type == "managed" ) |
401 | { | 402 | { |
402 | QString entry = QString().sprintf( "&Join %s Net '%s'...", (const char*) itm->type, (const char*) itm->essid() ); | 403 | QString entry = QString().sprintf( "&Join %s Net '%s'...", (const char*) itm->type, (const char*) itm->essid() ); |
403 | 404 | ||
404 | QPopupMenu m( this ); | 405 | QPopupMenu m( this ); |
405 | m.insertItem( entry, 37773, 0 ); | 406 | m.insertItem( entry, 37773, 0 ); |
406 | int result = m.exec( QCursor::pos() ); | 407 | int result = m.exec( QCursor::pos() ); |
407 | if ( result == 37773 ) | 408 | if ( result == 37773 ) |
408 | emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() ); | 409 | emit joinNetwork( itm->type, itm->essid(), itm->channel(), itm->macaddr() ); |
409 | } | 410 | } |
410 | } | 411 | } |
@@ -480,29 +481,27 @@ void MScanListItem::serializeFrom( QDataStream& s ) | |||
480 | 481 | ||
481 | QString name; | 482 | QString name; |
482 | name.sprintf( "wellenreiter/%s", (const char*) _type ); | 483 | name.sprintf( "wellenreiter/%s", (const char*) _type ); |
483 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 484 | setPixmap( col_type, Resource::loadPixmap( name ) ); |
484 | if ( _wep ) | 485 | if ( _wep ) |
485 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! | 486 | setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! |
486 | listView()->triggerUpdate(); | 487 | listView()->triggerUpdate(); |
487 | } | 488 | } |
488 | 489 | ||
489 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ) | 490 | void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ) |
490 | { | 491 | { |
491 | #ifdef DEBUG | 492 | #ifdef DEBUG |
492 | qDebug( "decorating scanlist item %s / %s / %s [%d]", | 493 | odebug << "decorating scanlist item " << (const char*) type << " / " |
493 | (const char*) type, | 494 | << (const char*) essid << " / " << (const char*) macaddr |
494 | (const char*) essid, | 495 | << "[" << channel << "]" << oendl; |
495 | (const char*) macaddr, | ||
496 | channel ); | ||
497 | #endif | 496 | #endif |
498 | 497 | ||
499 | // set icon for managed or adhoc mode | 498 | // set icon for managed or adhoc mode |
500 | QString name; | 499 | QString name; |
501 | name.sprintf( "wellenreiter/%s", (const char*) type ); | 500 | name.sprintf( "wellenreiter/%s", (const char*) type ); |
502 | setPixmap( col_type, Resource::loadPixmap( name ) ); | 501 | setPixmap( col_type, Resource::loadPixmap( name ) ); |
503 | 502 | ||
504 | // special case for probed networks FIXME: This is ugly at present | 503 | // special case for probed networks FIXME: This is ugly at present |
505 | if ( type == "network" && probed ) | 504 | if ( type == "network" && probed ) |
506 | { | 505 | { |
507 | setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) ); | 506 | setPixmap( col_type, Resource::loadPixmap( "wellenreiter/network-probed.png" ) ); |
508 | } | 507 | } |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 2f85790..e801ce7 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -733,30 +733,27 @@ void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int ch | |||
733 | if ( !iface ) | 733 | if ( !iface ) |
734 | { | 734 | { |
735 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "No wireless\ninterface available." ) ); | 735 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "No wireless\ninterface available." ) ); |
736 | return; | 736 | return; |
737 | } | 737 | } |
738 | 738 | ||
739 | if ( sniffing ) | 739 | if ( sniffing ) |
740 | { | 740 | { |
741 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) ); | 741 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) ); |
742 | return; | 742 | return; |
743 | } | 743 | } |
744 | 744 | ||
745 | qDebug( "joinNetwork() with Interface %s: %s, %s, %d, %s", | 745 | odebug << "joinNetwork() with Interface " << (const char*) iface->name() |
746 | (const char*) iface->name(), | 746 | << ": " << (const char*) type << ", " << (const char*) essid |
747 | (const char*) type, | 747 | << ", " << channel << ", " << (const char*) macaddr << oendl; |
748 | (const char*) essid, | ||
749 | channel, | ||
750 | (const char*) macaddr ); | ||
751 | 748 | ||
752 | QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); | 749 | QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); |
753 | int count = 3; | 750 | int count = 3; |
754 | odebug << "sending " << count << " messages" << oendl; | 751 | odebug << "sending " << count << " messages" << oendl; |
755 | msg << QString("count") << QString::number(count); | 752 | msg << QString("count") << QString::number(count); |
756 | odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl; | 753 | odebug << "msg >" << iface->name() << "< Mode >" << type.latin1() << "<" << oendl; |
757 | msg << QString(iface->name()) << QString("Mode") << type; | 754 | msg << QString(iface->name()) << QString("Mode") << type; |
758 | odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl; | 755 | odebug << "msg >" << iface->name() << "< essid >" << essid.latin1() << "<" << oendl; |
759 | msg << QString(iface->name()) << QString("ESSID") << essid; | 756 | msg << QString(iface->name()) << QString("ESSID") << essid; |
760 | odebug << "msg >" << iface->name() << "< channel >" << channel << "<" << oendl; | 757 | odebug << "msg >" << iface->name() << "< channel >" << channel << "<" << oendl; |
761 | msg << QString(iface->name()) << QString("Channel") << channel; | 758 | msg << QString(iface->name()) << QString("Channel") << channel; |
762 | // odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl; | 759 | // odebug << "msg >" << iface->name() << "< mac >" << macaddr << "<" << oendl; |