summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/bluebase.cpp
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp68
1 files changed, 15 insertions, 53 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index d023302..2001db1 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -44,3 +44,3 @@
44#include <remotedevice.h> 44#include <remotedevice.h>
45 45#include <services.h>
46 46
@@ -48,3 +48,2 @@ namespace OpieTooth {
48 48
49
50 BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 49 BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
@@ -61,3 +60,2 @@ namespace OpieTooth {
61 this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); 60 this, SLOT( startServiceActionClicked( QListViewItem* ) ) );
62 // hehe, cast right later
63 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), 61 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ),
@@ -72,3 +70,2 @@ namespace OpieTooth {
72 //Load all icons needed 70 //Load all icons needed
73
74 offPix = Resource::loadPixmap( "editdelete" ); 71 offPix = Resource::loadPixmap( "editdelete" );
@@ -96,2 +93,3 @@ namespace OpieTooth {
96 (void) new BTListItem( topLV2, "BlueNiC" , "", "service" ); 93 (void) new BTListItem( topLV2, "BlueNiC" , "", "service" );
94
97 writeToHciConfig(); 95 writeToHciConfig();
@@ -99,4 +97,4 @@ namespace OpieTooth {
99 addConnectedDevices(); 97 addConnectedDevices();
100 } 98 iconLoader = new BTIconLoader();
101 99 }
102 100
@@ -110,3 +108,2 @@ namespace OpieTooth {
110 108
111
112 deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with 109 deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with
@@ -117,3 +114,2 @@ namespace OpieTooth {
117 enableInquiryscan = cfg.readNumEntry( "enableInquiryscan" , 1 ); 114 enableInquiryscan = cfg.readNumEntry( "enableInquiryscan" , 1 );
118
119 } 115 }
@@ -125,3 +121,2 @@ namespace OpieTooth {
125 121
126
127 Config cfg( "bluetoothmanager" ); 122 Config cfg( "bluetoothmanager" );
@@ -212,3 +207,2 @@ namespace OpieTooth {
212 void BlueBase::writeSavedDevices() { 207 void BlueBase::writeSavedDevices() {
213
214 QListViewItemIterator it( ListView2 ); 208 QListViewItemIterator it( ListView2 );
@@ -216,8 +210,5 @@ namespace OpieTooth {
216 for ( ; it.current(); ++it ) { 210 for ( ; it.current(); ++it ) {
217
218 // seperate config file for each device, to store more information in future. 211 // seperate config file for each device, to store more information in future.
219// TO FIX: BTLISTITEM!!!
220 qDebug( "/Settings/bluetooth/" + (((BTListItem*)it.current())->mac()) + ".conf"); 212 qDebug( "/Settings/bluetooth/" + (((BTListItem*)it.current())->mac()) + ".conf");
221 Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + (((BTListItem*)it.current())->mac()) + ".conf", Config::File ); 213 Config conf( QDir::homeDirPath() + "/Settings/bluetooth/" + (((BTListItem*)it.current())->mac()) + ".conf", Config::File );
222
223 conf.setGroup( "Info" ); 214 conf.setGroup( "Info" );
@@ -232,5 +223,3 @@ namespace OpieTooth {
232 void BlueBase::initGui() { 223 void BlueBase::initGui() {
233
234 StatusLabel->setText( getStatus() ); // maybe move it to getStatus() 224 StatusLabel->setText( getStatus() ); // maybe move it to getStatus()
235
236 cryptCheckBox->setChecked( useEncryption ); 225 cryptCheckBox->setChecked( useEncryption );
@@ -251,3 +240,2 @@ namespace OpieTooth {
251 QString BlueBase::getStatus(){ 240 QString BlueBase::getStatus(){
252
253 QString infoString = tr( "<b>Device name : </b> Ipaq" ); 241 QString infoString = tr( "<b>Device name : </b> Ipaq" );
@@ -264,3 +252,2 @@ namespace OpieTooth {
264 void BlueBase::applyConfigChanges() { 252 void BlueBase::applyConfigChanges() {
265
266 deviceName = deviceNameLine->text(); 253 deviceName = deviceNameLine->text();
@@ -274,3 +261,2 @@ namespace OpieTooth {
274 261
275
276 QMessageBox* box = new QMessageBox( this, "Test" ); 262 QMessageBox* box = new QMessageBox( this, "Test" );
@@ -278,5 +264,3 @@ namespace OpieTooth {
278 box->show(); 264 box->show();
279 // falls nötig hcid killhupen - die funktionalität adden 265 }
280 }
281
282 266
@@ -287,5 +271,3 @@ namespace OpieTooth {
287 void BlueBase::addSearchedDevices( QList<RemoteDevice> &newDevices ) { 271 void BlueBase::addSearchedDevices( QList<RemoteDevice> &newDevices ) {
288
289 BTListItem * deviceItem; 272 BTListItem * deviceItem;
290
291 QListIterator<RemoteDevice> it( newDevices ); 273 QListIterator<RemoteDevice> it( newDevices );
@@ -294,3 +276,2 @@ namespace OpieTooth {
294 276
295
296 RemoteDevice *dev = it.current(); 277 RemoteDevice *dev = it.current();
@@ -312,4 +293,2 @@ namespace OpieTooth {
312 void BlueBase::startServiceActionClicked( QListViewItem *item ) { 293 void BlueBase::startServiceActionClicked( QListViewItem *item ) {
313
314
315 } 294 }
@@ -322,8 +301,4 @@ namespace OpieTooth {
322 QPopupMenu *menu = new QPopupMenu(); 301 QPopupMenu *menu = new QPopupMenu();
323
324 int ret=0; 302 int ret=0;
325 303
326
327 //QSize s = menu->sizeHint ( );
328
329 if ( ((BTListItem*)item)->type() == "device") { 304 if ( ((BTListItem*)item)->type() == "device") {
@@ -334,4 +309,4 @@ namespace OpieTooth {
334 menu->insertItem( tr("to group"), groups , 1); 309 menu->insertItem( tr("to group"), groups , 1);
335 menu->insertItem( tr("delete"), 2); 310 menu->insertItem( tr("bound device"), 2);
336 311 menu->insertItem( tr("delete"), 3);
337 312
@@ -345,2 +320,5 @@ namespace OpieTooth {
345 case 2: 320 case 2:
321 // make connection
322 break;
323 case 3:
346 // delete childs too 324 // delete childs too
@@ -369,3 +347,2 @@ namespace OpieTooth {
369 } 347 }
370
371 delete menu; 348 delete menu;
@@ -378,3 +355,2 @@ namespace OpieTooth {
378 void BlueBase::addServicesToDevice( BTListItem * item ) { 355 void BlueBase::addServicesToDevice( BTListItem * item ) {
379
380 qDebug("addServicesToDevice"); 356 qDebug("addServicesToDevice");
@@ -382,9 +358,6 @@ namespace OpieTooth {
382 RemoteDevice *device = new RemoteDevice( item->mac(), item->name() ); 358 RemoteDevice *device = new RemoteDevice( item->mac(), item->name() );
383
384 deviceList.insert( item->mac() , item ); 359 deviceList.insert( item->mac() , item );
385
386 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back 360 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back
387 localDevice->searchServices( *device ); 361 localDevice->searchServices( *device );
388 362 delete device;
389 // delete
390 } 363 }
@@ -398,3 +371,2 @@ namespace OpieTooth {
398 void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) { 371 void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) {
399
400 qDebug("fill services list"); 372 qDebug("fill services list");
@@ -402,4 +374,3 @@ namespace OpieTooth {
402 QMap<QString,BTListItem*>::Iterator it; 374 QMap<QString,BTListItem*>::Iterator it;
403 375 BTListItem* deviceItem = 0;
404 BTListItem* deviceItem;
405 376
@@ -413,3 +384,2 @@ namespace OpieTooth {
413 QValueList<OpieTooth::Services>::Iterator it2; 384 QValueList<OpieTooth::Services>::Iterator it2;
414
415 BTListItem * serviceItem; 385 BTListItem * serviceItem;
@@ -420,3 +390,3 @@ namespace OpieTooth {
420 serviceItem = new BTListItem( deviceItem , (*it2).serviceName() , "" , "service" ); 390 serviceItem = new BTListItem( deviceItem , (*it2).serviceName() , "" , "service" );
421 //serviceItem->setText(4, "service"); 391 serviceItem->setPixmap( 0, iconLoader->serviceIcon( (*it2).classIdList() ) );
422 } 392 }
@@ -424,3 +394,2 @@ namespace OpieTooth {
424 serviceItem = new BTListItem( deviceItem , tr("no services found"), "" , "service" ); 394 serviceItem = new BTListItem( deviceItem , tr("no services found"), "" , "service" );
425 //serviceItem->setText(4, "service");
426 } 395 }
@@ -439,3 +408,2 @@ namespace OpieTooth {
439 void BlueBase::addConnectedDevices( Connection::ValueList connectionList ) { 408 void BlueBase::addConnectedDevices( Connection::ValueList connectionList ) {
440
441 QValueList<OpieTooth::Connection>::Iterator it; 409 QValueList<OpieTooth::Connection>::Iterator it;
@@ -460,3 +428,2 @@ namespace OpieTooth {
460 void BlueBase::deviceActive( RemoteDevice *device ) { 428 void BlueBase::deviceActive( RemoteDevice *device ) {
461
462 // search by mac, async, gets a signal back 429 // search by mac, async, gets a signal back
@@ -471,3 +438,2 @@ namespace OpieTooth {
471 void BlueBase::deviceActive( const QString& device, bool connected ) { 438 void BlueBase::deviceActive( const QString& device, bool connected ) {
472
473 qDebug("deviceActive slot"); 439 qDebug("deviceActive slot");
@@ -475,4 +441,3 @@ namespace OpieTooth {
475 QMap<QString,BTListItem*>::Iterator it; 441 QMap<QString,BTListItem*>::Iterator it;
476 442 BTListItem* deviceItem = 0;
477 BTListItem* deviceItem;
478 443
@@ -490,7 +455,4 @@ namespace OpieTooth {
490 } 455 }
491
492 } 456 }
493 457
494
495
496 /** 458 /**
@@ -499,3 +461,2 @@ namespace OpieTooth {
499 void BlueBase::startScan() { 461 void BlueBase::startScan() {
500
501 ScanDialog *scan = new ScanDialog( this, "", true); 462 ScanDialog *scan = new ScanDialog( this, "", true);
@@ -520,2 +481,3 @@ namespace OpieTooth {
520 writeSavedDevices(); 481 writeSavedDevices();
482 delete iconLoader;
521 } 483 }