-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 6 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.h | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/btlistitem.cpp | 11 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/btlistitem.h | 6 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/manager.pro | 4 |
5 files changed, 16 insertions, 13 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 772dbd1..77eb62b 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp @@ -41,49 +41,50 @@ #include <qpe/config.h> #include <remotedevice.h> namespace OpieTooth { BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) : BluetoothBase( parent, name, fl ) { localDevice = new Manager( "hci0" ); connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); // not good since lib is async // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), // this, SLOT( addServicesToDevice( QListViewItem * ) ) ); connect( ListView2, SIGNAL( clicked( QListViewItem* )), this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) ); connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); - + // connect( localDevice, SIGNAL( available( const QString& device, bool connected ) ), + // this, SLOT() ); //Load all icons needed offPix = Resource::loadPixmap( "editdelete" ); onPix = Resource::loadPixmap( "installed" ); QPalette pal = this->palette(); QColor col = pal.color( QPalette::Active, QColorGroup::Background ); pal.setColor( QPalette::Active, QColorGroup::Button, col ); pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); pal.setColor( QPalette::Normal, QColorGroup::Button, col ); pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); this->setPalette( pal ); setCaption( tr( "Bluetooth Manager" ) ); readConfig(); initGui(); //TESTING ListView2->setRootIsDecorated(true); QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" ); topLV2->setPixmap( 1, onPix ); @@ -379,48 +380,51 @@ namespace OpieTooth { /** * Add the existing connections (pairs) to the connections tab. * */ void BlueBase::addConnectedDevices() { //mac address } /** * Find out if a device can currently be reached */ bool BlueBase::deviceActive( RemoteDevice *device ) { // search by mac localDevice->isAvailable( device->mac() ); return true; } + + + /** * Open the "scan for devices" dialog */ void BlueBase::startScan() { ScanDialog *scan = new ScanDialog( this, "", true); QObject::connect( scan, SIGNAL( selectedDevices( QList<RemoteDevice>& ) ), this, SLOT( addSearchedDevices( QList<RemoteDevice>& ) ) ); scan->showMaximized(); } /** * Set the informations about the local device in information Tab */ void BlueBase::setInfo() { StatusLabel->setText( getStatus() ); } /** * Decontructor */ BlueBase::~BlueBase() { diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h index bc48bb3..dee721d 100644 --- a/noncore/net/opietooth/manager/bluebase.h +++ b/noncore/net/opietooth/manager/bluebase.h @@ -6,50 +6,48 @@ #include <qwidget.h> #include <qscrollview.h> #include <qsplitter.h> #include <qlist.h> #include <qpixmap.h> #include "bluetoothbase.h" #include <remotedevice.h> #include <manager.h> class QVBox; class QHBoxLayout; class QGridLayout; class QFrame; class QLabel; class QPushButton; class QTabWidget; class QCheckBox; namespace OpieTooth { - - class BlueBase : public BluetoothBase { Q_OBJECT public: BlueBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~BlueBase(); protected: private slots: void startScan(); private: void readConfig(); void writeConfig(); void readSavedDevices(); void writeSavedDevices(); QString getStatus(); void initGui(); void setInfo(); Manager *localDevice; QMap<QString,QListViewItem*> deviceList; diff --git a/noncore/net/opietooth/manager/btlistitem.cpp b/noncore/net/opietooth/manager/btlistitem.cpp index 4901710..19d1057 100644 --- a/noncore/net/opietooth/manager/btlistitem.cpp +++ b/noncore/net/opietooth/manager/btlistitem.cpp @@ -1,30 +1,33 @@ #include "btlistitem.h" namespace OpieTooth { BTListItem::BTListItem( QListView * parent ) : QListViewItem( parent ) { } BTListItem::BTListItem( QListViewItem * parent ) : QListViewItem( parent ) { } // name, and then mac and then servicetype BTListItem::BTListItem( QListView * parent, QString name , QString mac, QString type ) - : QListViewItem( parent, name, mac, type ){ + : QListViewItem( parent, name ){ + setText(4, mac); + setText(5, type); } BTListItem::BTListItem( QListViewItem * parent , QString name, QString mac, QString type ) - : QListViewItem( parent, name, mac, type ){ - + : QListViewItem( parent, name ){ + setText(4, mac); + setText(5, type); } BTListItem::~BTListItem() { } -} +}; diff --git a/noncore/net/opietooth/manager/btlistitem.h b/noncore/net/opietooth/manager/btlistitem.h index 28612b0..92b3803 100644 --- a/noncore/net/opietooth/manager/btlistitem.h +++ b/noncore/net/opietooth/manager/btlistitem.h @@ -1,24 +1,22 @@ #ifndef BTLISTITEM_H #define BTLISTITEM_H #include <qlistview.h> namespace OpieTooth { class BTListItem : public QListViewItem { - Q_OBJECT public: - BTListItem( QListView * parent ); BTListItem( QListViewItem * parent ); // name, and then mac and then servicetype BTListItem( QListView * , QString, QString, QString ); BTListItem( QListViewItem * parent , QString, QString , QString ); ~BTListItem(); - } -} + }; +}; #endif diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro index 1d86684..3754869 100644 --- a/noncore/net/opietooth/manager/manager.pro +++ b/noncore/net/opietooth/manager/manager.pro @@ -1,12 +1,12 @@ TEMPLATE = app CONFIG = qt warn_on debug #CONFIG = qt warn_on release -HEADERS = bluebase.h scandialog.h -SOURCES = main.cpp bluebase.cpp scandialog.cpp +HEADERS = bluebase.h scandialog.h btlistitem.h +SOURCES = main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp INCLUDEPATH += $(OPIEDIR)/include INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib DEPENDPATH += $(OPIEDIR)/include LIBS += -lqpe -lopietooth -lopie INTERFACES = bluetoothbase.ui devicedialog.ui TARGET = $(OPIEDIR)/bin/bluetooth-manager |