author | harlekin <harlekin> | 2002-07-20 19:41:55 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-07-20 19:41:55 (UTC) |
commit | 62e980bfddd33cbd66cccd4c013780ec6e964523 (patch) (unidiff) | |
tree | 442a4f3c45505b0cdd159e705e8200a4cf5a0cfc /noncore/net/opietooth/manager | |
parent | 2ba2f7293e6b7b7b54e733ff84e0b57f0dbc3dfc (diff) | |
download | opie-62e980bfddd33cbd66cccd4c013780ec6e964523.zip opie-62e980bfddd33cbd66cccd4c013780ec6e964523.tar.gz opie-62e980bfddd33cbd66cccd4c013780ec6e964523.tar.bz2 |
clear Connection tab before adding each search and documentation updates
Diffstat (limited to 'noncore/net/opietooth/manager') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 598ce16..d2854a1 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -140,21 +140,20 @@ void BlueBase::writeConfig() { | |||
140 | cfg.writeEntry( "enablePagescan" , m_enablePagescan ); | 140 | cfg.writeEntry( "enablePagescan" , m_enablePagescan ); |
141 | cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); | 141 | cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); |
142 | 142 | ||
143 | writeToHciConfig(); | 143 | writeToHciConfig(); |
144 | } | 144 | } |
145 | 145 | ||
146 | /** | ||
147 | * Modify the hcid.conf file to our needs | ||
148 | */ | ||
146 | void BlueBase::writeToHciConfig() { | 149 | void BlueBase::writeToHciConfig() { |
147 | qWarning("writeToHciConfig"); | 150 | qWarning("writeToHciConfig"); |
148 | HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); | 151 | HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); |
149 | hciconf.load(); | 152 | hciconf.load(); |
150 | hciconf.setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); | 153 | hciconf.setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); |
151 | |||
152 | |||
153 | // hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); | ||
154 | |||
155 | hciconf.setName( m_deviceName ); | 154 | hciconf.setName( m_deviceName ); |
156 | hciconf.setEncrypt( m_useEncryption ); | 155 | hciconf.setEncrypt( m_useEncryption ); |
157 | hciconf.setAuth( m_enableAuthentification ); | 156 | hciconf.setAuth( m_enableAuthentification ); |
158 | hciconf.setPscan( m_enablePagescan ); | 157 | hciconf.setPscan( m_enablePagescan ); |
159 | hciconf.setIscan( m_enableInquiryscan ); | 158 | hciconf.setIscan( m_enableInquiryscan ); |
160 | hciconf.save(); | 159 | hciconf.save(); |
@@ -171,12 +170,13 @@ void BlueBase::readSavedDevices() { | |||
171 | DeviceHandler handler; | 170 | DeviceHandler handler; |
172 | loadedDevices = handler.load(); | 171 | loadedDevices = handler.load(); |
173 | 172 | ||
174 | addSearchedDevices( loadedDevices ); | 173 | addSearchedDevices( loadedDevices ); |
175 | } | 174 | } |
176 | 175 | ||
176 | |||
177 | /** | 177 | /** |
178 | * Write the list of allready known devices | 178 | * Write the list of allready known devices |
179 | * | 179 | * |
180 | */ | 180 | */ |
181 | void BlueBase::writeSavedDevices() { | 181 | void BlueBase::writeSavedDevices() { |
182 | QListViewItemIterator it( ListView2 ); | 182 | QListViewItemIterator it( ListView2 ); |
@@ -274,12 +274,13 @@ void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) | |||
274 | /** | 274 | /** |
275 | * Action that is toggled on entrys on click | 275 | * Action that is toggled on entrys on click |
276 | */ | 276 | */ |
277 | void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { | 277 | void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { |
278 | } | 278 | } |
279 | 279 | ||
280 | |||
280 | /** | 281 | /** |
281 | * Action that are toggled on hold (mostly QPopups i guess) | 282 | * Action that are toggled on hold (mostly QPopups i guess) |
282 | */ | 283 | */ |
283 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { | 284 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { |
284 | 285 | ||
285 | QPopupMenu *menu = new QPopupMenu(); | 286 | QPopupMenu *menu = new QPopupMenu(); |
@@ -310,13 +311,14 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
310 | delete item; | 311 | delete item; |
311 | break; | 312 | break; |
312 | } | 313 | } |
313 | delete groups; | 314 | delete groups; |
314 | 315 | ||
315 | } | 316 | } |
316 | /** | 317 | |
318 | /* | ||
317 | * We got service sensitive PopupMenus in our factory | 319 | * We got service sensitive PopupMenus in our factory |
318 | * We will create one through the factory and will insert | 320 | * We will create one through the factory and will insert |
319 | * our Separator + ShowInfo into the menu or create a new | 321 | * our Separator + ShowInfo into the menu or create a new |
320 | * one if the factory returns 0 | 322 | * one if the factory returns 0 |
321 | * PopupMenu deletion is kind of weird. | 323 | * PopupMenu deletion is kind of weird. |
322 | * If escaped( -1 ) or any of our items were chosen we'll | 324 | * If escaped( -1 ) or any of our items were chosen we'll |
@@ -360,16 +362,17 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
360 | delete item; | 362 | delete item; |
361 | } | 363 | } |
362 | } | 364 | } |
363 | delete menu; | 365 | delete menu; |
364 | } | 366 | } |
365 | 367 | ||
366 | /** | 368 | |
367 | * Search and display avail. services for a device (on expand from device listing) | 369 | /** |
368 | * | 370 | * Search and display avail. services for a device (on expand from device listing) |
369 | */ | 371 | * @param item the service item returned |
372 | */ | ||
370 | void BlueBase::addServicesToDevice( BTDeviceItem * item ) { | 373 | void BlueBase::addServicesToDevice( BTDeviceItem * item ) { |
371 | qDebug("addServicesToDevice"); | 374 | qDebug("addServicesToDevice"); |
372 | // row of mac adress text(3) | 375 | // row of mac adress text(3) |
373 | RemoteDevice device = item->remoteDevice(); | 376 | RemoteDevice device = item->remoteDevice(); |
374 | m_deviceList.insert( item->mac() , item ); | 377 | m_deviceList.insert( item->mac() , item ); |
375 | // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back | 378 | // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back |
@@ -427,13 +430,21 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
427 | */ | 430 | */ |
428 | void BlueBase::addConnectedDevices() { | 431 | void BlueBase::addConnectedDevices() { |
429 | m_localDevice->searchConnections(); | 432 | m_localDevice->searchConnections(); |
430 | } | 433 | } |
431 | 434 | ||
432 | 435 | ||
436 | /** | ||
437 | * This adds the found connections to the connection tab. | ||
438 | * @param connectionList the ValueList with all current connections | ||
439 | */ | ||
433 | void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) { | 440 | void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) { |
441 | |||
442 | // clear the ListView first | ||
443 | ListView4->clear(); | ||
444 | |||
434 | QValueList<OpieTooth::ConnectionState>::Iterator it; | 445 | QValueList<OpieTooth::ConnectionState>::Iterator it; |
435 | BTConnectionItem * connectionItem; | 446 | BTConnectionItem * connectionItem; |
436 | 447 | ||
437 | if ( !connectionList.isEmpty() ) { | 448 | if ( !connectionList.isEmpty() ) { |
438 | 449 | ||
439 | for (it = connectionList.begin(); it != connectionList.end(); ++it) { | 450 | for (it = connectionList.begin(); it != connectionList.end(); ++it) { |
@@ -446,21 +457,24 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
446 | } | 457 | } |
447 | 458 | ||
448 | // recall connection search after some time | 459 | // recall connection search after some time |
449 | QTimer::singleShot( 20000, this, SLOT( addConnectedDevices() ) ); | 460 | QTimer::singleShot( 20000, this, SLOT( addConnectedDevices() ) ); |
450 | } | 461 | } |
451 | 462 | ||
463 | |||
452 | /** | 464 | /** |
453 | * Find out if a device can currently be reached | 465 | * Find out if a device can currently be reached |
466 | * @param device | ||
454 | */ | 467 | */ |
455 | void BlueBase::deviceActive( const RemoteDevice &device ) { | 468 | void BlueBase::deviceActive( const RemoteDevice &device ) { |
456 | // search by mac, async, gets a signal back | 469 | // search by mac, async, gets a signal back |
457 | // We should have a BTDeviceItem there or where does it get added to the map -zecke | 470 | // We should have a BTDeviceItem there or where does it get added to the map -zecke |
458 | m_localDevice->isAvailable( device.mac() ); | 471 | m_localDevice->isAvailable( device.mac() ); |
459 | } | 472 | } |
460 | 473 | ||
474 | |||
461 | /** | 475 | /** |
462 | * The signal catcher. Set the avail. status on device. | 476 | * The signal catcher. Set the avail. status on device. |
463 | * @param device - the mac address | 477 | * @param device - the mac address |
464 | * @param connected - if it is avail. or not | 478 | * @param connected - if it is avail. or not |
465 | */ | 479 | */ |
466 | void BlueBase::deviceActive( const QString& device, bool connected ) { | 480 | void BlueBase::deviceActive( const QString& device, bool connected ) { |
@@ -480,12 +494,13 @@ void BlueBase::deviceActive( const QString& device, bool connected ) { | |||
480 | } else { | 494 | } else { |
481 | deviceItem->setPixmap( 1, m_offPix ); | 495 | deviceItem->setPixmap( 1, m_offPix ); |
482 | } | 496 | } |
483 | m_deviceList.remove( it ); | 497 | m_deviceList.remove( it ); |
484 | } | 498 | } |
485 | 499 | ||
500 | |||
486 | /** | 501 | /** |
487 | * Open the "scan for devices" dialog | 502 | * Open the "scan for devices" dialog |
488 | */ | 503 | */ |
489 | void BlueBase::startScan() { | 504 | void BlueBase::startScan() { |
490 | ScanDialog *scan = new ScanDialog( this, "ScanDialog", | 505 | ScanDialog *scan = new ScanDialog( this, "ScanDialog", |
491 | true, WDestructiveClose ); | 506 | true, WDestructiveClose ); |
@@ -500,20 +515,22 @@ void BlueBase::startScan() { | |||
500 | * Set the informations about the local device in information Tab | 515 | * Set the informations about the local device in information Tab |
501 | */ | 516 | */ |
502 | void BlueBase::setInfo() { | 517 | void BlueBase::setInfo() { |
503 | StatusLabel->setText( status() ); | 518 | StatusLabel->setText( status() ); |
504 | } | 519 | } |
505 | 520 | ||
521 | |||
506 | /** | 522 | /** |
507 | * Decontructor | 523 | * Decontructor |
508 | */ | 524 | */ |
509 | BlueBase::~BlueBase() { | 525 | BlueBase::~BlueBase() { |
510 | writeSavedDevices(); | 526 | writeSavedDevices(); |
511 | delete m_iconLoader; | 527 | delete m_iconLoader; |
512 | } | 528 | } |
513 | 529 | ||
530 | |||
514 | /** | 531 | /** |
515 | * find searches the ListView for a BTDeviceItem containig | 532 | * find searches the ListView for a BTDeviceItem containig |
516 | * the same Device if found return true else false | 533 | * the same Device if found return true else false |
517 | * @param dev RemoteDevice to find | 534 | * @param dev RemoteDevice to find |
518 | * @return returns true if found | 535 | * @return returns true if found |
519 | */ | 536 | */ |