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.cpp21
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
@@ -47,6 +47,7 @@ const int col_ip = 6;
47const int col_manuf = 7; 47const int col_manuf = 7;
48const int col_firstseen = 8; 48const int col_firstseen = 8;
49const int col_lastseen = 9; 49const int col_lastseen = 9;
50const int col_location = 10;
50 51
51MScanListView::MScanListView( QWidget* parent, const char* name ) 52MScanListView::MScanListView( QWidget* parent, const char* name )
52 :OListView( parent, name ) 53 :OListView( parent, name )
@@ -75,6 +76,8 @@ MScanListView::MScanListView( QWidget* parent, const char* name )
75 setColumnAlignment( col_firstseen, AlignCenter ); 76 setColumnAlignment( col_firstseen, AlignCenter );
76 addColumn( tr( "Last Seen" ) ); 77 addColumn( tr( "Last Seen" ) );
77 setColumnAlignment( col_lastseen, AlignCenter ); 78 setColumnAlignment( col_lastseen, AlignCenter );
79 addColumn( tr( "Location" ) );
80 setColumnAlignment( col_location, AlignCenter );
78 setRootIsDecorated( true ); 81 setRootIsDecorated( true );
79 setAllColumnsShowFocus( true ); 82 setAllColumnsShowFocus( true );
80 83
@@ -113,7 +116,13 @@ void MScanListView::serializeFrom( QDataStream& s)
113} 116}
114 117
115 118
116void MScanListView::addNewItem( const QString& type, const QString& essid, const OMacAddress& mac, bool wep, int channel, int signal ) 119void MScanListView::addNewItem( const QString& type,
120 const QString& essid,
121 const OMacAddress& mac,
122 bool wep,
123 int channel,
124 int signal,
125 const GpsLocation& loc )
117{ 126{
118 QString macaddr = mac.toString(true); 127 QString macaddr = mac.toString(true);
119 128
@@ -179,6 +188,7 @@ void MScanListView::addNewItem( const QString& type, const QString& essid, const
179 188
180 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); 189 MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
181 station->setManufacturer( mac.manufacturer() ); 190 station->setManufacturer( mac.manufacturer() );
191 station->setLocation( loc.latitude, loc.longitude );
182 192
183 if ( type == "managed" ) 193 if ( type == "managed" )
184 { 194 {
@@ -468,6 +478,15 @@ void MScanListItem::setManufacturer( const QString& manufacturer )
468} 478}
469 479
470 480
481void MScanListItem::setLocation( const float& latitude, const float& longitude )
482{
483 if ( latitude == 0.0 || longitude == 0.0 )
484 setText( col_location, "N/A" );
485 else
486 setText( col_location, QString().sprintf( "%.2f / %.2f", latitude, longitude ) );
487}
488
489
471void MScanListItem::playSound( const QString& sound ) const 490void MScanListItem::playSound( const QString& sound ) const
472{ 491{
473 #ifdef QWS 492 #ifdef QWS