summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/scanlist.cpp
authormickeyl <mickeyl>2003-09-09 13:42:04 (UTC)
committer mickeyl <mickeyl>2003-09-09 13:42:04 (UTC)
commit807165ababca1b8c93b88d6b41f75ec96ce5e799 (patch) (side-by-side diff)
tree5042886f052d34d7d79bf4e784f87cbad171c86c /noncore/net/wellenreiter/gui/scanlist.cpp
parentfca4c73a5f0c672db9150f312eb85f1299e80e1b (diff)
downloadopie-807165ababca1b8c93b88d6b41f75ec96ce5e799.zip
opie-807165ababca1b8c93b88d6b41f75ec96ce5e799.tar.gz
opie-807165ababca1b8c93b88d6b41f75ec96ce5e799.tar.bz2
reading GPS data from gpsd is now working. TODO: save the data
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;
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 )
@@ -75,6 +76,8 @@ MScanListView::MScanListView( QWidget* parent, const char* name )
setColumnAlignment( col_firstseen, AlignCenter );
addColumn( tr( "Last Seen" ) );
setColumnAlignment( col_lastseen, AlignCenter );
+ addColumn( tr( "Location" ) );
+ setColumnAlignment( col_location, AlignCenter );
setRootIsDecorated( true );
setAllColumnsShowFocus( true );
@@ -113,7 +116,13 @@ void MScanListView::serializeFrom( QDataStream& 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);
@@ -179,6 +188,7 @@ void MScanListView::addNewItem( const QString& type, const QString& essid, const
MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal );
station->setManufacturer( mac.manufacturer() );
+ station->setLocation( loc.latitude, loc.longitude );
if ( type == "managed" )
{
@@ -468,6 +478,15 @@ void MScanListItem::setManufacturer( const QString& 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