author | mickeyl <mickeyl> | 2003-09-09 13:42:04 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-09-09 13:42:04 (UTC) |
commit | 807165ababca1b8c93b88d6b41f75ec96ce5e799 (patch) (unidiff) | |
tree | 5042886f052d34d7d79bf4e784f87cbad171c86c /noncore/net/wellenreiter/gui/scanlist.cpp | |
parent | fca4c73a5f0c672db9150f312eb85f1299e80e1b (diff) | |
download | opie-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.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 | |||
@@ -47,6 +47,7 @@ const int col_ip = 6; | |||
47 | const int col_manuf = 7; | 47 | const int col_manuf = 7; |
48 | const int col_firstseen = 8; | 48 | const int col_firstseen = 8; |
49 | const int col_lastseen = 9; | 49 | const int col_lastseen = 9; |
50 | const int col_location = 10; | ||
50 | 51 | ||
51 | MScanListView::MScanListView( QWidget* parent, const char* name ) | 52 | MScanListView::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 | ||
116 | void MScanListView::addNewItem( const QString& type, const QString& essid, const OMacAddress& mac, bool wep, int channel, int signal ) | 119 | void 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 | ||
481 | void 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 | |||
471 | void MScanListItem::playSound( const QString& sound ) const | 490 | void MScanListItem::playSound( const QString& sound ) const |
472 | { | 491 | { |
473 | #ifdef QWS | 492 | #ifdef QWS |