summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager
authorharlekin <harlekin>2003-03-07 22:55:36 (UTC)
committer harlekin <harlekin>2003-03-07 22:55:36 (UTC)
commitee1d48a9a5f3672f329301a844e69f2e184afcac (patch) (side-by-side diff)
treea549cd37f837e2704527b7b40a0f9f8ef9372a7b /noncore/net/opietooth/manager
parenteeb28ead6d3050d662783696661d9360a049104f (diff)
downloadopie-ee1d48a9a5f3672f329301a844e69f2e184afcac.zip
opie-ee1d48a9a5f3672f329301a844e69f2e184afcac.tar.gz
opie-ee1d48a9a5f3672f329301a844e69f2e184afcac.tar.bz2
show signal strength for connections
Diffstat (limited to 'noncore/net/opietooth/manager') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp40
-rw-r--r--noncore/net/opietooth/manager/bluebase.h5
-rw-r--r--noncore/net/opietooth/manager/bluetoothbase.ui14
-rw-r--r--noncore/net/opietooth/manager/btconnectionitem.cpp18
-rw-r--r--noncore/net/opietooth/manager/btconnectionitem.h8
5 files changed, 80 insertions, 5 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 8b15c4f..9663b52 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -74,2 +74,4 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) );
+ connect( m_localDevice, SIGNAL( signalStrength( const QString&, const QString& ) ),
+ this, SLOT( addSignalStrength( const QString&, const QString& ) ) );
@@ -100,2 +102,3 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
+
writeToHciConfig();
@@ -103,2 +106,3 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
addConnectedDevices();
+ addSignalStrength();
m_iconLoader = new BTIconLoader();
@@ -372,3 +376,4 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item ) {
/**
- * Overloaded. This one it the one that is connected to the foundServices signal
+ * Overloaded. This one it the one that is
+ ted to the foundServices signal
* @param device the mac address of the remote device
@@ -427,2 +432,25 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
+
+
+
+void BlueBase::addSignalStrength() {
+
+ QListViewItemIterator it( ListView4 );
+ for ( ; it.current(); ++it ) {
+ m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() );
+ }
+
+ QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
+}
+
+void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) {
+
+ QListViewItemIterator it( ListView4 );
+ for ( ; it.current(); ++it ) {
+ if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) {
+ ((BTConnectionItem*)it.current() )->setSignalStrength( strength );
+ }
+ }
+}
+
/**
@@ -435,3 +463,2 @@ void BlueBase::addConnectedDevices() {
-
/**
@@ -451,4 +478,9 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
for (it = connectionList.begin(); it != connectionList.end(); ++it) {
- connectionItem = new BTConnectionItem( ListView4 , (*it) );
- }
+ connectionItem = new BTConnectionItem( ListView4, (*it) );
+
+ if( m_deviceList.find((*it).mac()).data() ) {
+
+ connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() );
+ }
+ }
} else {
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 0326daf..743062c 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -15,2 +15,3 @@
#include "btdeviceitem.h"
+
#include "popuphelper.h"
@@ -30,2 +31,3 @@ class QTabWidget;
class QCheckBox;
+class BTConnectionItem;
@@ -57,2 +59,3 @@ namespace OpieTooth {
void setInfo();
+
PopupHelper m_popHelper;
@@ -86,2 +89,4 @@ namespace OpieTooth {
void applyConfigChanges();
+ void addSignalStrength();
+ void addSignalStrength( const QString& mac, const QString& strengh );
diff --git a/noncore/net/opietooth/manager/bluetoothbase.ui b/noncore/net/opietooth/manager/bluetoothbase.ui
index 869a9cb..b51c8c6 100644
--- a/noncore/net/opietooth/manager/bluetoothbase.ui
+++ b/noncore/net/opietooth/manager/bluetoothbase.ui
@@ -200,2 +200,16 @@
</column>
+ <column>
+ <property>
+ <name>text</name>
+ <string>Signal</string>
+ </property>
+ <property>
+ <name>clickable</name>
+ <bool>true</bool>
+ </property>
+ <property>
+ <name>resizeable</name>
+ <bool>true</bool>
+ </property>
+ </column>
<property stdset="1">
diff --git a/noncore/net/opietooth/manager/btconnectionitem.cpp b/noncore/net/opietooth/manager/btconnectionitem.cpp
index b57d1b3..c565c47 100644
--- a/noncore/net/opietooth/manager/btconnectionitem.cpp
+++ b/noncore/net/opietooth/manager/btconnectionitem.cpp
@@ -24 +24,19 @@ ConnectionState BTConnectionItem::connection() const {
+void BTConnectionItem::setName( QString name ) {
+ m_name = name;
+ setText( 0, m_name );
+}
+
+QString BTConnectionItem::name() {
+ return m_name;
+}
+
+
+void BTConnectionItem::setSignalStrength( QString strength ) {
+ m_signalStrength = strength;
+ setText( 2, m_signalStrength );
+}
+
+QString BTConnectionItem::signalStrength() {
+ return m_signalStrength;
+}
diff --git a/noncore/net/opietooth/manager/btconnectionitem.h b/noncore/net/opietooth/manager/btconnectionitem.h
index 3c0cd79..9ab745e 100644
--- a/noncore/net/opietooth/manager/btconnectionitem.h
+++ b/noncore/net/opietooth/manager/btconnectionitem.h
@@ -15,7 +15,13 @@ namespace OpieTooth {
QString type()const;
+ QString name();
+ QString signalStrength();
int typeId() const;
ConnectionState connection()const;
+ void setSignalStrength( QString );
+ void setName( QString );
+
private:
ConnectionState m_con;
-
+ QString m_name;
+ QString m_signalStrength;
};