author | ar <ar> | 2004-02-21 15:27:41 (UTC) |
---|---|---|
committer | ar <ar> | 2004-02-21 15:27:41 (UTC) |
commit | 460258f203be746ff79e14f32a823f381b8ea513 (patch) (side-by-side diff) | |
tree | 87dddbacda3050027d343730cf021b53045e80cb /noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp | |
parent | 76b70b355d2c1c32c0f74e844e0654e39db2a175 (diff) | |
download | opie-460258f203be746ff79e14f32a823f381b8ea513.zip opie-460258f203be746ff79e14f32a823f381b8ea513.tar.gz opie-460258f203be746ff79e14f32a823f381b8ea513.tar.bz2 |
improve support for BigScreen
Diffstat (limited to 'noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp | 51 |
1 files changed, 33 insertions, 18 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 @@ #include "rfcommconfhandler.h" +/* OPIE */ #include <qpe/config.h> +#include <qpe/qpeapplication.h> +/* QT */ #include <qlayout.h> @@ -16,5 +19,6 @@ using namespace OpieTooth; RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) - : RfcommAssignDialogBase( parent, name, modal, fl ) { + : RfcommAssignDialogBase( parent, name, modal, fl ) +{ m_range = 5; @@ -34,6 +38,8 @@ RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool } -RfcommAssignDialog::~RfcommAssignDialog() { - if ( confHandler ) { +RfcommAssignDialog::~RfcommAssignDialog() +{ + if ( confHandler ) + { delete confHandler; } @@ -41,19 +47,23 @@ RfcommAssignDialog::~RfcommAssignDialog() { -void RfcommAssignDialog::newDevice( const QString & mac ) { +void RfcommAssignDialog::newDevice( const QString & mac ) +{ - for ( int i = 0 ; i < m_range; i++ ) { + for ( int i = 0 ; i < m_range; i++ ) + { QMap<QString, RfCommConfObject*>::Iterator it; it = confHandler->foundEntries().find( QString("%1").arg( i ) ); // make sure that rfcommX is not assigned yet - if ( it == confHandler->foundEntries().end() ) { + if ( it == confHandler->foundEntries().end() ) + { QDialog dialog( this, "newdevice", true, WStyle_ContextHelp ); - dialog.showMaximized(); + RfcommDialogItem *newDev = new RfcommDialogItem( &dialog ); newDev->setIdent( i ); newDev->setMac( mac ); - if ( dialog.exec() == QDialog::Accepted ) { + if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted ) + { RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); m_itemList.insert( i , rfcomm ); @@ -68,9 +78,11 @@ void RfcommAssignDialog::newDevice( const QString & mac ) { } -void RfcommAssignDialog::loadConfig() { +void RfcommAssignDialog::loadConfig() +{ //Config cfg( "bluetoothmanager-rfcommbind" ); - for ( int i = 0 ; i < m_range; i++ ) { + for ( int i = 0 ; i < m_range; i++ ) + { // cfg.setGroup( QString("%1").arg( i ) ); RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); @@ -79,5 +91,6 @@ void RfcommAssignDialog::loadConfig() { QMap<QString, RfCommConfObject*>::Iterator it; it = confHandler->foundEntries().find( QString("%1").arg( i ) ); - if ( it != confHandler->foundEntries().end() ) { + if ( it != confHandler->foundEntries().end() ) + { qDebug( "Found key in foundEntries() " ); rfcomm->setMac( it.data()->mac() ); @@ -85,14 +98,15 @@ void RfcommAssignDialog::loadConfig() { rfcomm->setComment( it.data()->comment() ); } - /* Use rfcomm.conf directly for now - * rfcomm->setMac( cfg.readEntry( "mac", "" ) ); - * rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) ); - * rfcomm->setComment( cfg.readEntry( "comment", "" ) ); - */ + /* Use rfcomm.conf directly for now + * rfcomm->setMac( cfg.readEntry( "mac", "" ) ); + * rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) ); + * rfcomm->setComment( cfg.readEntry( "comment", "" ) ); + */ } } -void RfcommAssignDialog::saveConfig() { +void RfcommAssignDialog::saveConfig() +{ //Config cfg( "bluetoothmanager-rfcommbind" ); @@ -102,5 +116,6 @@ void RfcommAssignDialog::saveConfig() { QMap< QString, RfCommConfObject*> outMap; - for( it = m_itemList.begin(); it != m_itemList.end(); ++it ) { + for( it = m_itemList.begin(); it != m_itemList.end(); ++it ) + { //cfg.setGroup( QString("%1").arg( it.key() ) ); |