Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index f4cfe52..d695c17 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp @@ -46,8 +46,9 @@ const int col_traffic = 5; const int col_ip = 6; const int col_manuf = 7; const int col_firstseen = 8; const int col_lastseen = 9; +const int col_location = 10; MScanListView::MScanListView( QWidget* parent, const char* name ) :OListView( parent, name ) { @@ -74,8 +75,10 @@ MScanListView::MScanListView( QWidget* parent, const char* name ) addColumn( tr( "First Seen" ) ); setColumnAlignment( col_firstseen, AlignCenter ); addColumn( tr( "Last Seen" ) ); setColumnAlignment( col_lastseen, AlignCenter ); + addColumn( tr( "Location" ) ); + setColumnAlignment( col_location, AlignCenter ); setRootIsDecorated( true ); setAllColumnsShowFocus( true ); connect( this, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), @@ -112,9 +115,15 @@ void MScanListView::serializeFrom( QDataStream& s) OListView::serializeFrom( s ); } -void MScanListView::addNewItem( const QString& type, const QString& essid, const OMacAddress& mac, bool wep, int channel, int signal ) +void MScanListView::addNewItem( const QString& type, + const QString& essid, + const OMacAddress& mac, + bool wep, + int channel, + int signal, + const GpsLocation& loc ) { QString macaddr = mac.toString(true); #ifdef DEBUG @@ -178,8 +187,9 @@ void MScanListView::addNewItem( const QString& type, const QString& essid, const #endif MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); station->setManufacturer( mac.manufacturer() ); + station->setLocation( loc.latitude, loc.longitude ); if ( type == "managed" ) { s.sprintf( "(i) New Access Point in '%s' [%d]", (const char*) essid, channel ); @@ -467,8 +477,17 @@ void MScanListItem::setManufacturer( const QString& manufacturer ) setText( col_manuf, manufacturer ); } +void MScanListItem::setLocation( const float& latitude, const float& longitude ) +{ + if ( latitude == 0.0 || longitude == 0.0 ) + setText( col_location, "N/A" ); + else + setText( col_location, QString().sprintf( "%.2f / %.2f", latitude, longitude ) ); +} + + void MScanListItem::playSound( const QString& sound ) const { #ifdef QWS if ( sound == "Ignore" ) return; |