summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/scanlist.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/scanlist.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp
index 1cf49e0..3a6aa15 100644
--- a/noncore/net/wellenreiter/gui/scanlist.cpp
+++ b/noncore/net/wellenreiter/gui/scanlist.cpp
@@ -44,27 +44,27 @@ const int col_manuf = 6;
const int col_firstseen = 7;
const int col_lastseen = 8;
MScanListView::MScanListView( QWidget* parent, const char* name )
:OListView( parent, name ), _manufacturerdb( 0 )
{
setFrameShape( QListView::StyledPanel );
setFrameShadow( QListView::Sunken );
addColumn( tr( "Net/Station" ) );
setColumnAlignment( 0, AlignLeft || AlignVCenter );
- addColumn( tr( "B" ) );
+ addColumn( tr( "#" ) );
setColumnAlignment( 1, AlignCenter );
- addColumn( tr( "AP" ) );
+ addColumn( tr( "MAC" ) );
setColumnAlignment( 2, AlignCenter );
addColumn( tr( "Chn" ) );
setColumnAlignment( 3, AlignCenter );
addColumn( tr( "W" ) );
setColumnAlignment( 4, AlignCenter );
addColumn( tr( "T" ) );
setColumnAlignment( 5, AlignCenter );
addColumn( tr( "Manufacturer" ) );
setColumnAlignment( 6, AlignCenter );
addColumn( tr( "First Seen" ) );
setColumnAlignment( 7, AlignCenter );
addColumn( tr( "Last Seen" ) );
@@ -139,46 +139,47 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
{
// we have already seen this item, it's a dupe
#ifdef DEBUG
qDebug( "%s is a dupe - ignoring...", (const char*) macaddr );
#endif
item->receivedBeacon();
return;
}
}
else
{
s.sprintf( "(i) new network: '%s'", (const char*) essid );
+ //TODO send s to logwindow
network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0 );
}
// insert new station as child from network
-
// no essid to reduce clutter, maybe later we have a nick or stationname to display!?
qDebug( "inserting new station %s", (const char*) macaddr );
MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
if ( _manufacturerdb )
station->setManufacturer( _manufacturerdb->lookup( macaddr ) );
if ( type == "managed" )
{
s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel );
}
else
{
s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel );
}
+ //TODO send s to logwindow
}
void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, const QString& type )
{
MScanListItem* subitem = static_cast<MScanListItem*>( network->firstChild() );
while ( subitem && ( subitem->text( col_ap ) != addr ) )
{
qDebug( "subitemtext: %s", (const char*) subitem->text( col_ap ) );
subitem = static_cast<MScanListItem*> ( subitem->nextSibling() );
@@ -189,24 +190,35 @@ void MScanListView::addIfNotExisting( MScanListItem* network, QString addr, cons
// we have already seen this item, it's a dupe
#ifdef DEBUG
qDebug( "%s is a dupe - ignoring...", (const char*) addr );
#endif
subitem->receivedBeacon(); //FIXME: sent data bit
return;
}
// Hey, it seems to be a new item :-D
MScanListItem* station = new MScanListItem( network, type, /* network->text( col_essid ) */ "", addr, false, -1, -1 );
if ( _manufacturerdb )
station->setManufacturer( _manufacturerdb->lookup( addr ) );
+
+ QString s;
+ if ( type == "station" )
+ {
+ s.sprintf( "(i) new station in '%s' [??]", (const char*) network->text( col_essid ) );
+ }
+ else
+ {
+ s.sprintf( "(i) new wireless station in '%s' [??]", (const char*) network->text( col_essid ) );
+ }
+ //TODO send s to logwindow
}
void MScanListView::WDStraffic( QString from, QString to, QString viaFrom, QString viaTo )
{
QString s;
MScanListItem* network;
QListViewItemIterator it( this );
while ( it.current() &&
it.current()->text( col_ap ) != viaFrom &&
it.current()->text( col_ap ) != viaTo ) ++it;