summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/scanlist.cpp
authormickeyl <mickeyl>2003-03-31 14:30:17 (UTC)
committer mickeyl <mickeyl>2003-03-31 14:30:17 (UTC)
commit13e8e8cbaede72948d3901a1a903eba43854d770 (patch) (side-by-side diff)
tree672679ac87efdfecd4755f712cfd11c2d2abad43 /noncore/net/wellenreiter/gui/scanlist.cpp
parente609b9726786efe7cd5be0cd6d8d9f4d91703da5 (diff)
downloadopie-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.cpp24
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 @@
**********************************************************************/
#include "scanlist.h"
+#include "configwindow.h"
#include <assert.h>
#include "manufacturers.h"
#include <qdatetime.h>
#include <qtextstream.h>
+#ifdef QWS
+#include <opie/odevice.h>
+using namespace Opie;
+#endif
+
MScanListView::MScanListView( QWidget* parent, const char* name )
:OListView( parent, name ), _manufacturerdb( 0 )
{
@@ -142,7 +148,6 @@ void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bo
else
{
s.sprintf( "(i) new network: '%s'", (const char*) essid );
-
network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 );
}
@@ -192,6 +197,8 @@ MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QS
_channel( channel ), _signal( signal ), _beacons( 0 )
{
qDebug( "creating scanlist item" );
+ if ( WellenreiterConfigWindow::instance() && type == "networks" )
+ playSound( WellenreiterConfigWindow::instance()->soundOnNetwork() );
decorateItem( type, essid, macaddr, wep, channel, signal );
}
@@ -271,11 +278,24 @@ void MScanListItem::decorateItem( QString type, QString essid, QString macaddr,
_signal = 0;
}
+
void MScanListItem::setManufacturer( const QString& manufacturer )
{
setText( col_manuf, manufacturer );
}
+
+void MScanListItem::playSound( const QString& sound ) const
+{
+ #ifdef QWS
+ if ( sound == "Ignore" ) return;
+ else if ( sound == "Touch" ) ODevice::inst()->touchSound();
+ else if ( sound == "Key" ) ODevice::inst()->keySound();
+ else if ( sound == "Alarm" ) ODevice::inst()->alarmSound();
+ #endif
+}
+
+
void MScanListItem::receivedBeacon()
{
_beacons++;
@@ -284,5 +304,7 @@ void MScanListItem::receivedBeacon()
#endif
setText( col_sig, QString::number( _beacons ) );
setText( col_lastseen, QTime::currentTime().toString() );
+ if ( WellenreiterConfigWindow::instance() )
+ playSound( WellenreiterConfigWindow::instance()->soundOnBeacon() );
}