-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 8 | ||||
-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, 17 insertions, 14 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 | |||
@@ -52,26 +52,27 @@ namespace OpieTooth { | |||
52 | localDevice = new Manager( "hci0" ); | 52 | localDevice = new Manager( "hci0" ); |
53 | 53 | ||
54 | connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); | 54 | connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); |
55 | connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); | 55 | connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); |
56 | // not good since lib is async | 56 | // not good since lib is async |
57 | // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), | 57 | // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), |
58 | // this, SLOT( addServicesToDevice( QListViewItem * ) ) ); | 58 | // this, SLOT( addServicesToDevice( QListViewItem * ) ) ); |
59 | connect( ListView2, SIGNAL( clicked( QListViewItem* )), | 59 | connect( ListView2, SIGNAL( clicked( QListViewItem* )), |
60 | this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); | 60 | this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); |
61 | connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), | 61 | connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), |
62 | this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) ); | 62 | this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) ); |
63 | connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), | 63 | connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), |
64 | this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); | 64 | this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); |
65 | 65 | // connect( localDevice, SIGNAL( available( const QString& device, bool connected ) ), | |
66 | // this, SLOT() ); | ||
66 | 67 | ||
67 | //Load all icons needed | 68 | //Load all icons needed |
68 | 69 | ||
69 | offPix = Resource::loadPixmap( "editdelete" ); | 70 | offPix = Resource::loadPixmap( "editdelete" ); |
70 | onPix = Resource::loadPixmap( "installed" ); | 71 | onPix = Resource::loadPixmap( "installed" ); |
71 | 72 | ||
72 | QPalette pal = this->palette(); | 73 | QPalette pal = this->palette(); |
73 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); | 74 | QColor col = pal.color( QPalette::Active, QColorGroup::Background ); |
74 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); | 75 | pal.setColor( QPalette::Active, QColorGroup::Button, col ); |
75 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); | 76 | pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); |
76 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); | 77 | pal.setColor( QPalette::Normal, QColorGroup::Button, col ); |
77 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); | 78 | pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); |
@@ -391,24 +392,27 @@ namespace OpieTooth { | |||
391 | /** | 392 | /** |
392 | * Find out if a device can currently be reached | 393 | * Find out if a device can currently be reached |
393 | */ | 394 | */ |
394 | bool BlueBase::deviceActive( RemoteDevice *device ) { | 395 | bool BlueBase::deviceActive( RemoteDevice *device ) { |
395 | 396 | ||
396 | // search by mac | 397 | // search by mac |
397 | localDevice->isAvailable( device->mac() ); | 398 | localDevice->isAvailable( device->mac() ); |
398 | 399 | ||
399 | return true; | 400 | return true; |
400 | } | 401 | } |
401 | 402 | ||
402 | 403 | ||
404 | |||
405 | |||
406 | |||
403 | /** | 407 | /** |
404 | * Open the "scan for devices" dialog | 408 | * Open the "scan for devices" dialog |
405 | */ | 409 | */ |
406 | void BlueBase::startScan() { | 410 | void BlueBase::startScan() { |
407 | 411 | ||
408 | ScanDialog *scan = new ScanDialog( this, "", true); | 412 | ScanDialog *scan = new ScanDialog( this, "", true); |
409 | QObject::connect( scan, SIGNAL( selectedDevices( QList<RemoteDevice>& ) ), | 413 | QObject::connect( scan, SIGNAL( selectedDevices( QList<RemoteDevice>& ) ), |
410 | this, SLOT( addSearchedDevices( QList<RemoteDevice>& ) ) ); | 414 | this, SLOT( addSearchedDevices( QList<RemoteDevice>& ) ) ); |
411 | 415 | ||
412 | scan->showMaximized(); | 416 | scan->showMaximized(); |
413 | } | 417 | } |
414 | 418 | ||
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 | |||
@@ -18,26 +18,24 @@ | |||
18 | class QVBox; | 18 | class QVBox; |
19 | class QHBoxLayout; | 19 | class QHBoxLayout; |
20 | class QGridLayout; | 20 | class QGridLayout; |
21 | class QFrame; | 21 | class QFrame; |
22 | class QLabel; | 22 | class QLabel; |
23 | class QPushButton; | 23 | class QPushButton; |
24 | class QTabWidget; | 24 | class QTabWidget; |
25 | class QCheckBox; | 25 | class QCheckBox; |
26 | 26 | ||
27 | 27 | ||
28 | namespace OpieTooth { | 28 | namespace OpieTooth { |
29 | 29 | ||
30 | |||
31 | |||
32 | class BlueBase : public BluetoothBase { | 30 | class BlueBase : public BluetoothBase { |
33 | Q_OBJECT | 31 | Q_OBJECT |
34 | 32 | ||
35 | public: | 33 | public: |
36 | BlueBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 34 | BlueBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
37 | ~BlueBase(); | 35 | ~BlueBase(); |
38 | 36 | ||
39 | protected: | 37 | protected: |
40 | 38 | ||
41 | 39 | ||
42 | private slots: | 40 | private slots: |
43 | void startScan(); | 41 | void startScan(); |
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 | |||
@@ -6,25 +6,28 @@ namespace OpieTooth { | |||
6 | 6 | ||
7 | BTListItem::BTListItem( QListView * parent ) : QListViewItem( parent ) { | 7 | BTListItem::BTListItem( QListView * parent ) : QListViewItem( parent ) { |
8 | 8 | ||
9 | } | 9 | } |
10 | 10 | ||
11 | BTListItem::BTListItem( QListViewItem * parent ) : QListViewItem( parent ) { | 11 | BTListItem::BTListItem( QListViewItem * parent ) : QListViewItem( parent ) { |
12 | 12 | ||
13 | } | 13 | } |
14 | 14 | ||
15 | 15 | ||
16 | // name, and then mac and then servicetype | 16 | // name, and then mac and then servicetype |
17 | BTListItem::BTListItem( QListView * parent, QString name , QString mac, QString type ) | 17 | BTListItem::BTListItem( QListView * parent, QString name , QString mac, QString type ) |
18 | : QListViewItem( parent, name, mac, type ){ | 18 | : QListViewItem( parent, name ){ |
19 | setText(4, mac); | ||
20 | setText(5, type); | ||
19 | 21 | ||
20 | } | 22 | } |
21 | 23 | ||
22 | BTListItem::BTListItem( QListViewItem * parent , QString name, QString mac, QString type ) | 24 | BTListItem::BTListItem( QListViewItem * parent , QString name, QString mac, QString type ) |
23 | : QListViewItem( parent, name, mac, type ){ | 25 | : QListViewItem( parent, name ){ |
24 | 26 | setText(4, mac); | |
27 | setText(5, type); | ||
25 | } | 28 | } |
26 | 29 | ||
27 | BTListItem::~BTListItem() { | 30 | BTListItem::~BTListItem() { |
28 | } | 31 | } |
29 | 32 | ||
30 | } | 33 | }; |
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 @@ | |||
1 | #ifndef BTLISTITEM_H | 1 | #ifndef BTLISTITEM_H |
2 | #define BTLISTITEM_H | 2 | #define BTLISTITEM_H |
3 | 3 | ||
4 | #include <qlistview.h> | 4 | #include <qlistview.h> |
5 | 5 | ||
6 | namespace OpieTooth { | 6 | namespace OpieTooth { |
7 | 7 | ||
8 | class BTListItem : public QListViewItem { | 8 | class BTListItem : public QListViewItem { |
9 | Q_OBJECT | ||
10 | 9 | ||
11 | public: | 10 | public: |
12 | |||
13 | BTListItem( QListView * parent ); | 11 | BTListItem( QListView * parent ); |
14 | BTListItem( QListViewItem * parent ); | 12 | BTListItem( QListViewItem * parent ); |
15 | 13 | ||
16 | // name, and then mac and then servicetype | 14 | // name, and then mac and then servicetype |
17 | BTListItem( QListView * , QString, QString, QString ); | 15 | BTListItem( QListView * , QString, QString, QString ); |
18 | BTListItem( QListViewItem * parent , QString, QString , QString ); | 16 | BTListItem( QListViewItem * parent , QString, QString , QString ); |
19 | ~BTListItem(); | 17 | ~BTListItem(); |
20 | 18 | ||
21 | } | 19 | }; |
22 | } | 20 | }; |
23 | 21 | ||
24 | #endif | 22 | #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 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on debug | 2 | CONFIG = qt warn_on debug |
3 | #CONFIG = qt warn_on release | 3 | #CONFIG = qt warn_on release |
4 | HEADERS = bluebase.h scandialog.h | 4 | HEADERS = bluebase.h scandialog.h btlistitem.h |
5 | SOURCES = main.cpp bluebase.cpp scandialog.cpp | 5 | SOURCES = main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp |
6 | INCLUDEPATH += $(OPIEDIR)/include | 6 | INCLUDEPATH += $(OPIEDIR)/include |
7 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib | 7 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib |
8 | DEPENDPATH += $(OPIEDIR)/include | 8 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe -lopietooth -lopie | 9 | LIBS += -lqpe -lopietooth -lopie |
10 | INTERFACES = bluetoothbase.ui devicedialog.ui | 10 | INTERFACES = bluetoothbase.ui devicedialog.ui |
11 | TARGET = $(OPIEDIR)/bin/bluetooth-manager | 11 | TARGET = $(OPIEDIR)/bin/bluetooth-manager |
12 | 12 | ||