-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 201 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/obexpopup.cpp | 22 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp | 41 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/rfcpopup.cpp | 35 |
4 files changed, 193 insertions, 106 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 2e68984..0ea45d2 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -24,7 +24,8 @@ | |||
24 | 24 | ||
25 | #include <remotedevice.h> | 25 | /* OPIE */ |
26 | #include <services.h> | 26 | #include <qpe/qpeapplication.h> |
27 | 27 | #include <qpe/resource.h> | |
28 | #include <stdlib.h> | 28 | #include <qpe/config.h> |
29 | 29 | ||
30 | /* QT */ | ||
30 | #include <qframe.h> | 31 | #include <qframe.h> |
@@ -48,6 +49,6 @@ | |||
48 | 49 | ||
49 | #include <qpe/qpeapplication.h> | 50 | /* STD */ |
50 | #include <qpe/resource.h> | 51 | #include <remotedevice.h> |
51 | #include <qpe/config.h> | 52 | #include <services.h> |
52 | 53 | #include <stdlib.h> | |
53 | 54 | ||
@@ -56,3 +57,4 @@ using namespace OpieTooth; | |||
56 | BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | 57 | BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) |
57 | : BluetoothBase( parent, name, fl ) { | 58 | : BluetoothBase( parent, name, fl ) |
59 | { | ||
58 | 60 | ||
@@ -117,3 +119,4 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
117 | */ | 119 | */ |
118 | void BlueBase::readConfig() { | 120 | void BlueBase::readConfig() |
121 | { | ||
119 | 122 | ||
@@ -133,3 +136,4 @@ void BlueBase::readConfig() { | |||
133 | */ | 136 | */ |
134 | void BlueBase::writeConfig() { | 137 | void BlueBase::writeConfig() |
138 | { | ||
135 | 139 | ||
@@ -151,3 +155,4 @@ void BlueBase::writeConfig() { | |||
151 | */ | 155 | */ |
152 | void BlueBase::writeToHciConfig() { | 156 | void BlueBase::writeToHciConfig() |
157 | { | ||
153 | qWarning("writeToHciConfig"); | 158 | qWarning("writeToHciConfig"); |
@@ -168,3 +173,4 @@ void BlueBase::writeToHciConfig() { | |||
168 | */ | 173 | */ |
169 | void BlueBase::readSavedDevices() { | 174 | void BlueBase::readSavedDevices() |
175 | { | ||
170 | 176 | ||
@@ -181,3 +187,4 @@ void BlueBase::readSavedDevices() { | |||
181 | */ | 187 | */ |
182 | void BlueBase::writeSavedDevices() { | 188 | void BlueBase::writeSavedDevices() |
189 | { | ||
183 | QListViewItemIterator it( ListView2 ); | 190 | QListViewItemIterator it( ListView2 ); |
@@ -186,3 +193,4 @@ void BlueBase::writeSavedDevices() { | |||
186 | RemoteDevice::ValueList list; | 193 | RemoteDevice::ValueList list; |
187 | for ( ; it.current(); ++it ) { | 194 | for ( ; it.current(); ++it ) |
195 | { | ||
188 | item = (BTListItem*)it.current(); | 196 | item = (BTListItem*)it.current(); |
@@ -207,3 +215,4 @@ void BlueBase::writeSavedDevices() { | |||
207 | */ | 215 | */ |
208 | void BlueBase::initGui() { | 216 | void BlueBase::initGui() |
217 | { | ||
209 | StatusLabel->setText( status() ); // maybe move it to getStatus() | 218 | StatusLabel->setText( status() ); // maybe move it to getStatus() |
@@ -224,3 +233,4 @@ void BlueBase::initGui() { | |||
224 | */ | 233 | */ |
225 | QString BlueBase::status()const{ | 234 | QString BlueBase::status()const |
235 | { | ||
226 | QString infoString = tr( "<b>Device name : </b> Ipaq" ); | 236 | QString infoString = tr( "<b>Device name : </b> Ipaq" ); |
@@ -236,3 +246,4 @@ QString BlueBase::status()const{ | |||
236 | */ | 246 | */ |
237 | void BlueBase::applyConfigChanges() { | 247 | void BlueBase::applyConfigChanges() |
248 | { | ||
238 | m_deviceName = deviceNameLine->text(); | 249 | m_deviceName = deviceNameLine->text(); |
@@ -253,8 +264,8 @@ void BlueBase::applyConfigChanges() { | |||
253 | */ | 264 | */ |
254 | void BlueBase::rfcommDialog() { | 265 | void BlueBase::rfcommDialog() |
266 | { | ||
255 | RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); | 267 | RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); |
256 | 268 | ||
257 | rfcommAssign.showMaximized(); | 269 | if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted ) |
258 | 270 | { | |
259 | if ( rfcommAssign.exec() == QDialog::Accepted ) { | ||
260 | rfcommAssign.saveConfig(); | 271 | rfcommAssign.saveConfig(); |
@@ -267,3 +278,4 @@ void BlueBase::rfcommDialog() { | |||
267 | */ | 278 | */ |
268 | void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) { | 279 | void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) |
280 | { | ||
269 | BTDeviceItem * deviceItem; | 281 | BTDeviceItem * deviceItem; |
@@ -271,3 +283,4 @@ void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) | |||
271 | 283 | ||
272 | for( it = newDevices.begin(); it != newDevices.end() ; ++it ) { | 284 | for( it = newDevices.begin(); it != newDevices.end() ; ++it ) |
285 | { | ||
273 | 286 | ||
@@ -292,4 +305,4 @@ void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) | |||
292 | */ | 305 | */ |
293 | void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { | 306 | void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) |
294 | } | 307 | {} |
295 | 308 | ||
@@ -299,3 +312,4 @@ void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { | |||
299 | */ | 312 | */ |
300 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { | 313 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) |
314 | { | ||
301 | if (!item ) | 315 | if (!item ) |
@@ -306,3 +320,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
306 | 320 | ||
307 | if ( ((BTListItem*)item)->type() == "device") { | 321 | if ( ((BTListItem*)item)->type() == "device") |
322 | { | ||
308 | 323 | ||
@@ -318,3 +333,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
318 | 333 | ||
319 | switch(ret) { | 334 | switch(ret) |
335 | { | ||
320 | case -1: | 336 | case -1: |
@@ -345,3 +361,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
345 | */ | 361 | */ |
346 | else if ( ((BTListItem*)item)->type() == "service") { | 362 | else if ( ((BTListItem*)item)->type() == "service") |
363 | { | ||
347 | BTServiceItem* service = (BTServiceItem*)item; | 364 | BTServiceItem* service = (BTServiceItem*)item; |
@@ -350,3 +367,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
350 | QPopupMenu *popup =0l; | 367 | QPopupMenu *popup =0l; |
351 | if ( it != list.end() ) { | 368 | if ( it != list.end() ) |
369 | { | ||
352 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); | 370 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); |
@@ -355,3 +373,5 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
355 | (BTDeviceItem*)service->parent() ); | 373 | (BTDeviceItem*)service->parent() ); |
356 | }else { | 374 | } |
375 | else | ||
376 | { | ||
357 | qWarning("Empty"); | 377 | qWarning("Empty"); |
@@ -359,3 +379,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
359 | 379 | ||
360 | if ( popup == 0l ) { | 380 | if ( popup == 0l ) |
381 | { | ||
361 | qWarning("factory returned 0l"); | 382 | qWarning("factory returned 0l"); |
@@ -367,5 +388,8 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
367 | qWarning("returned from exec() "); | 388 | qWarning("returned from exec() "); |
368 | if ( ret == -1 ) { | 389 | if ( ret == -1 ) |
390 | { | ||
369 | ; | 391 | ; |
370 | } else if ( ret == test1 ) { | 392 | } |
393 | else if ( ret == test1 ) | ||
394 | { | ||
371 | ; | 395 | ; |
@@ -382,3 +406,4 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
382 | */ | 406 | */ |
383 | void BlueBase::addServicesToDevice( BTDeviceItem * item ) { | 407 | void BlueBase::addServicesToDevice( BTDeviceItem * item ) |
408 | { | ||
384 | qDebug("addServicesToDevice"); | 409 | qDebug("addServicesToDevice"); |
@@ -398,3 +423,4 @@ void BlueBase::addServicesToDevice( BTDeviceItem * item ) { | |||
398 | */ | 423 | */ |
399 | void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) { | 424 | void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) |
425 | { | ||
400 | qDebug("fill services list"); | 426 | qDebug("fill services list"); |
@@ -414,3 +440,4 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
414 | QListViewItem * child = deviceItem->firstChild(); | 440 | QListViewItem * child = deviceItem->firstChild(); |
415 | while( child ) { | 441 | while( child ) |
442 | { | ||
416 | tempList.append( child ); | 443 | tempList.append( child ); |
@@ -424,3 +451,4 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
424 | 451 | ||
425 | if (!servicesList.isEmpty() ) { | 452 | if (!servicesList.isEmpty() ) |
453 | { | ||
426 | // add services | 454 | // add services |
@@ -428,3 +456,4 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
428 | QMap<int, QString>::Iterator classIt; | 456 | QMap<int, QString>::Iterator classIt; |
429 | for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) { | 457 | for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) |
458 | { | ||
430 | serviceItem = new BTServiceItem( deviceItem, (*it2) ); | 459 | serviceItem = new BTServiceItem( deviceItem, (*it2) ); |
@@ -433,3 +462,4 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
433 | int classId=0; | 462 | int classId=0; |
434 | if ( classIt != list.end() ) { | 463 | if ( classIt != list.end() ) |
464 | { | ||
435 | classId = classIt.key(); | 465 | classId = classIt.key(); |
@@ -439,3 +469,5 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
439 | } | 469 | } |
440 | } else { | 470 | } |
471 | else | ||
472 | { | ||
441 | Services s1; | 473 | Services s1; |
@@ -452,6 +484,8 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s | |||
452 | 484 | ||
453 | void BlueBase::addSignalStrength() { | 485 | void BlueBase::addSignalStrength() |
486 | { | ||
454 | 487 | ||
455 | QListViewItemIterator it( ListView4 ); | 488 | QListViewItemIterator it( ListView4 ); |
456 | for ( ; it.current(); ++it ) { | 489 | for ( ; it.current(); ++it ) |
490 | { | ||
457 | m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() ); | 491 | m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() ); |
@@ -462,7 +496,10 @@ void BlueBase::addSignalStrength() { | |||
462 | 496 | ||
463 | void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) { | 497 | void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) |
498 | { | ||
464 | 499 | ||
465 | QListViewItemIterator it( ListView4 ); | 500 | QListViewItemIterator it( ListView4 ); |
466 | for ( ; it.current(); ++it ) { | 501 | for ( ; it.current(); ++it ) |
467 | if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) { | 502 | { |
503 | if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) | ||
504 | { | ||
468 | ((BTConnectionItem*)it.current() )->setSignalStrength( strength ); | 505 | ((BTConnectionItem*)it.current() )->setSignalStrength( strength ); |
@@ -476,3 +513,4 @@ void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) | |||
476 | */ | 513 | */ |
477 | void BlueBase::addConnectedDevices() { | 514 | void BlueBase::addConnectedDevices() |
515 | { | ||
478 | m_localDevice->searchConnections(); | 516 | m_localDevice->searchConnections(); |
@@ -484,3 +522,4 @@ void BlueBase::addConnectedDevices() { | |||
484 | */ | 522 | */ |
485 | void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) { | 523 | void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) |
524 | { | ||
486 | 525 | ||
@@ -489,5 +528,7 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
489 | 528 | ||
490 | if ( !connectionList.isEmpty() ) { | 529 | if ( !connectionList.isEmpty() ) |
530 | { | ||
491 | 531 | ||
492 | for (it = connectionList.begin(); it != connectionList.end(); ++it) { | 532 | for (it = connectionList.begin(); it != connectionList.end(); ++it) |
533 | { | ||
493 | 534 | ||
@@ -495,4 +536,6 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
495 | bool found = false; | 536 | bool found = false; |
496 | for ( ; it2.current(); ++it2 ) { | 537 | for ( ; it2.current(); ++it2 ) |
497 | if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() ) { | 538 | { |
539 | if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() ) | ||
540 | { | ||
498 | found = true; | 541 | found = true; |
@@ -501,6 +544,8 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
501 | 544 | ||
502 | if ( found == false ) { | 545 | if ( found == false ) |
546 | { | ||
503 | connectionItem = new BTConnectionItem( ListView4, (*it) ); | 547 | connectionItem = new BTConnectionItem( ListView4, (*it) ); |
504 | 548 | ||
505 | if( m_deviceList.find((*it).mac()).data() ) { | 549 | if( m_deviceList.find((*it).mac()).data() ) |
550 | { | ||
506 | connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() ); | 551 | connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() ); |
@@ -512,6 +557,9 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
512 | QListViewItemIterator it2( ListView4 ); | 557 | QListViewItemIterator it2( ListView4 ); |
513 | for ( ; it2.current(); ++it2 ) { | 558 | for ( ; it2.current(); ++it2 ) |
559 | { | ||
514 | bool found = false; | 560 | bool found = false; |
515 | for (it = connectionList.begin(); it != connectionList.end(); ++it) { | 561 | for (it = connectionList.begin(); it != connectionList.end(); ++it) |
516 | if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) { | 562 | { |
563 | if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) | ||
564 | { | ||
517 | found = true; | 565 | found = true; |
@@ -520,3 +568,4 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
520 | 568 | ||
521 | if ( !found ) { | 569 | if ( !found ) |
570 | { | ||
522 | delete it2.current(); | 571 | delete it2.current(); |
@@ -527,3 +576,5 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
527 | 576 | ||
528 | } else { | 577 | } |
578 | else | ||
579 | { | ||
529 | ListView4->clear(); | 580 | ListView4->clear(); |
@@ -543,3 +594,4 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) | |||
543 | */ | 594 | */ |
544 | void BlueBase::deviceActive( const RemoteDevice &device ) { | 595 | void BlueBase::deviceActive( const RemoteDevice &device ) |
596 | { | ||
545 | // search by mac, async, gets a signal back | 597 | // search by mac, async, gets a signal back |
@@ -555,3 +607,4 @@ void BlueBase::deviceActive( const RemoteDevice &device ) { | |||
555 | */ | 607 | */ |
556 | void BlueBase::deviceActive( const QString& device, bool connected ) { | 608 | void BlueBase::deviceActive( const QString& device, bool connected ) |
609 | { | ||
557 | qDebug("deviceActive slot"); | 610 | qDebug("deviceActive slot"); |
@@ -567,5 +620,8 @@ void BlueBase::deviceActive( const QString& device, bool connected ) { | |||
567 | 620 | ||
568 | if ( connected ) { | 621 | if ( connected ) |
622 | { | ||
569 | deviceItem->setPixmap( 1, m_onPix ); | 623 | deviceItem->setPixmap( 1, m_onPix ); |
570 | } else { | 624 | } |
625 | else | ||
626 | { | ||
571 | deviceItem->setPixmap( 1, m_offPix ); | 627 | deviceItem->setPixmap( 1, m_offPix ); |
@@ -579,3 +635,4 @@ void BlueBase::deviceActive( const QString& device, bool connected ) { | |||
579 | */ | 635 | */ |
580 | void BlueBase::startScan() { | 636 | void BlueBase::startScan() |
637 | { | ||
581 | ScanDialog *scan = new ScanDialog( this, "ScanDialog", | 638 | ScanDialog *scan = new ScanDialog( this, "ScanDialog", |
@@ -585,3 +642,3 @@ void BlueBase::startScan() { | |||
585 | 642 | ||
586 | scan->showMaximized(); | 643 | QPEApplication::showDialog( scan ); |
587 | } | 644 | } |
@@ -592,3 +649,4 @@ void BlueBase::startScan() { | |||
592 | */ | 649 | */ |
593 | void BlueBase::setInfo() { | 650 | void BlueBase::setInfo() |
651 | { | ||
594 | StatusLabel->setText( status() ); | 652 | StatusLabel->setText( status() ); |
@@ -600,3 +658,4 @@ void BlueBase::setInfo() { | |||
600 | */ | 658 | */ |
601 | BlueBase::~BlueBase() { | 659 | BlueBase::~BlueBase() |
660 | { | ||
602 | writeSavedDevices(); | 661 | writeSavedDevices(); |
@@ -612,3 +671,4 @@ BlueBase::~BlueBase() { | |||
612 | */ | 671 | */ |
613 | bool BlueBase::find( const RemoteDevice& rem ) { | 672 | bool BlueBase::find( const RemoteDevice& rem ) |
673 | { | ||
614 | QListViewItemIterator it( ListView2 ); | 674 | QListViewItemIterator it( ListView2 ); |
@@ -616,3 +676,4 @@ bool BlueBase::find( const RemoteDevice& rem ) { | |||
616 | BTDeviceItem* device; | 676 | BTDeviceItem* device; |
617 | for (; it.current(); ++it ) { | 677 | for (; it.current(); ++it ) |
678 | { | ||
618 | item = (BTListItem*) it.current(); | 679 | item = (BTListItem*) it.current(); |
diff --git a/noncore/net/opietooth/manager/obexpopup.cpp b/noncore/net/opietooth/manager/obexpopup.cpp index a550648..d147d52 100644 --- a/noncore/net/opietooth/manager/obexpopup.cpp +++ b/noncore/net/opietooth/manager/obexpopup.cpp | |||
@@ -1,4 +1,2 @@ | |||
1 | 1 | ||
2 | #include <qtimer.h> | ||
3 | |||
4 | #include "obexdialog.h" | 2 | #include "obexdialog.h" |
@@ -6,2 +4,8 @@ | |||
6 | 4 | ||
5 | /* OPIE */ | ||
6 | #include <qpe/qpeapplication.h> | ||
7 | |||
8 | /* QT */ | ||
9 | #include <qtimer.h> | ||
10 | |||
7 | using namespace OpieTooth; | 11 | using namespace OpieTooth; |
@@ -12,3 +16,4 @@ using namespace OpieTooth; | |||
12 | ObexPopup::ObexPopup() | 16 | ObexPopup::ObexPopup() |
13 | : QPopupMenu() { | 17 | : QPopupMenu() |
18 | { | ||
14 | qWarning("RfcCommPopup c'tor"); | 19 | qWarning("RfcCommPopup c'tor"); |
@@ -26,7 +31,8 @@ ObexPopup::ObexPopup() | |||
26 | 31 | ||
27 | ObexPopup::~ObexPopup() { | 32 | ObexPopup::~ObexPopup() |
28 | } | 33 | {} |
29 | 34 | ||
30 | 35 | ||
31 | void ObexPopup::slotPush() { | 36 | void ObexPopup::slotPush() |
37 | { | ||
32 | 38 | ||
@@ -34,6 +40,4 @@ void ObexPopup::slotPush() { | |||
34 | 40 | ||
35 | |||
36 | ObexDialog obexDialog; | 41 | ObexDialog obexDialog; |
37 | obexDialog.showMaximized(); | 42 | QPEApplication::execDialog( &obexDialog ); |
38 | obexDialog.exec(); | ||
39 | } | 43 | } |
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp index b5cc074..fc76301 100644 --- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp +++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp | |||
@@ -5,4 +5,7 @@ | |||
5 | 5 | ||
6 | /* OPIE */ | ||
6 | #include <qpe/config.h> | 7 | #include <qpe/config.h> |
8 | #include <qpe/qpeapplication.h> | ||
7 | 9 | ||
10 | /* QT */ | ||
8 | #include <qlayout.h> | 11 | #include <qlayout.h> |
@@ -17,3 +20,4 @@ using namespace OpieTooth; | |||
17 | RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 20 | RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
18 | : RfcommAssignDialogBase( parent, name, modal, fl ) { | 21 | : RfcommAssignDialogBase( parent, name, modal, fl ) |
22 | { | ||
19 | 23 | ||
@@ -35,4 +39,6 @@ RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool | |||
35 | 39 | ||
36 | RfcommAssignDialog::~RfcommAssignDialog() { | 40 | RfcommAssignDialog::~RfcommAssignDialog() |
37 | if ( confHandler ) { | 41 | { |
42 | if ( confHandler ) | ||
43 | { | ||
38 | delete confHandler; | 44 | delete confHandler; |
@@ -42,5 +48,7 @@ RfcommAssignDialog::~RfcommAssignDialog() { | |||
42 | 48 | ||
43 | void RfcommAssignDialog::newDevice( const QString & mac ) { | 49 | void RfcommAssignDialog::newDevice( const QString & mac ) |
50 | { | ||
44 | 51 | ||
45 | for ( int i = 0 ; i < m_range; i++ ) { | 52 | for ( int i = 0 ; i < m_range; i++ ) |
53 | { | ||
46 | 54 | ||
@@ -49,5 +57,6 @@ void RfcommAssignDialog::newDevice( const QString & mac ) { | |||
49 | // make sure that rfcommX is not assigned yet | 57 | // make sure that rfcommX is not assigned yet |
50 | if ( it == confHandler->foundEntries().end() ) { | 58 | if ( it == confHandler->foundEntries().end() ) |
59 | { | ||
51 | QDialog dialog( this, "newdevice", true, WStyle_ContextHelp ); | 60 | QDialog dialog( this, "newdevice", true, WStyle_ContextHelp ); |
52 | dialog.showMaximized(); | 61 | |
53 | RfcommDialogItem *newDev = new RfcommDialogItem( &dialog ); | 62 | RfcommDialogItem *newDev = new RfcommDialogItem( &dialog ); |
@@ -56,3 +65,4 @@ void RfcommAssignDialog::newDevice( const QString & mac ) { | |||
56 | 65 | ||
57 | if ( dialog.exec() == QDialog::Accepted ) { | 66 | if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted ) |
67 | { | ||
58 | RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); | 68 | RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); |
@@ -69,3 +79,4 @@ void RfcommAssignDialog::newDevice( const QString & mac ) { | |||
69 | 79 | ||
70 | void RfcommAssignDialog::loadConfig() { | 80 | void RfcommAssignDialog::loadConfig() |
81 | { | ||
71 | 82 | ||
@@ -73,3 +84,4 @@ void RfcommAssignDialog::loadConfig() { | |||
73 | 84 | ||
74 | for ( int i = 0 ; i < m_range; i++ ) { | 85 | for ( int i = 0 ; i < m_range; i++ ) |
86 | { | ||
75 | // cfg.setGroup( QString("%1").arg( i ) ); | 87 | // cfg.setGroup( QString("%1").arg( i ) ); |
@@ -80,3 +92,4 @@ void RfcommAssignDialog::loadConfig() { | |||
80 | it = confHandler->foundEntries().find( QString("%1").arg( i ) ); | 92 | it = confHandler->foundEntries().find( QString("%1").arg( i ) ); |
81 | if ( it != confHandler->foundEntries().end() ) { | 93 | if ( it != confHandler->foundEntries().end() ) |
94 | { | ||
82 | qDebug( "Found key in foundEntries() " ); | 95 | qDebug( "Found key in foundEntries() " ); |
@@ -95,3 +108,4 @@ void RfcommAssignDialog::loadConfig() { | |||
95 | 108 | ||
96 | void RfcommAssignDialog::saveConfig() { | 109 | void RfcommAssignDialog::saveConfig() |
110 | { | ||
97 | 111 | ||
@@ -103,3 +117,4 @@ void RfcommAssignDialog::saveConfig() { | |||
103 | 117 | ||
104 | for( it = m_itemList.begin(); it != m_itemList.end(); ++it ) { | 118 | for( it = m_itemList.begin(); it != m_itemList.end(); ++it ) |
119 | { | ||
105 | 120 | ||
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp index d95f14b..04bfe48 100644 --- a/noncore/net/opietooth/manager/rfcpopup.cpp +++ b/noncore/net/opietooth/manager/rfcpopup.cpp | |||
@@ -1,4 +1,2 @@ | |||
1 | 1 | ||
2 | #include <qtimer.h> | ||
3 | |||
4 | #include "pppdialog.h" | 2 | #include "pppdialog.h" |
@@ -7,2 +5,8 @@ | |||
7 | 5 | ||
6 | /* OPIE */ | ||
7 | #include <qpe/qpeapplication.h> | ||
8 | |||
9 | /* QT */ | ||
10 | #include <qtimer.h> | ||
11 | |||
8 | using namespace OpieTooth; | 12 | using namespace OpieTooth; |
@@ -13,3 +17,4 @@ using namespace OpieTooth; | |||
13 | RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item ) | 17 | RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item ) |
14 | : QPopupMenu() { | 18 | : QPopupMenu() |
19 | { | ||
15 | qWarning("RfcCommPopup c'tor"); | 20 | qWarning("RfcCommPopup c'tor"); |
@@ -55,3 +60,4 @@ RfcCommPopup::RfcCommPopup( OpieTooth::BTDeviceItem* item ) | |||
55 | 60 | ||
56 | RfcCommPopup::~RfcCommPopup() { | 61 | RfcCommPopup::~RfcCommPopup() |
62 | { | ||
57 | /* delete m_con; | 63 | /* delete m_con; |
@@ -63,3 +69,4 @@ RfcCommPopup::~RfcCommPopup() { | |||
63 | 69 | ||
64 | void RfcCommPopup::slotConnect() { | 70 | void RfcCommPopup::slotConnect() |
71 | { | ||
65 | 72 | ||
@@ -67,7 +74,4 @@ void RfcCommPopup::slotConnect() { | |||
67 | 74 | ||
68 | |||
69 | |||
70 | PPPDialog pppDialog; | 75 | PPPDialog pppDialog; |
71 | pppDialog.showMaximized(); | 76 | QPEApplication::execDialog( &pppDialog ); |
72 | pppDialog.exec(); | ||
73 | } | 77 | } |
@@ -75,3 +79,4 @@ void RfcCommPopup::slotConnect() { | |||
75 | 79 | ||
76 | void RfcCommPopup::slotDisconnect() { | 80 | void RfcCommPopup::slotDisconnect() |
81 | { | ||
77 | qWarning("slot disconnected"); | 82 | qWarning("slot disconnected"); |
@@ -80,9 +85,10 @@ void RfcCommPopup::slotDisconnect() { | |||
80 | 85 | ||
81 | void RfcCommPopup::slotBind() { | 86 | void RfcCommPopup::slotBind() |
87 | { | ||
82 | RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); | 88 | RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); |
83 | 89 | ||
84 | rfcommAssign.showMaximized(); | ||
85 | rfcommAssign.newDevice( m_item->mac() ); | 90 | rfcommAssign.newDevice( m_item->mac() ); |
86 | 91 | ||
87 | if ( rfcommAssign.exec() == QDialog::Accepted ) { | 92 | if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted ) |
93 | { | ||
88 | rfcommAssign.saveConfig(); | 94 | rfcommAssign.saveConfig(); |
@@ -92,3 +98,4 @@ void RfcCommPopup::slotBind() { | |||
92 | 98 | ||
93 | void RfcCommPopup::slotBar() { | 99 | void RfcCommPopup::slotBar() |
100 | { | ||
94 | qWarning("slotBar"); | 101 | qWarning("slotBar"); |