summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp29
-rw-r--r--noncore/net/opietooth/manager/bluebase.h8
2 files changed, 20 insertions, 17 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index c7e1fe4..6328b59 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -47,22 +47,21 @@ namespace OpieTooth {
47 47
48 BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 48 BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
49 : BluetoothBase( parent, name, fl ) { 49 : BluetoothBase( parent, name, fl ) {
50 50
51 localDevice = new Manager( "hci0" ); 51 localDevice = new Manager( "hci0" );
52 52
53 QObject::connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); 53 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) );
54 QObject::connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); 54 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) );
55 QObject::connect( ListView2, SIGNAL( expanded( QListViewItem * item ) ), 55 connect( ListView2, SIGNAL( expanded ( QListViewItem *item ) ),
56 this, SLOT( addServicesToDevice( QListViewItem * item ) ) ); 56 this, SLOT( addServicesToDevice( QListViewItem *item ) ) );
57 QObject::connect( ListView2, SIGNAL( clicked( QListViewItem * )), 57 connect( ListView2, SIGNAL( clicked( QListViewItem* )),
58 this, SLOT( startServiceActionClicked( QListViewItem * item ) ) ); 58 this, SLOT( startServiceActionClicked( QListViewItem *item ) ) );
59 connect( localDevice, SIGNAL( foundServices( const QString& device, Services::ValueList ) ), 59 connect( localDevice, SIGNAL( foundServices( const QString& device, Services::ValueList ) ),
60 this, SLOT( addServicesToDevice( const QString& device, Services::ValueList ) ) ); 60 this, SLOT( addServicesToDevice( const QString& device, Services::ValueList ) ) );
61 61
62 // QObject::connect( (QObject*) Manager, SIGNAL (foundServices( const QString& device, Services::ValueList ), this () ) );
63 62
64 //Load all icons needed 63 //Load all icons needed
65 64
66 65
67 QPixmap offPix = Resource::loadPixmap( "editdelete" ); 66 QPixmap offPix = Resource::loadPixmap( "editdelete" );
68 QPixmap onPix = Resource::loadPixmap( "installed" ); 67 QPixmap onPix = Resource::loadPixmap( "installed" );
@@ -84,14 +83,14 @@ namespace OpieTooth {
84 //TESTING 83 //TESTING
85 84
86 ListView2->setRootIsDecorated(true); 85 ListView2->setRootIsDecorated(true);
87 86
88 QListViewItem *topLV = new QListViewItem( ListView2, "Harlekins Dongle" , "yes"); 87 QListViewItem *topLV = new QListViewItem( ListView2, "Harlekins Dongle" , "yes");
89 topLV->setPixmap( 0, offPix ); 88 topLV->setPixmap( 0, offPix );
90 (void) new QListViewItem( topLV, "on" ); 89 // (void) new QListViewItem( topLV, "on" );
91 (void) new QListViewItem( topLV, "off" ); 90 //(void) new QListViewItem( topLV, "off" );
92 91
93 QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" ); 92 QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" );
94 topLV2->setPixmap( 0, onPix ); 93 topLV2->setPixmap( 0, onPix );
95 (void) new QListViewItem( topLV2, "on" ); 94 (void) new QListViewItem( topLV2, "on" );
96 (void) new QListViewItem( topLV2, "off" ); 95 (void) new QListViewItem( topLV2, "off" );
97 96
@@ -236,21 +235,24 @@ namespace OpieTooth {
236 QListIterator<RemoteDevice> it( newDevices ); 235 QListIterator<RemoteDevice> it( newDevices );
237 236
238 for( ; it.current() ; ++it ) { 237 for( ; it.current() ; ++it ) {
239 238
240 239
241 RemoteDevice *dev = it.current(); 240 RemoteDevice *dev = it.current();
242 deviceItem = new QListViewItem( ListView2, dev->name() ); 241 deviceItem = new QListViewItem( ListView2 , dev->name() );
243 242
244 if ( deviceActive( dev ) ) { 243 if ( deviceActive( dev ) ) {
245 deviceItem->setPixmap( 1 , onPix ); 244 deviceItem->setPixmap( 1 , onPix );
246 } else { 245 } else {
247 deviceItem->setPixmap( 1, offPix ); 246 deviceItem->setPixmap( 1, offPix );
248 } 247 }
249 248
250 deviceItem->setText( 3, dev->mac() ); 249 deviceItem->setText( 3, dev->mac() );
250
251 // ggf auch hier?
252 addServicesToDevice( deviceItem );
251 } 253 }
252 } 254 }
253 255
254 256
255 /* 257 /*
256 * Action that is toggled on entrys on click 258 * Action that is toggled on entrys on click
@@ -271,12 +273,13 @@ namespace OpieTooth {
271 /* 273 /*
272 * Search and display avail. services for a device (on expand from device listing) 274 * Search and display avail. services for a device (on expand from device listing)
273 * 275 *
274 */ 276 */
275 void BlueBase::addServicesToDevice( QListViewItem * item ) { 277 void BlueBase::addServicesToDevice( QListViewItem * item ) {
276 278
279 qDebug("addServicesToDevice");
277 // row of mac adress 280 // row of mac adress
278 RemoteDevice *device = new RemoteDevice(item->text(3), item->text(0)); 281 RemoteDevice *device = new RemoteDevice(item->text(3), item->text(0));
279 282
280 deviceList.insert( item->text(3) , item ); 283 deviceList.insert( item->text(3) , item );
281 284
282// and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back 285// and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back
@@ -310,14 +313,14 @@ namespace OpieTooth {
310 313
311 314
312 315
313 QListViewItem * serviceItem; 316 QListViewItem * serviceItem;
314 317
315 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) { 318 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) {
316 it2.serviceName() 319// it2.serviceName()
317 serviceItem = new QListViewItem( deviceItem , it2.serviceName() ); 320 serviceItem = new QListViewItem( deviceItem , (*it2).serviceName() );
318 } 321 }
319 322
320 } 323 }
321 324
322 325
323 /* 326 /*
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index dcb7681..d20d05c 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -62,18 +62,18 @@ namespace OpieTooth {
62 int enablePagescan; 62 int enablePagescan;
63 int enableInquiryscan; 63 int enableInquiryscan;
64 64
65 QPixmap offPix; 65 QPixmap offPix;
66 QPixmap onPix; 66 QPixmap onPix;
67 67
68 private slots: 68 public slots:
69 void addSearchedDevices( QList<RemoteDevice> &newDevices ); 69 void addSearchedDevices( QList<RemoteDevice> &newDevices );
70 void addServicesToDevice( QListViewItem * item ); 70 void addServicesToDevice( QListViewItem *item );
71 void addServicesToDevice( const QString& device, Services::ValueList ); 71 void addServicesToDevice( const QString& device, Services::ValueList );
72 void startServiceActionClicked( QListViewItem * item ); 72 void startServiceActionClicked( QListViewItem *item );
73 void startServiceActionHold( QListViewItem * item, const QPoint & point, int column); 73 void startServiceActionHold( QListViewItem *item, const QPoint &point, int column);
74 void applyConfigChanges(); 74 void applyConfigChanges();
75 75
76 }; 76 };
77 77
78} 78}
79 79