Diffstat (limited to 'noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp | 41 |
1 files changed, 28 insertions, 13 deletions
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 | |||
@@ -4,6 +4,9 @@ | |||
4 | #include "rfcommconfhandler.h" | 4 | #include "rfcommconfhandler.h" |
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> |
9 | 12 | ||
@@ -16,5 +19,6 @@ using namespace OpieTooth; | |||
16 | 19 | ||
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 | ||
20 | m_range = 5; | 24 | m_range = 5; |
@@ -34,6 +38,8 @@ RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool | |||
34 | } | 38 | } |
35 | 39 | ||
36 | RfcommAssignDialog::~RfcommAssignDialog() { | 40 | RfcommAssignDialog::~RfcommAssignDialog() |
37 | if ( confHandler ) { | 41 | { |
42 | if ( confHandler ) | ||
43 | { | ||
38 | delete confHandler; | 44 | delete confHandler; |
39 | } | 45 | } |
@@ -41,19 +47,23 @@ RfcommAssignDialog::~RfcommAssignDialog() { | |||
41 | 47 | ||
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 | ||
47 | QMap<QString, RfCommConfObject*>::Iterator it; | 55 | QMap<QString, RfCommConfObject*>::Iterator it; |
48 | it = confHandler->foundEntries().find( QString("%1").arg( i ) ); | 56 | it = confHandler->foundEntries().find( QString("%1").arg( i ) ); |
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 ); |
54 | newDev->setIdent( i ); | 63 | newDev->setIdent( i ); |
55 | newDev->setMac( mac ); | 64 | newDev->setMac( 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 ); |
59 | m_itemList.insert( i , rfcomm ); | 69 | m_itemList.insert( i , rfcomm ); |
@@ -68,9 +78,11 @@ void RfcommAssignDialog::newDevice( const QString & mac ) { | |||
68 | } | 78 | } |
69 | 79 | ||
70 | void RfcommAssignDialog::loadConfig() { | 80 | void RfcommAssignDialog::loadConfig() |
81 | { | ||
71 | 82 | ||
72 | //Config cfg( "bluetoothmanager-rfcommbind" ); | 83 | //Config cfg( "bluetoothmanager-rfcommbind" ); |
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 ) ); |
76 | RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); | 88 | RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); |
@@ -79,5 +91,6 @@ void RfcommAssignDialog::loadConfig() { | |||
79 | QMap<QString, RfCommConfObject*>::Iterator it; | 91 | QMap<QString, RfCommConfObject*>::Iterator it; |
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() " ); |
83 | rfcomm->setMac( it.data()->mac() ); | 96 | rfcomm->setMac( it.data()->mac() ); |
@@ -94,5 +107,6 @@ void RfcommAssignDialog::loadConfig() { | |||
94 | 107 | ||
95 | 108 | ||
96 | void RfcommAssignDialog::saveConfig() { | 109 | void RfcommAssignDialog::saveConfig() |
110 | { | ||
97 | 111 | ||
98 | //Config cfg( "bluetoothmanager-rfcommbind" ); | 112 | //Config cfg( "bluetoothmanager-rfcommbind" ); |
@@ -102,5 +116,6 @@ void RfcommAssignDialog::saveConfig() { | |||
102 | QMap< QString, RfCommConfObject*> outMap; | 116 | QMap< QString, RfCommConfObject*> outMap; |
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 | ||
106 | //cfg.setGroup( QString("%1").arg( it.key() ) ); | 121 | //cfg.setGroup( QString("%1").arg( it.key() ) ); |