author | mickeyl <mickeyl> | 2003-03-31 14:30:17 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-03-31 14:30:17 (UTC) |
commit | 13e8e8cbaede72948d3901a1a903eba43854d770 (patch) (unidiff) | |
tree | 672679ac87efdfecd4755f712cfd11c2d2abad43 /noncore/net/wellenreiter/gui/scanlist.cpp | |
parent | e609b9726786efe7cd5be0cd6d8d9f4d91703da5 (diff) | |
download | opie-13e8e8cbaede72948d3901a1a903eba43854d770.zip opie-13e8e8cbaede72948d3901a1a903eba43854d770.tar.gz opie-13e8e8cbaede72948d3901a1a903eba43854d770.tar.bz2 |
- initial attempt to autodetect driver
- add possibility to play sounds when receiving beacon and/or found a new network
Diffstat (limited to 'noncore/net/wellenreiter/gui/scanlist.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index be1245e..a006a3c 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -14,12 +14,18 @@ | |||
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "scanlist.h" | 16 | #include "scanlist.h" |
17 | #include "configwindow.h" | ||
17 | 18 | ||
18 | #include <assert.h> | 19 | #include <assert.h> |
19 | #include "manufacturers.h" | 20 | #include "manufacturers.h" |
20 | #include <qdatetime.h> | 21 | #include <qdatetime.h> |
21 | #include <qtextstream.h> | 22 | #include <qtextstream.h> |
22 | 23 | ||
24 | #ifdef QWS | ||
25 | #include <opie/odevice.h> | ||
26 | using namespace Opie; | ||
27 | #endif | ||
28 | |||
23 | MScanListView::MScanListView( QWidget* parent, const char* name ) | 29 | MScanListView::MScanListView( QWidget* parent, const char* name ) |
24 | :OListView( parent, name ), _manufacturerdb( 0 ) | 30 | :OListView( parent, name ), _manufacturerdb( 0 ) |
25 | { | 31 | { |
@@ -142,7 +148,6 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo | |||
142 | else | 148 | else |
143 | { | 149 | { |
144 | s.sprintf( "(i) new network: '%s'", (const char*) essid ); | 150 | s.sprintf( "(i) new network: '%s'", (const char*) essid ); |
145 | |||
146 | network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 ); | 151 | network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 ); |
147 | } | 152 | } |
148 | 153 | ||
@@ -192,6 +197,8 @@ MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QS | |||
192 | _channel( channel ), _signal( signal ), _beacons( 0 ) | 197 | _channel( channel ), _signal( signal ), _beacons( 0 ) |
193 | { | 198 | { |
194 | qDebug( "creating scanlist item" ); | 199 | qDebug( "creating scanlist item" ); |
200 | if ( WellenreiterConfigWindow::instance() && type == "networks" ) | ||
201 | playSound( WellenreiterConfigWindow::instance()->soundOnNetwork() ); | ||
195 | decorateItem( type, essid, macaddr, wep, channel, signal ); | 202 | decorateItem( type, essid, macaddr, wep, channel, signal ); |
196 | } | 203 | } |
197 | 204 | ||
@@ -271,11 +278,24 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, | |||
271 | _signal = 0; | 278 | _signal = 0; |
272 | } | 279 | } |
273 | 280 | ||
281 | |||
274 | void MScanListItem::setManufacturer( const QString& manufacturer ) | 282 | void MScanListItem::setManufacturer( const QString& manufacturer ) |
275 | { | 283 | { |
276 | setText( col_manuf, manufacturer ); | 284 | setText( col_manuf, manufacturer ); |
277 | } | 285 | } |
278 | 286 | ||
287 | |||
288 | void MScanListItem::playSound( const QString& sound ) const | ||
289 | { | ||
290 | #ifdef QWS | ||
291 | if ( sound == "Ignore" ) return; | ||
292 | else if ( sound == "Touch" ) ODevice::inst()->touchSound(); | ||
293 | else if ( sound == "Key" ) ODevice::inst()->keySound(); | ||
294 | else if ( sound == "Alarm" ) ODevice::inst()->alarmSound(); | ||
295 | #endif | ||
296 | } | ||
297 | |||
298 | |||
279 | void MScanListItem::receivedBeacon() | 299 | void MScanListItem::receivedBeacon() |
280 | { | 300 | { |
281 | _beacons++; | 301 | _beacons++; |
@@ -284,5 +304,7 @@ void MScanListItem::receivedBeacon() | |||
284 | #endif | 304 | #endif |
285 | setText( col_sig, QString::number( _beacons ) ); | 305 | setText( col_sig, QString::number( _beacons ) ); |
286 | setText( col_lastseen, QTime::currentTime().toString() ); | 306 | setText( col_lastseen, QTime::currentTime().toString() ); |
307 | if ( WellenreiterConfigWindow::instance() ) | ||
308 | playSound( WellenreiterConfigWindow::instance()->soundOnBeacon() ); | ||
287 | } | 309 | } |
288 | 310 | ||