summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/TODO.txt5
-rw-r--r--noncore/net/opietooth/manager/btdeviceitem.cpp2
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp115
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogimpl.h40
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogitem.cpp9
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogitem.h4
-rw-r--r--noncore/net/opietooth/manager/rfcommconfhandler.cpp98
-rw-r--r--noncore/net/opietooth/manager/rfcommconfhandler.h7
-rw-r--r--noncore/net/opietooth/manager/rfcommdialogitembase.ui298
-rw-r--r--noncore/net/opietooth/manager/rfcpopup.cpp3
10 files changed, 349 insertions, 232 deletions
diff --git a/noncore/net/opietooth/manager/TODO.txt b/noncore/net/opietooth/manager/TODO.txt
index e6bd9b1..76fae68 100644
--- a/noncore/net/opietooth/manager/TODO.txt
+++ b/noncore/net/opietooth/manager/TODO.txt
@@ -1,5 +1,4 @@
11. Make bind table edit /etc/bluetooth/rfcomm.conf file. 11. Add an rfcomm port number to the connection dialog.
22. Add an rfcomm port number to the connection dialog. 22. Collect requirements from others.
33. Collect requirements from others.
4 3
5//eof 4//eof
diff --git a/noncore/net/opietooth/manager/btdeviceitem.cpp b/noncore/net/opietooth/manager/btdeviceitem.cpp
index fb1b1c1..c112463 100644
--- a/noncore/net/opietooth/manager/btdeviceitem.cpp
+++ b/noncore/net/opietooth/manager/btdeviceitem.cpp
@@ -1,30 +1,30 @@
1 1
2#include "btdeviceitem.h" 2#include "btdeviceitem.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6 6
7BTDeviceItem::BTDeviceItem( QListView* parent, const RemoteDevice& dev ) 7BTDeviceItem::BTDeviceItem( QListView* parent, const RemoteDevice& dev )
8 : BTListItem( parent ) { 8 : BTListItem( parent ) {
9 9
10 setText( 0, dev.name() ); 10 setText( 0, dev.name().utf8() );
11 m_device = dev; 11 m_device = dev;
12}; 12};
13BTDeviceItem::~BTDeviceItem() { 13BTDeviceItem::~BTDeviceItem() {
14// nothing I'm aware of 14// nothing I'm aware of
15} 15}
16RemoteDevice BTDeviceItem::remoteDevice() const { 16RemoteDevice BTDeviceItem::remoteDevice() const {
17 return m_device; 17 return m_device;
18} 18}
19QString BTDeviceItem::mac()const { 19QString BTDeviceItem::mac()const {
20 return m_device.mac(); 20 return m_device.mac();
21} 21}
22QString BTDeviceItem::name() const { 22QString BTDeviceItem::name() const {
23 return m_device.name(); 23 return m_device.name();
24} 24}
25QString BTDeviceItem::type() const { 25QString BTDeviceItem::type() const {
26 return QString::fromLatin1("device"); 26 return QString::fromLatin1("device");
27} 27}
28int BTDeviceItem::typeId() const { 28int BTDeviceItem::typeId() const {
29 return Device; 29 return Device;
30} 30}
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
index be720b8..7943deb 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
+++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
@@ -1,139 +1,154 @@
1/* $Id$ */
2/* RFCOMM binding table edit dialog */
3/***************************************************************************
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 ***************************************************************************/
1 11
2#include "rfcommassigndialogimpl.h" 12#include "rfcommassigndialogimpl.h"
3#include "rfcommassigndialogitem.h" 13#include "rfcommassigndialogitem.h"
4#include "rfcommconfhandler.h" 14#include "rfcommconfhandler.h"
5 15
6/* OPIE */ 16/* OPIE */
7#include <qpe/config.h> 17#include <qpe/config.h>
8#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
9#include <opie2/odebug.h> 19#include <opie2/odebug.h>
10using namespace Opie::Core; 20using namespace Opie::Core;
11 21
12/* QT */ 22/* QT */
13#include <qlayout.h> 23#include <qlayout.h>
14 24
15using namespace OpieTooth; 25using namespace OpieTooth;
16 26
17// TODO: write only the file in bluebase? 27// TODO: write only the file in bluebase?
18// muss rfcommd dann neu gestartet werden 28// muss rfcommd dann neu gestartet werden
19// sollte rfcomm bind all nicht eh default config sein ( polled das? - d.h. sobald nen gerät in der nähe ist bindet es? 29// sollte rfcomm bind all nicht eh default config sein ( polled das? - d.h. sobald nen gerät in der nähe ist bindet es?
20 30
21 31
22RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 32RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
23 : RfcommAssignDialogBase( parent, name, modal, fl ) 33 : RfcommAssignDialogBase( parent, name, modal, fl )
24{ 34{
25
26 m_range = 5; 35 m_range = 5;
27 36
28 m_scrollView = new QScrollView( this ); 37 m_scrollView = new QScrollView(this);
29 m_scrollView->setResizePolicy( QScrollView::AutoOneFit ); 38 m_scrollView->setResizePolicy( QScrollView::AutoOneFit );
30 m_scrollView->setHScrollBarMode( QScrollView::AlwaysOff ); 39 m_scrollView->setHScrollBarMode( QScrollView::AlwaysOff );
31 40
32 RfcommAssignDialogBaseLayout->addWidget( m_scrollView ); 41 RfcommAssignDialogBaseLayout->addWidget(m_scrollView);
33 42
34 m_box = new QVBox( m_scrollView->viewport() ); 43 m_box = new QVBox(m_scrollView->viewport());
35 m_scrollView->addChild( m_box ); 44 m_scrollView->addChild(m_box);
36 45
37 confHandler = new RfCommConfHandler( "/etc/bluetooth/rfcomm.conf" ); 46 confHandler = new RfCommConfHandler( "/etc/bluetooth/rfcomm.conf" );
38 47
39 loadConfig(); 48 loadConfig();
40} 49}
41 50
42RfcommAssignDialog::~RfcommAssignDialog() 51RfcommAssignDialog::~RfcommAssignDialog()
43{ 52{
44 if ( confHandler ) 53 if ( confHandler )
45 { 54 {
46 delete confHandler; 55 delete confHandler;
47 } 56 }
48} 57}
49 58
50 59
51void RfcommAssignDialog::newDevice( const QString & mac ) 60void RfcommAssignDialog::newDevice(const QString & mac, int channel)
52{ 61{
53 62
54 for ( int i = 0 ; i < m_range; i++ ) 63 for ( int i = 0 ; i < m_range; i++ )
55 { 64 {
56
57 QMap<QString, RfCommConfObject*>::Iterator it; 65 QMap<QString, RfCommConfObject*>::Iterator it;
58 it = confHandler->foundEntries().find( QString("%1").arg( i ) ); 66 it = confHandler->foundEntries().find(QString::number(i));
59 // make sure that rfcommX is not assigned yet 67 // make sure that rfcommX is not assigned yet
60 if ( it == confHandler->foundEntries().end() ) 68 if ( it == confHandler->foundEntries().end() )
61 { 69 {
62 QDialog dialog( this, "newdevice", true, WStyle_ContextHelp ); 70 QDialog dialog( this, "newdevice", true, WStyle_ContextHelp );
63 dialog.setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, 71 dialog.setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7,
64 (QSizePolicy::SizeType)7, sizePolicy().hasHeightForWidth())); 72 (QSizePolicy::SizeType)7, sizePolicy().hasHeightForWidth()));
65 73 QVBoxLayout layout(&dialog);
66 RfcommDialogItem *newDev = new RfcommDialogItem( &dialog ); 74 layout.setSpacing( 0 );
67 newDev->setIdent( i ); 75 layout.setMargin( 0 );
68 newDev->setMac( mac ); 76
77 RfcommDialogItem newDev(&dialog);
78 newDev.setIdent( i );
79 newDev.setMac( mac );
80 newDev.setChannel( channel );
81 layout.addWidget(&newDev);
69 82
70 if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted ) 83 if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted )
71 { 84 {
72 RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); 85 QMap<int, RfcommDialogItem*>::Iterator it;
73 m_itemList.insert( i , rfcomm ); 86 it = m_itemList.find( i );
87 RfcommDialogItem *rfcomm = it.data();
74 rfcomm->setIdent( i ); 88 rfcomm->setIdent( i );
75 rfcomm->setMac( mac ); 89 rfcomm->setMac( mac );
76 rfcomm->setChannel( newDev->channel() ); 90 rfcomm->setChannel( newDev.channel() );
77 rfcomm->setComment( newDev->comment() ); 91 rfcomm->setComment( newDev.comment() );
92 rfcomm->setBind( newDev.isBind() );
78 odebug << "New device set up" << oendl; 93 odebug << "New device set up" << oendl;
79 } 94 }
95 break;
80 } 96 }
81 } 97 }
82} 98}
83 99
100/*
101 * Load rfcomm bind configuration
102 */
84void RfcommAssignDialog::loadConfig() 103void RfcommAssignDialog::loadConfig()
85{ 104{
86
87 //Config cfg( "bluetoothmanager-rfcommbind" );
88
89 for ( int i = 0 ; i < m_range; i++ ) 105 for ( int i = 0 ; i < m_range; i++ )
90 { 106 {
91 // cfg.setGroup( QString("%1").arg( i ) );
92 RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box ); 107 RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box );
93 m_itemList.insert( i , rfcomm ); 108 m_itemList.insert(i, rfcomm);
94 rfcomm->setIdent( i ); 109 rfcomm->setIdent(i);
95 QMap<QString, RfCommConfObject*>::Iterator it; 110 QMap<QString, RfCommConfObject*>::Iterator it;
96 it = confHandler->foundEntries().find( QString("%1").arg( i ) ); 111 it = confHandler->foundEntries().find(QString::number(i));
97 if ( it != confHandler->foundEntries().end() ) 112 if (it != confHandler->foundEntries().end())
98 { 113 {
99 odebug << "Found key in foundEntries() " << oendl; 114 rfcomm->setMac(it.data()->mac());
100 rfcomm->setMac( it.data()->mac() ); 115 rfcomm->setChannel(it.data()->channel());
101 rfcomm->setChannel( it.data()->channel() ); 116 rfcomm->setComment(it.data()->comment());
102 rfcomm->setComment( it.data()->comment() ); 117 rfcomm->setBind(it.data()->isBind());
103 } 118 }
104 /* Use rfcomm.conf directly for now
105 * rfcomm->setMac( cfg.readEntry( "mac", "" ) );
106 * rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) );
107 * rfcomm->setComment( cfg.readEntry( "comment", "" ) );
108 */
109 } 119 }
110} 120}
111 121
112 122
123/*
124 * Save rfcomm bind configuration
125 */
113void RfcommAssignDialog::saveConfig() 126void RfcommAssignDialog::saveConfig()
114{ 127{
115
116 //Config cfg( "bluetoothmanager-rfcommbind" );
117
118 QMap< int, RfcommDialogItem*>::Iterator it; 128 QMap< int, RfcommDialogItem*>::Iterator it;
119
120 QMap< QString, RfCommConfObject*> outMap; 129 QMap< QString, RfCommConfObject*> outMap;
121 130
122 for( it = m_itemList.begin(); it != m_itemList.end(); ++it ) 131 for( it = m_itemList.begin(); it != m_itemList.end(); ++it )
123 { 132 {
124
125 //cfg.setGroup( QString("%1").arg( it.key() ) );
126 RfcommDialogItem *rfcomm = it.data(); 133 RfcommDialogItem *rfcomm = it.data();
127 134 if (rfcomm->mac().isEmpty())
128 135 continue;
129 outMap.insert( QString( "%1").arg( it.key() ), new RfCommConfObject( it.key(), rfcomm->mac(), rfcomm->channel(), rfcomm->comment() ) ); 136 outMap.insert(QString::number(it.key()),
130 137 new RfCommConfObject(it.key(),
131 138 rfcomm->mac(), rfcomm->channel(), rfcomm->comment(),
132 //cfg.writeEntry( "mac", rfcomm->mac() ); 139 rfcomm->isBind()));
133 //cfg.writeEntry( "channel", rfcomm->channel() );
134 //cfg.writeEntry( "comment", rfcomm->comment() );
135 } 140 }
141 confHandler->save(outMap);
142}
136 143
137 confHandler->save( outMap ); 144/*
138 145 * Reaction on the OK button
146 */
147void RfcommAssignDialog::accept()
148{
149 odebug << "save configuration" << oendl;
150 saveConfig();
151 RfcommAssignDialogBase::accept();
139} 152}
153
154//eof
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.h b/noncore/net/opietooth/manager/rfcommassigndialogimpl.h
index 9983632..12cde0e 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.h
+++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.h
@@ -1,39 +1,49 @@
1/* $Id$ */
2/* RFCOMM binding table edit dialog */
3/***************************************************************************
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 ***************************************************************************/
1#ifndef RFCOMMASSIGN 11#ifndef RFCOMMASSIGN
2#define RFCOMMASSIGN 12#define RFCOMMASSIGN
3 13
4#include "rfcommassigndialogbase.h" 14#include "rfcommassigndialogbase.h"
5#include "rfcommassigndialogitem.h" 15#include "rfcommassigndialogitem.h"
6#include "rfcommconfhandler.h" 16#include "rfcommconfhandler.h"
7 17
8#include <qscrollview.h> 18#include <qscrollview.h>
9#include <qmap.h> 19#include <qmap.h>
10#include <qvbox.h> 20#include <qvbox.h>
11 21
12namespace OpieTooth { 22namespace OpieTooth {
13 23
14 class RfcommAssignDialog: public RfcommAssignDialogBase { 24 class RfcommAssignDialog: public RfcommAssignDialogBase {
15 25 Q_OBJECT
16 Q_OBJECT
17
18 public: 26 public:
27 RfcommAssignDialog(QWidget* parent = 0, const char* name = 0,
28 bool modal = 0, WFlags fl = 0);
29 ~RfcommAssignDialog();
19 30
20 RfcommAssignDialog( QWidget* parent = 0, const char* name = 0,bool modal = 0, WFlags fl = 0 ); 31 void loadConfig();
21 ~RfcommAssignDialog(); 32 void saveConfig();
22
23 void loadConfig();
24 void saveConfig();
25 33
26 void newDevice( const QString & mac ); 34 void newDevice( const QString & mac, int channel );
27 35
28 private: 36 private:
29 QScrollView *m_scrollView; 37 QScrollView *m_scrollView;
30 // how many rfcomm devices are possible 38 // how many rfcomm devices are possible
31 int m_range; 39 int m_range;
32 QMap< int, RfcommDialogItem* > m_itemList; 40 QMap< int, RfcommDialogItem* > m_itemList;
33 QVBox *m_box; 41 QVBox *m_box;
34 RfCommConfHandler *confHandler; 42 RfCommConfHandler *confHandler;
43 protected slots:
44 virtual void accept();
35}; 45};
36 46
37} 47}
38 48
39#endif 49#endif
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogitem.cpp b/noncore/net/opietooth/manager/rfcommassigndialogitem.cpp
index a41f304..472b86c 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogitem.cpp
+++ b/noncore/net/opietooth/manager/rfcommassigndialogitem.cpp
@@ -1,53 +1,62 @@
1 1
2#include "rfcommassigndialogitem.h" 2#include "rfcommassigndialogitem.h"
3 3
4#include <qlineedit.h> 4#include <qlineedit.h>
5#include <qcombobox.h> 5#include <qcombobox.h>
6#include <qgroupbox.h> 6#include <qgroupbox.h>
7#include <qcheckbox.h>
7 8
8using namespace OpieTooth; 9using namespace OpieTooth;
9 10
10 11
11RfcommDialogItem::RfcommDialogItem( QWidget* parent, const char* name, WFlags fl ) 12RfcommDialogItem::RfcommDialogItem( QWidget* parent, const char* name, WFlags fl )
12 : RfcommDialogItemBase( parent, name, fl ) { 13 : RfcommDialogItemBase( parent, name, fl ) {
13 14
14} 15}
15 16
16RfcommDialogItem::~RfcommDialogItem() { 17RfcommDialogItem::~RfcommDialogItem() {
17} 18}
18 19
19 20
20int RfcommDialogItem::ident() { 21int RfcommDialogItem::ident() {
21 return m_ident; 22 return m_ident;
22} 23}
23 24
24QString RfcommDialogItem::mac() { 25QString RfcommDialogItem::mac() {
25 return m_macAddress->text(); 26 return m_macAddress->text();
26} 27}
27 28
28int RfcommDialogItem::channel() { 29int RfcommDialogItem::channel() {
29 return m_channelDropdown->currentItem(); 30 return m_channelDropdown->currentItem();
30} 31}
31 32
32QString RfcommDialogItem::comment() { 33QString RfcommDialogItem::comment() {
33 return m_commentLine->text(); 34 return m_commentLine->text();
34} 35}
35 36
37bool RfcommDialogItem::isBind() {
38 return m_bind->isChecked();
39}
40
36void RfcommDialogItem::setIdent( int ident ) { 41void RfcommDialogItem::setIdent( int ident ) {
37 m_ident = ident; 42 m_ident = ident;
38 m_identLabel->setTitle( QString( "rfcomm%1").arg( ident ) ); 43 m_identLabel->setTitle( QString( "rfcomm%1").arg( ident ) );
39} 44}
40 45
41void RfcommDialogItem::setMac( const QString &mac ) { 46void RfcommDialogItem::setMac( const QString &mac ) {
42 m_macAddress->setText( mac ); 47 m_macAddress->setText( mac );
43} 48}
44 49
45void RfcommDialogItem::setChannel( int channel ) { 50void RfcommDialogItem::setChannel( int channel ) {
46 m_channelDropdown->setCurrentItem( channel ); 51 m_channelDropdown->setCurrentItem( channel );
47} 52}
48 53
49void RfcommDialogItem::setComment( const QString &comment ) { 54void RfcommDialogItem::setComment( const QString &comment ) {
50 m_commentLine->setText( comment ); 55 m_commentLine->setText( comment );
51} 56}
52 57
58void RfcommDialogItem::setBind( bool dobind ) {
59 m_bind->setChecked( dobind );
60}
53 61
62//eof
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogitem.h b/noncore/net/opietooth/manager/rfcommassigndialogitem.h
index 34a794f..cc9c8db 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogitem.h
+++ b/noncore/net/opietooth/manager/rfcommassigndialogitem.h
@@ -1,40 +1,42 @@
1#ifndef RFCOMMDIALOGITEM 1#ifndef RFCOMMDIALOGITEM
2#define RFCOMMDIALOGITEM 2#define RFCOMMDIALOGITEM
3 3
4#include "rfcommdialogitembase.h" 4#include "rfcommdialogitembase.h"
5 5
6#include <qwidget.h> 6#include <qwidget.h>
7 7
8namespace OpieTooth { 8namespace OpieTooth {
9 9
10 class RfcommDialogItem : public RfcommDialogItemBase { 10 class RfcommDialogItem : public RfcommDialogItemBase {
11 11
12 Q_OBJECT 12 Q_OBJECT
13 13
14 public: 14 public:
15 RfcommDialogItem( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 15 RfcommDialogItem( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
16 ~RfcommDialogItem(); 16 ~RfcommDialogItem();
17 17
18 // number if the rfcomm device 18 // number if the rfcomm device
19 int ident(); 19 int ident();
20 // devices mac address 20 // devices mac address
21 QString mac(); 21 QString mac();
22 int channel(); 22 int channel();
23 QString comment(); 23 QString comment();
24 bool isBind();
24 25
25 void setIdent( int ident ); 26 void setIdent( int ident );
26 void setMac( const QString& mac ); 27 void setMac( const QString& mac );
27 void setChannel( int channel ); 28 void setChannel( int channel );
28 void setComment( const QString& comment ); 29 void setComment( const QString& comment );
30 void setBind(bool dobind);
29 31
30 private: 32 private:
31 33
32 34
33 int m_ident; 35 int m_ident;
34 36
35}; 37};
36 38
37 39
38} 40}
39 41
40#endif 42#endif
diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.cpp b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
index f82d2c8..054b446 100644
--- a/noncore/net/opietooth/manager/rfcommconfhandler.cpp
+++ b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
@@ -1,116 +1,160 @@
1 1
2#include <qtextstream.h> 2#include <qtextstream.h>
3#include <opie2/odebug.h> 3#include <opie2/odebug.h>
4using namespace Opie::Core; 4using namespace Opie::Core;
5 5
6#include "rfcommconfhandler.h" 6#include "rfcommconfhandler.h"
7 7
8 8
9using namespace OpieTooth; 9using namespace OpieTooth;
10 10
11// move to lib 11// move to lib
12 12
13 13
14RfCommConfObject::RfCommConfObject( int number, QString mac, int channel, QString comment ) { 14RfCommConfObject::RfCommConfObject(int number, QString mac, int channel,
15 QString comment, bool bind) {
15 m_number = number; 16 m_number = number;
16 m_mac = mac; 17 m_mac = mac;
17 m_channel = channel; 18 m_channel = channel;
18 m_comment = comment; 19 m_comment = comment;
19 // m_foundEntries = 0; 20 m_doBind = bind;
20} 21}
21 22
22void RfCommConfObject::setNumber( int number ) { 23void RfCommConfObject::setNumber( int number ) {
23 m_number = number; 24 m_number = number;
24} 25}
25 26
26void RfCommConfObject::setMac( QString mac ) { 27void RfCommConfObject::setMac( QString mac ) {
27 m_mac = mac; 28 m_mac = mac;
28} 29}
29 30
30void RfCommConfObject::setChannel( int channel ) { 31void RfCommConfObject::setChannel( int channel ) {
31 m_channel = channel; 32 m_channel = channel;
32} 33}
33 34
34void RfCommConfObject::setComment( QString comment ) { 35void RfCommConfObject::setComment( QString comment ) {
35 m_comment = comment; 36 m_comment = comment;
36} 37}
37 38
38 39
39RfCommConfObject::~RfCommConfObject() { 40RfCommConfObject::~RfCommConfObject() {
40} 41}
41 42
42 43
43RfCommConfHandler::RfCommConfHandler( const QString & filename ) { 44RfCommConfHandler::RfCommConfHandler( const QString & filename ) {
44
45 m_filename = filename; 45 m_filename = filename;
46 load(); 46 load();
47} 47}
48 48
49RfCommConfHandler::~RfCommConfHandler() { 49RfCommConfHandler::~RfCommConfHandler() {
50 50
51} 51}
52 52
53void RfCommConfHandler::save( QMap<QString, RfCommConfObject*> devices ) { 53void RfCommConfHandler::save( QMap<QString, RfCommConfObject*> devices ) {
54 54
55 QFile rfCommConf( "/tmp/test" ); 55//// For debugging purposes
56//// QFile rfCommConf( "/mnt/net/opie/bin/rfcomm.conf" );
57 QFile rfCommConf( m_filename );
56 QTextStream outStream( &rfCommConf ); 58 QTextStream outStream( &rfCommConf );
57 if ( rfCommConf.open( IO_WriteOnly ) ) { 59 if ( rfCommConf.open( IO_WriteOnly ) ) {
58
59 QMap<QString, RfCommConfObject*>::Iterator it; 60 QMap<QString, RfCommConfObject*>::Iterator it;
61 outStream << "#\n";
62 outStream << "# RFCOMM configuration file.\n";
63 outStream << "#\n";
64 outStream << "# $Id$\n";
65 outStream << "#\n\n";
60 for( it = devices.begin(); it != devices.end(); ++it ) { 66 for( it = devices.begin(); it != devices.end(); ++it ) {
61 outStream << "rfcomm" + QString("%1").arg( it.data()->number() ) + " {\n"; 67 outStream << "rfcomm" + QString("%1").arg( it.data()->number() ) + " {\n";
62 outStream << " device " + it.data()->mac() + ";\n"; 68 outStream << "\t# Automatically bind the device at startup\n";
63 outStream << " channel " + QString( "%1" ).arg( it.data()->channel() ) + ";\n"; 69 outStream << "\tbind " << ((it.data()->isBind())? "yes": "no") << ";\n";
64 outStream << " comment \"" + it.data()->comment() + "\";\n"; 70 outStream << "\n";
71 outStream << "\t# Bluetooth address of the device\n";
72 outStream << "\tdevice " + it.data()->mac() + ";\n";
73 outStream << "\n";
74 outStream << "\t# RFCOMM channel for the connection\n";
75 outStream << "\tchannel\t" + QString( "%1" ).arg( it.data()->channel() ) + ";\n";
76 outStream << "\n";
77 outStream << "\t# Description of the connection\n";
78 outStream << "\tcomment \"" + it.data()->comment() + "\";\n";
65 outStream << "}\n\n"; 79 outStream << "}\n\n";
66 } 80 }
67
68 rfCommConf.close(); 81 rfCommConf.close();
69 } 82 }
70} 83}
71 84
72 85
73QMap<QString, RfCommConfObject*> RfCommConfHandler::foundEntries() { 86QMap<QString, RfCommConfObject*> RfCommConfHandler::foundEntries() {
74 return m_foundEntries; 87 return m_foundEntries;
75} 88}
76 89
77void RfCommConfHandler::load() { 90void RfCommConfHandler::load() {
91 //Keywords
92 QCString k_rfcomm("rfcomm");
93 QCString k_device("device ");
94 QCString k_channel("channel ");
95 QCString k_comment("comment ");
96 QCString k_bind("bind ");
78 97
79 QFile rfCommConf( m_filename ); 98 m_foundEntries.clear();
80 if ( rfCommConf.open( IO_ReadOnly ) ) { 99 QFile rfCommConf(m_filename); //File we read
100 if (rfCommConf.open(IO_ReadOnly)) {
81 101
82 QStringList list; 102 QStringList list;
83 QTextStream inStream( &rfCommConf ); 103 QTextStream inStream( &rfCommConf );
84 list = QStringList::split( "\n", inStream.read() ); 104 list = QStringList::split( "\n", inStream.read() );
85 105
86 QString number;
87 QString mac; 106 QString mac;
88 QString channel; 107 QString channel;
89 QString comment; 108 QString comment;
109 QString bind;
110 bool bbind;
111 QString number;
90 112
91 for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) { 113 for (QStringList::Iterator line = list.begin();
114 line != list.end(); line++) {
92 115
93 QString tmpLine = ( *line ).stripWhiteSpace(); 116 QString tmpLine = (*line).simplifyWhiteSpace();
94 117
95 if ( tmpLine.startsWith("rfcomm") ) { 118 if (tmpLine.startsWith(k_rfcomm)) {
96 QString number = tmpLine.mid( 6,1 ); 119 number = tmpLine.mid( k_rfcomm.length(), 1 );
97 odebug << tmpLine << oendl; 120 odebug << tmpLine << oendl;
98 odebug << "TEST " + number << oendl; 121 odebug << "device " << number << oendl;
99 } else if ( tmpLine.startsWith( "}" ) ) { 122 } else if ( tmpLine.startsWith( "}" ) ) {
100 m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) ); 123 m_foundEntries.insert(number,
101 } else if ( tmpLine.startsWith( "device" ) ) { 124 new RfCommConfObject(number.toInt(), mac, channel.toInt(),
102 mac = tmpLine.mid( 7, 17 ); 125 comment, bbind));
103 odebug << "mac" + mac << oendl; 126 } else if ( tmpLine.startsWith(k_device) ) {
104 } else if ( tmpLine.startsWith( "channel" ) ) { 127 mac = tmpLine.mid(k_device.length(),
105 channel = tmpLine.mid( 8, 1 ); 128 tmpLine.find(';') - k_device.length());
106 odebug << "Channel :" << channel << oendl; 129 odebug << "mac " + mac << oendl;
107 } else if ( tmpLine.startsWith( "comment" ) ) { 130 } else if ( tmpLine.startsWith(k_channel) ) {
108 comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 ); 131 channel = tmpLine.mid(k_channel.length(),
132 tmpLine.find(';') - k_channel.length());
133 odebug << "Channel: " << channel << oendl;
134 } else if ( tmpLine.startsWith(k_comment) ) {
135 comment = tmpLine.mid(k_comment.length(),
136 tmpLine.find(';') - k_comment.length());
137 if (comment.left(1) == "\"")
138 comment.remove(0, 1);
139 if (comment.right(1) == "\"")
140 comment.remove(comment.length() - 1, 1);
109 odebug << "Comment: " + comment << oendl; 141 odebug << "Comment: " + comment << oendl;
142 } else if ( tmpLine.startsWith(k_bind) ) {
143 bind = tmpLine.mid(k_bind.length(),
144 tmpLine.find(';') - k_bind.length());
145 if (bind == "no")
146 bbind = false;
147 else if (bind == "yes")
148 bbind = true;
149 else
150 bbind = true;
151 odebug << "bind: " + bind << oendl;
110 } 152 }
111 } 153 }
112 rfCommConf.close(); 154 rfCommConf.close();
113 } 155 }
114 save( m_foundEntries ); 156 save(m_foundEntries);
115 odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl; 157 odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl;
116} 158}
159
160//eof
diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.h b/noncore/net/opietooth/manager/rfcommconfhandler.h
index e13c833..46aaa26 100644
--- a/noncore/net/opietooth/manager/rfcommconfhandler.h
+++ b/noncore/net/opietooth/manager/rfcommconfhandler.h
@@ -1,54 +1,57 @@
1#ifndef RFCOMMCONFHANDLER 1#ifndef RFCOMMCONFHANDLER
2#define RFCOMMCONFHANDLER 2#define RFCOMMCONFHANDLER
3 3
4#include <qstring.h> 4#include <qstring.h>
5#include <qfile.h> 5#include <qfile.h>
6#include <qobject.h> 6#include <qobject.h>
7#include <qmap.h> 7#include <qmap.h>
8 8
9namespace OpieTooth { 9namespace OpieTooth {
10 10
11 class RfCommConfObject { 11 class RfCommConfObject {
12 12
13 public: 13 public:
14 RfCommConfObject( int number, QString mac, int channel, QString comment ); 14 RfCommConfObject( int number, QString mac, int channel, QString comment,
15 bool bind);
15 ~RfCommConfObject(); 16 ~RfCommConfObject();
16 17
17 void setNumber( int number ); 18 void setNumber( int number );
18 int number() { return m_number; }; 19 int number() { return m_number; };
19 void setMac( QString mac ); 20 void setMac( QString mac );
20 QString mac() { return m_mac; }; 21 QString mac() { return m_mac; };
21 void setChannel( int channel ); 22 void setChannel( int channel );
22 int channel() { return m_channel; }; 23 int channel() { return m_channel; };
23 void setComment( QString comment ); 24 void setComment( QString comment );
24 QString comment() { return m_comment; }; 25 QString comment() { return m_comment; };
25 26 bool isBind() { return m_doBind; }
27 void doBind(bool arg) { m_doBind = arg; }
26 28
27 private: 29 private:
30 bool m_doBind;
28 int m_number; 31 int m_number;
29 QString m_mac; 32 QString m_mac;
30 int m_channel; 33 int m_channel;
31 QString m_comment; 34 QString m_comment;
32 35
33 }; 36 };
34 37
35 class RfCommConfHandler { 38 class RfCommConfHandler {
36 39
37 public: 40 public:
38 RfCommConfHandler( const QString & filename ); 41 RfCommConfHandler( const QString & filename );
39 ~RfCommConfHandler(); 42 ~RfCommConfHandler();
40 43
41 void save( QMap<QString, RfCommConfObject*> devices ); 44 void save( QMap<QString, RfCommConfObject*> devices );
42 45
43 QMap<QString, RfCommConfObject*> foundEntries(); 46 QMap<QString, RfCommConfObject*> foundEntries();
44 47
45 private: 48 private:
46 void load(); 49 void load();
47 50
48 QString m_filename; 51 QString m_filename;
49 QMap<QString, RfCommConfObject*> m_foundEntries; 52 QMap<QString, RfCommConfObject*> m_foundEntries;
50 }; 53 };
51 54
52} 55}
53 56
54#endif 57#endif
diff --git a/noncore/net/opietooth/manager/rfcommdialogitembase.ui b/noncore/net/opietooth/manager/rfcommdialogitembase.ui
index dd8f121..43f3269 100644
--- a/noncore/net/opietooth/manager/rfcommdialogitembase.ui
+++ b/noncore/net/opietooth/manager/rfcommdialogitembase.ui
@@ -1,243 +1,277 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>RfcommDialogItemBase</class> 2<class>RfcommDialogItemBase</class>
3<widget> 3<widget>
4 <class>QWidget</class> 4 <class>QWidget</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>RfcommDialogItemBase</cstring> 7 <cstring>RfcommDialogItemBase</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>239</width> 14 <width>235</width>
15 <height>95</height> 15 <height>95</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Form2</string> 20 <string>Form2</string>
21 </property> 21 </property>
22 <vbox> 22 <vbox>
23 <property stdset="1"> 23 <property stdset="1">
24 <name>margin</name> 24 <name>margin</name>
25 <number>0</number> 25 <number>0</number>
26 </property> 26 </property>
27 <property stdset="1"> 27 <property stdset="1">
28 <name>spacing</name> 28 <name>spacing</name>
29 <number>0</number> 29 <number>0</number>
30 </property> 30 </property>
31 <widget> 31 <widget>
32 <class>QGroupBox</class> 32 <class>QGroupBox</class>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>name</name> 34 <name>name</name>
35 <cstring>m_identLabel</cstring> 35 <cstring>m_identLabel</cstring>
36 </property> 36 </property>
37 <property stdset="1"> 37 <property stdset="1">
38 <name>title</name> 38 <name>title</name>
39 <string></string> 39 <string></string>
40 </property> 40 </property>
41 <property> 41 <property>
42 <name>layoutMargin</name> 42 <name>layoutMargin</name>
43 </property> 43 </property>
44 <property> 44 <property>
45 <name>layoutSpacing</name> 45 <name>layoutSpacing</name>
46 </property> 46 </property>
47 <grid> 47 <vbox>
48 <property stdset="1"> 48 <property stdset="1">
49 <name>margin</name> 49 <name>margin</name>
50 <number>5</number> 50 <number>0</number>
51 </property> 51 </property>
52 <property stdset="1"> 52 <property stdset="1">
53 <name>spacing</name> 53 <name>spacing</name>
54 <number>5</number> 54 <number>2</number>
55 </property> 55 </property>
56 <widget row="0" column="0" > 56 <widget>
57 <class>QLayoutWidget</class> 57 <class>QLayoutWidget</class>
58 <property stdset="1"> 58 <property stdset="1">
59 <name>name</name> 59 <name>name</name>
60 <cstring>Layout3</cstring> 60 <cstring>Layout3</cstring>
61 </property> 61 </property>
62 <hbox> 62 <property>
63 <name>layoutSpacing</name>
64 </property>
65 <vbox>
63 <property stdset="1"> 66 <property stdset="1">
64 <name>margin</name> 67 <name>margin</name>
65 <number>0</number> 68 <number>0</number>
66 </property> 69 </property>
67 <property stdset="1"> 70 <property stdset="1">
68 <name>spacing</name> 71 <name>spacing</name>
69 <number>6</number> 72 <number>2</number>
70 </property> 73 </property>
71 <widget> 74 <widget>
72 <class>QLabel</class> 75 <class>QCheckBox</class>
73 <property stdset="1"> 76 <property stdset="1">
74 <name>name</name> 77 <name>name</name>
75 <cstring>TextLabel4</cstring> 78 <cstring>m_bind</cstring>
76 </property> 79 </property>
77 <property stdset="1"> 80 <property stdset="1">
78 <name>text</name> 81 <name>text</name>
79 <string>Mac</string> 82 <string>bind automatically</string>
80 </property>
81 </widget>
82 <widget>
83 <class>QLineEdit</class>
84 <property stdset="1">
85 <name>name</name>
86 <cstring>m_macAddress</cstring>
87 </property> 83 </property>
88 </widget> 84 </widget>
89 <widget> 85 <widget>
90 <class>QLabel</class> 86 <class>QLayoutWidget</class>
91 <property stdset="1"> 87 <property stdset="1">
92 <name>name</name> 88 <name>name</name>
93 <cstring>TextLabel5</cstring> 89 <cstring>Layout3</cstring>
94 </property> 90 </property>
95 <property stdset="1"> 91 <property>
96 <name>text</name> 92 <name>layoutSpacing</name>
97 <string>Channel</string>
98 </property> 93 </property>
99 </widget> 94 <hbox>
100 <widget> 95 <property stdset="1">
101 <class>QComboBox</class> 96 <name>margin</name>
102 <item> 97 <number>0</number>
103 <property>
104 <name>text</name>
105 <string>0</string>
106 </property>
107 </item>
108 <item>
109 <property>
110 <name>text</name>
111 <string>1</string>
112 </property>
113 </item>
114 <item>
115 <property>
116 <name>text</name>
117 <string>2</string>
118 </property> 98 </property>
119 </item> 99 <property stdset="1">
120 <item> 100 <name>spacing</name>
121 <property> 101 <number>6</number>
122 <name>text</name>
123 <string>3</string>
124 </property> 102 </property>
125 </item> 103 <widget>
126 <item> 104 <class>QLabel</class>
127 <property> 105 <property stdset="1">
128 <name>text</name> 106 <name>name</name>
129 <string>4</string> 107 <cstring>TextLabel4</cstring>
130 </property> 108 </property>
131 </item> 109 <property stdset="1">
132 <item> 110 <name>text</name>
133 <property> 111 <string>Mac</string>
134 <name>text</name> 112 </property>
135 <string>5</string> 113 </widget>
136 </property> 114 <widget>
137 </item> 115 <class>QLineEdit</class>
138 <item> 116 <property stdset="1">
139 <property> 117 <name>name</name>
140 <name>text</name> 118 <cstring>m_macAddress</cstring>
141 <string>6</string> 119 </property>
142 </property> 120 </widget>
143 </item> 121 <widget>
144 <item> 122 <class>QLabel</class>
145 <property> 123 <property stdset="1">
146 <name>text</name> 124 <name>name</name>
147 <string>7</string> 125 <cstring>TextLabel5</cstring>
148 </property> 126 </property>
149 </item> 127 <property stdset="1">
150 <item> 128 <name>text</name>
151 <property> 129 <string>Channel</string>
152 <name>text</name> 130 </property>
153 <string>8</string> 131 </widget>
154 </property> 132 <widget>
155 </item> 133 <class>QComboBox</class>
156 <item> 134 <item>
157 <property> 135 <property>
158 <name>text</name> 136 <name>text</name>
159 <string>9</string> 137 <string>0</string>
160 </property> 138 </property>
161 </item> 139 </item>
162 <item> 140 <item>
163 <property> 141 <property>
164 <name>text</name> 142 <name>text</name>
165 <string>10</string> 143 <string>1</string>
166 </property> 144 </property>
167 </item> 145 </item>
168 <property stdset="1"> 146 <item>
169 <name>name</name> 147 <property>
170 <cstring>m_channelDropdown</cstring> 148 <name>text</name>
171 </property> 149 <string>2</string>
172 </widget> 150 </property>
173 </hbox> 151 </item>
174 </widget> 152 <item>
175 <widget row="1" column="0" > 153 <property>
176 <class>QLayoutWidget</class> 154 <name>text</name>
177 <property stdset="1"> 155 <string>3</string>
178 <name>name</name> 156 </property>
179 <cstring>Layout4</cstring> 157 </item>
180 </property> 158 <item>
181 <hbox> 159 <property>
182 <property stdset="1"> 160 <name>text</name>
183 <name>margin</name> 161 <string>4</string>
184 <number>0</number> 162 </property>
185 </property> 163 </item>
186 <property stdset="1"> 164 <item>
187 <name>spacing</name> 165 <property>
188 <number>6</number> 166 <name>text</name>
189 </property> 167 <string>5</string>
190 <widget> 168 </property>
191 <class>QLabel</class> 169 </item>
192 <property stdset="1"> 170 <item>
193 <name>name</name> 171 <property>
194 <cstring>TextLabel3</cstring> 172 <name>text</name>
195 </property> 173 <string>6</string>
196 <property stdset="1"> 174 </property>
197 <name>sizePolicy</name> 175 </item>
198 <sizepolicy> 176 <item>
199 <hsizetype>1</hsizetype> 177 <property>
200 <vsizetype>1</vsizetype> 178 <name>text</name>
201 </sizepolicy> 179 <string>7</string>
202 </property> 180 </property>
203 <property stdset="1"> 181 </item>
204 <name>text</name> 182 <item>
205 <string>Comment:</string> 183 <property>
206 </property> 184 <name>text</name>
185 <string>8</string>
186 </property>
187 </item>
188 <item>
189 <property>
190 <name>text</name>
191 <string>9</string>
192 </property>
193 </item>
194 <item>
195 <property>
196 <name>text</name>
197 <string>10</string>
198 </property>
199 </item>
200 <property stdset="1">
201 <name>name</name>
202 <cstring>m_channelDropdown</cstring>
203 </property>
204 </widget>
205 </hbox>
207 </widget> 206 </widget>
208 <widget> 207 <widget>
209 <class>QLineEdit</class> 208 <class>QLayoutWidget</class>
210 <property stdset="1"> 209 <property stdset="1">
211 <name>name</name> 210 <name>name</name>
212 <cstring>m_commentLine</cstring> 211 <cstring>Layout4</cstring>
213 </property> 212 </property>
213 <hbox>
214 <property stdset="1">
215 <name>margin</name>
216 <number>0</number>
217 </property>
218 <property stdset="1">
219 <name>spacing</name>
220 <number>6</number>
221 </property>
222 <widget>
223 <class>QLabel</class>
224 <property stdset="1">
225 <name>name</name>
226 <cstring>TextLabel3</cstring>
227 </property>
228 <property stdset="1">
229 <name>sizePolicy</name>
230 <sizepolicy>
231 <hsizetype>1</hsizetype>
232 <vsizetype>1</vsizetype>
233 </sizepolicy>
234 </property>
235 <property stdset="1">
236 <name>text</name>
237 <string>Comment:</string>
238 </property>
239 </widget>
240 <widget>
241 <class>QLineEdit</class>
242 <property stdset="1">
243 <name>name</name>
244 <cstring>m_commentLine</cstring>
245 </property>
246 </widget>
247 </hbox>
214 </widget> 248 </widget>
215 </hbox> 249 </vbox>
216 </widget> 250 </widget>
217 </grid> 251 </vbox>
218 </widget> 252 </widget>
219 </vbox> 253 </vbox>
220</widget> 254</widget>
221<customwidgets> 255<customwidgets>
222 <customwidget> 256 <customwidget>
223 <class>QWidget</class> 257 <class>QWidget</class>
224 <header location="local">qwidget.h</header> 258 <header location="local">qwidget.h</header>
225 <sizehint> 259 <sizehint>
226 <width>100</width> 260 <width>100</width>
227 <height>100</height> 261 <height>100</height>
228 </sizehint> 262 </sizehint>
229 <container>0</container> 263 <container>0</container>
230 <sizepolicy> 264 <sizepolicy>
231 <hordata>7</hordata> 265 <hordata>7</hordata>
232 <verdata>7</verdata> 266 <verdata>7</verdata>
233 </sizepolicy> 267 </sizepolicy>
234 <pixmap>image0</pixmap> 268 <pixmap>image0</pixmap>
235 </customwidget> 269 </customwidget>
236</customwidgets> 270</customwidgets>
237<images> 271<images>
238 <image> 272 <image>
239 <name>image0</name> 273 <name>image0</name>
240 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> 274 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
241 </image> 275 </image>
242</images> 276</images>
243</UI> 277</UI>
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp
index 7711f0a..04da19f 100644
--- a/noncore/net/opietooth/manager/rfcpopup.cpp
+++ b/noncore/net/opietooth/manager/rfcpopup.cpp
@@ -60,62 +60,63 @@ RfcCommPopup::RfcCommPopup(const OpieTooth::Services& service,
60 a->setText("Bind table"); 60 a->setText("Bind table");
61 a->addTo( this ); 61 a->addTo( this );
62 connect( a, SIGNAL( activated() ), 62 connect( a, SIGNAL( activated() ),
63 this, SLOT( slotBind() ) ); 63 this, SLOT( slotBind() ) );
64 64
65 65
66 /* bar action */ 66 /* bar action */
67 a = new QAction( ); 67 a = new QAction( );
68 a->setText( "Bar" ); 68 a->setText( "Bar" );
69 a->addTo( this ); 69 a->addTo( this );
70 connect( a, SIGNAL( activated() ), 70 connect( a, SIGNAL( activated() ),
71 this, SLOT( slotBar() ) ); 71 this, SLOT( slotBar() ) );
72 72
73}; 73};
74 74
75 75
76RfcCommPopup::~RfcCommPopup() 76RfcCommPopup::~RfcCommPopup()
77{ 77{
78 /* delete m_con; 78 /* delete m_con;
79 delete m_dis; 79 delete m_dis;
80 delete m_foo; 80 delete m_foo;
81 delete m_bar; */ 81 delete m_bar; */
82} 82}
83 83
84 84
85void RfcCommPopup::slotConnect() 85void RfcCommPopup::slotConnect()
86{ 86{
87 87
88 owarn << "connect" << oendl; 88 owarn << "connect" << oendl;
89 89
90 PPPDialog pppDialog(m_item->mac(), 90 PPPDialog pppDialog(m_item->mac(),
91 m_service.protocolDescriptorList().last().port()); 91 m_service.protocolDescriptorList().last().port());
92 QPEApplication::execDialog( &pppDialog ); 92 QPEApplication::execDialog( &pppDialog );
93} 93}
94 94
95 95
96void RfcCommPopup::slotDisconnect() 96void RfcCommPopup::slotDisconnect()
97{ 97{
98 owarn << "slot disconnected " << procId << oendl; 98 owarn << "slot disconnected " << procId << oendl;
99 if (procId >= 0) 99 if (procId >= 0)
100 PPPDialog::conns[procId].proc.kill(); 100 PPPDialog::conns[procId].proc.kill();
101} 101}
102 102
103 103
104void RfcCommPopup::slotBind() 104void RfcCommPopup::slotBind()
105{ 105{
106 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); 106 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
107 107
108 rfcommAssign.newDevice( m_item->mac() ); 108 rfcommAssign.newDevice( m_item->mac(),
109 m_service.protocolDescriptorList().last().port());
109 110
110 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted ) 111 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
111 { 112 {
112 rfcommAssign.saveConfig(); 113 rfcommAssign.saveConfig();
113 } 114 }
114} 115}
115 116
116 117
117void RfcCommPopup::slotBar() 118void RfcCommPopup::slotBar()
118{ 119{
119 owarn << "slotBar" << oendl; 120 owarn << "slotBar" << oendl;
120}; 121};
121 122