summaryrefslogtreecommitdiff
authorkorovkin <korovkin>2006-04-20 12:37:33 (UTC)
committer korovkin <korovkin>2006-04-20 12:37:33 (UTC)
commitfce7a143353e2bdd41d878c6f0a1224e0f2a158e (patch) (unidiff)
tree41fc68d13e148b8979dde51401ce160f10197a6c
parent6d3a8eaf3b92f8eec9908eed91568342fac5de1d (diff)
downloadopie-fce7a143353e2bdd41d878c6f0a1224e0f2a158e.zip
opie-fce7a143353e2bdd41d878c6f0a1224e0f2a158e.tar.gz
opie-fce7a143353e2bdd41d878c6f0a1224e0f2a158e.tar.bz2
Added services configuration dialog.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/.cvsignore4
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp30
-rw-r--r--noncore/net/opietooth/manager/bluebase.h1
-rw-r--r--noncore/net/opietooth/manager/bluetoothbase.ui43
-rw-r--r--noncore/net/opietooth/manager/btconfhandler.cpp391
-rw-r--r--noncore/net/opietooth/manager/btconfhandler.h126
-rw-r--r--noncore/net/opietooth/manager/manager.pro9
-rw-r--r--noncore/net/opietooth/manager/servicesdialog.cpp120
-rw-r--r--noncore/net/opietooth/manager/servicesdialog.h30
-rw-r--r--noncore/net/opietooth/manager/servicesdialogbase.ui658
10 files changed, 1387 insertions, 25 deletions
diff --git a/noncore/net/opietooth/manager/.cvsignore b/noncore/net/opietooth/manager/.cvsignore
index 019226e..ca2d996 100644
--- a/noncore/net/opietooth/manager/.cvsignore
+++ b/noncore/net/opietooth/manager/.cvsignore
@@ -1,15 +1,19 @@
1Makefile 1Makefile
2Makefile.in 2Makefile.in
3bluetoothbase.cpp 3bluetoothbase.cpp
4bluetoothbase.h 4bluetoothbase.h
5devicedialog.cpp 5devicedialog.cpp
6devicedialog.h 6devicedialog.h
7moc_* 7moc_*
8scandialog.cpp 8scandialog.cpp
9scandialog.h 9scandialog.h
10rfcommassigndialogbase.cpp 10rfcommassigndialogbase.cpp
11rfcommassigndialogbase.h 11rfcommassigndialogbase.h
12rfcommdialogitembase.cpp 12rfcommdialogitembase.cpp
13rfcommdialogitembase.h 13rfcommdialogitembase.h
14servicesdialogbase.cpp
15servicesdialogbase.h
16obexftpdialogbase.cpp
17obexftpdialogbase.h
14.moc* 18.moc*
15.obj 19.obj
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 924d191..13954c5 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -1,763 +1,781 @@
1/* 1/*
2 * bluebase.cpp * 2 * bluebase.cpp *
3 * --------------------- 3 * ---------------------
4 * 4 *
5 * copyright : (c) 2002 by Maximilian Reiß 5 * copyright : (c) 2002 by Maximilian Reiß
6 * email : max.reiss@gmx.de 6 * email : max.reiss@gmx.de
7 * 7 *
8 */ 8 */
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free software; you can redistribute it and/or modify * 11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or * 13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. * 14 * (at your option) any later version. *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17 17
18#include "bluebase.h" 18#include "bluebase.h"
19#include "scandialog.h" 19#include "scandialog.h"
20#include "hciconfwrapper.h" 20#include "hciconfwrapper.h"
21#include "devicehandler.h" 21#include "devicehandler.h"
22#include "btconnectionitem.h" 22#include "btconnectionitem.h"
23#include "rfcommassigndialogimpl.h" 23#include "rfcommassigndialogimpl.h"
24#include "forwarder.h" 24#include "forwarder.h"
25#include "servicesdialog.h"
25#include <termios.h> 26#include <termios.h>
26#include <string.h> 27#include <string.h>
27#include <errno.h> 28#include <errno.h>
28 29
29/* OPIE */ 30/* OPIE */
30#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
31#include <qpe/resource.h> 32#include <qpe/resource.h>
32#include <qpe/config.h> 33#include <qpe/config.h>
33#include <opie2/odebug.h> 34#include <opie2/odebug.h>
34using namespace Opie::Core; 35using namespace Opie::Core;
35 36
36/* QT */ 37/* QT */
37#include <qframe.h> 38#include <qframe.h>
38#include <qlabel.h> 39#include <qlabel.h>
39#include <qpushbutton.h> 40#include <qpushbutton.h>
40#include <qlayout.h> 41#include <qlayout.h>
41#include <qvariant.h> 42#include <qvariant.h>
42#include <qimage.h> 43#include <qimage.h>
43#include <qpixmap.h> 44#include <qpixmap.h>
44#include <qtabwidget.h> 45#include <qtabwidget.h>
45#include <qscrollview.h> 46#include <qscrollview.h>
46#include <qvbox.h> 47#include <qvbox.h>
47#include <qmessagebox.h> 48#include <qmessagebox.h>
48#include <qcombobox.h> 49#include <qcombobox.h>
49#include <qcheckbox.h> 50#include <qcheckbox.h>
50#include <qlineedit.h> 51#include <qlineedit.h>
51#include <qlistview.h> 52#include <qlistview.h>
52#include <qdir.h> 53#include <qdir.h>
53#include <qpopupmenu.h> 54#include <qpopupmenu.h>
54#include <qtimer.h> 55#include <qtimer.h>
55#include <qlist.h> 56#include <qlist.h>
56#include <qfile.h> 57#include <qfile.h>
57 58
58/* STD */ 59/* STD */
59#include <remotedevice.h> 60#include <remotedevice.h>
60#include <services.h> 61#include <services.h>
61#include <stdlib.h> 62#include <stdlib.h>
62 63
63using namespace OpieTooth; 64using namespace OpieTooth;
64//Array of possible speeds of the serial port 65//Array of possible speeds of the serial port
65struct SerSpeed { 66struct SerSpeed {
66 const char* str; //string value 67 const char* str; //string value
67 int val; //value itself 68 int val; //value itself
68} speeds[] = { 69} speeds[] = {
69 { "150", B150 }, { "300", B300 }, { "600", B600 }, { "1200", B1200 }, 70 { "150", B150 }, { "300", B300 }, { "600", B600 }, { "1200", B1200 },
70 { "2400", B2400 }, { "4800", B4800 }, { "9600", B9600 }, 71 { "2400", B2400 }, { "4800", B4800 }, { "9600", B9600 },
71 { "19200", B19200 }, { "38400", B38400 }, { "57600", B57600 }, 72 { "19200", B19200 }, { "38400", B38400 }, { "57600", B57600 },
72 { "115200", B115200} 73 { "115200", B115200}
73}; 74};
74 75
75BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 76BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
76 : BluetoothBase( parent, name, fl ) 77 : BluetoothBase( parent, name, fl )
77{ 78{
78 m_localDevice = new Manager( "hci0" ); 79 m_localDevice = new Manager( "hci0" );
79 80
80 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); 81 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) );
81 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); 82 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) );
82 83
83 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) ); 84 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) );
84 85
85 connect( devicesView, SIGNAL( clicked(QListViewItem*)), 86 connect( devicesView, SIGNAL( clicked(QListViewItem*)),
86 this, SLOT( startServiceActionClicked(QListViewItem*) ) ); 87 this, SLOT( startServiceActionClicked(QListViewItem*) ) );
87 connect( devicesView, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), 88 connect( devicesView, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ),
88 this, SLOT(startServiceActionHold(QListViewItem*,const QPoint&,int) ) ); 89 this, SLOT(startServiceActionHold(QListViewItem*,const QPoint&,int) ) );
89 connect( m_localDevice , SIGNAL( foundServices(const QString&,Services::ValueList) ), 90 connect( m_localDevice , SIGNAL( foundServices(const QString&,Services::ValueList) ),
90 this, SLOT( addServicesToDevice(const QString&,Services::ValueList) ) ); 91 this, SLOT( addServicesToDevice(const QString&,Services::ValueList) ) );
91 connect( m_localDevice, SIGNAL( available(const QString&,bool) ), 92 connect( m_localDevice, SIGNAL( available(const QString&,bool) ),
92 this, SLOT( deviceActive(const QString&,bool) ) ); 93 this, SLOT( deviceActive(const QString&,bool) ) );
93 connect( m_localDevice, SIGNAL( connections(ConnectionState::ValueList) ), 94 connect( m_localDevice, SIGNAL( connections(ConnectionState::ValueList) ),
94 this, SLOT( addConnectedDevices(ConnectionState::ValueList) ) ); 95 this, SLOT( addConnectedDevices(ConnectionState::ValueList) ) );
95 connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ), 96 connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ),
96 this, SLOT( addSignalStrength(const QString&,const QString&) ) ); 97 this, SLOT( addSignalStrength(const QString&,const QString&) ) );
97 connect(runButton, SIGNAL(clicked()), this, SLOT(doForward())); 98 connect(runButton, SIGNAL(clicked()), this, SLOT(doForward()));
98 connect(encCheckBox, SIGNAL(toggled(bool)), this, SLOT(doEncrypt(bool))); 99 connect(encCheckBox, SIGNAL(toggled(bool)), this, SLOT(doEncrypt(bool)));
100 connect(servicesEditButton, SIGNAL(clicked()), this, SLOT(editServices()));
99 101
100 // let hold be rightButtonClicked() 102 // let hold be rightButtonClicked()
101 QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold); 103 QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold);
102 QPEApplication::setStylusOperation( connectionsView->viewport(), QPEApplication::RightOnHold); 104 QPEApplication::setStylusOperation( connectionsView->viewport(), QPEApplication::RightOnHold);
103 105
104 //Load all icons needed 106 //Load all icons needed
105 m_offPix = Resource::loadPixmap( "opietooth/notconnected" ); 107 m_offPix = Resource::loadPixmap( "opietooth/notconnected" );
106 m_onPix = Resource::loadPixmap( "opietooth/connected" ); 108 m_onPix = Resource::loadPixmap( "opietooth/connected" );
107 m_findPix = Resource::loadPixmap( "opietooth/find" ); 109 m_findPix = Resource::loadPixmap( "opietooth/find" );
108 110
109 QPalette pal = this->palette(); 111 QPalette pal = this->palette();
110 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 112 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
111 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 113 pal.setColor( QPalette::Active, QColorGroup::Button, col );
112 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 114 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
113 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 115 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
114 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 116 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
115 this->setPalette( pal ); 117 this->setPalette( pal );
116 118
117 setCaption( tr( "Bluetooth Manager" ) ); 119 setCaption( tr( "Bluetooth Manager" ) );
118 120
119 readConfig(); 121 readConfig();
120 initGui(); 122 initGui();
121 123
122 devicesView->setRootIsDecorated(true); 124 devicesView->setRootIsDecorated(true);
123 m_iconLoader = new BTIconLoader(); 125 m_iconLoader = new BTIconLoader();
124 writeToHciConfig(); 126 writeToHciConfig();
125 addConnectedDevices(); 127 addConnectedDevices();
126 readSavedDevices(); 128 readSavedDevices();
127 addServicesToDevices(); 129 addServicesToDevices();
128 QTimer::singleShot( 3000, this, SLOT( addServicesToDevices() ) ); 130 QTimer::singleShot( 3000, this, SLOT( addServicesToDevices() ) );
129 forwarder = NULL; 131 forwarder = NULL;
130 serDevName->setText(tr("/dev/ircomm0"));
131 for (unsigned int i = 0; i < (sizeof(speeds) / sizeof(speeds[0])); i++) {
132 serSpeed->insertItem(speeds[i].str);
133 }
134 serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1);
135 encCheckBox->setChecked(true);
136} 132}
137 133
138/** 134/**
139 * Reads all options from the config file 135 * Reads all options from the config file
140 */ 136 */
141void BlueBase::readConfig() 137void BlueBase::readConfig()
142{ 138{
143 139
144 Config cfg( "bluetoothmanager" ); 140 Config cfg( "bluetoothmanager" );
145 cfg.setGroup( "bluezsettings" ); 141 cfg.setGroup( "bluezsettings" );
146 142
147 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with 143 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with
148 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak 144 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak
149 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE ); 145 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE );
150 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE ); 146 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE );
151 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE ); 147 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE );
152 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE ); 148 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE );
153} 149}
154 150
155/** 151/**
156 * Writes all options to the config file 152 * Writes all options to the config file
157 */ 153 */
158void BlueBase::writeConfig() 154void BlueBase::writeConfig()
159{ 155{
160 156
161 Config cfg( "bluetoothmanager" ); 157 Config cfg( "bluetoothmanager" );
162 cfg.setGroup( "bluezsettings" ); 158 cfg.setGroup( "bluezsettings" );
163 159
164 cfg.writeEntry( "name" , m_deviceName ); 160 cfg.writeEntry( "name" , m_deviceName );
165 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey ); 161 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey );
166 cfg.writeEntry( "useEncryption" , m_useEncryption ); 162 cfg.writeEntry( "useEncryption" , m_useEncryption );
167 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification ); 163 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification );
168 cfg.writeEntry( "enablePagescan" , m_enablePagescan ); 164 cfg.writeEntry( "enablePagescan" , m_enablePagescan );
169 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); 165 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan );
170 166
171 writeToHciConfig(); 167 writeToHciConfig();
172} 168}
173 169
174/** 170/**
175 * Modify the hcid.conf file to our needs 171 * Modify the hcid.conf file to our needs
176 */ 172 */
177void BlueBase::writeToHciConfig() 173void BlueBase::writeToHciConfig()
178{ 174{
179 QFile pinFile("/etc/bluetooth/pin"); // /etc/bluetooth/pin file 175 QFile pinFile("/etc/bluetooth/pin"); // /etc/bluetooth/pin file
180 owarn << "writeToHciConfig" << oendl; 176 owarn << "writeToHciConfig" << oendl;
181 //Write /etc/bluetooth/hcid.conf file 177 //Write /etc/bluetooth/hcid.conf file
182 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 178 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
183 hciconf.load(); 179 hciconf.load();
184 hciconf.setPinHelper( QPEApplication::qpeDir() + "bin/bluepin" ); 180 hciconf.setPinHelper( QPEApplication::qpeDir() + "bin/bluepin" );
185 hciconf.setName( m_deviceName ); 181 hciconf.setName( m_deviceName );
186 hciconf.setEncrypt( m_useEncryption ); 182 hciconf.setEncrypt( m_useEncryption );
187 hciconf.setAuth( m_enableAuthentification ); 183 hciconf.setAuth( m_enableAuthentification );
188 hciconf.setPscan( m_enablePagescan ); 184 hciconf.setPscan( m_enablePagescan );
189 hciconf.setIscan( m_enableInquiryscan ); 185 hciconf.setIscan( m_enableInquiryscan );
190 hciconf.save(); 186 hciconf.save();
191 // Write /etc/bluetooth/pin (default PIN file) 187 // Write /etc/bluetooth/pin (default PIN file)
192 pinFile.open(IO_WriteOnly | IO_Truncate); 188 pinFile.open(IO_WriteOnly | IO_Truncate);
193 pinFile.writeBlock(m_defaultPasskey, m_defaultPasskey.length()); 189 pinFile.writeBlock(m_defaultPasskey, m_defaultPasskey.length());
194 pinFile.writeBlock("\n", sizeof("\n")); 190 pinFile.writeBlock("\n", sizeof("\n"));
195 pinFile.flush(); 191 pinFile.flush();
196 pinFile.close(); 192 pinFile.close();
197} 193}
198 194
199 195
200/** 196/**
201 * Read the list of already known devices 197 * Read the list of already known devices
202 */ 198 */
203void BlueBase::readSavedDevices() 199void BlueBase::readSavedDevices()
204{ 200{
205 201
206 QValueList<RemoteDevice> loadedDevices; 202 QValueList<RemoteDevice> loadedDevices;
207 DeviceHandler handler; 203 DeviceHandler handler;
208 loadedDevices = handler.load(); 204 loadedDevices = handler.load();
209 205
210 addSearchedDevices( loadedDevices ); 206 addSearchedDevices( loadedDevices );
211} 207}
212 208
213 209
214/** 210/**
215 * Write the list of already known devices 211 * Write the list of already known devices
216 */ 212 */
217void BlueBase::writeSavedDevices() 213void BlueBase::writeSavedDevices()
218{ 214{
219 QListViewItemIterator it( devicesView ); 215 QListViewItemIterator it( devicesView );
220 BTListItem* item; 216 BTListItem* item;
221 BTDeviceItem* device; 217 BTDeviceItem* device;
222 RemoteDevice::ValueList list; 218 RemoteDevice::ValueList list;
223 for ( ; it.current(); ++it ) 219 for ( ; it.current(); ++it )
224 { 220 {
225 item = (BTListItem*)it.current(); 221 item = (BTListItem*)it.current();
226 if(item->typeId() != BTListItem::Device ) 222 if(item->typeId() != BTListItem::Device )
227 continue; 223 continue;
228 device = (BTDeviceItem*)item; 224 device = (BTDeviceItem*)item;
229 225
230 list.append( device->remoteDevice() ); 226 list.append( device->remoteDevice() );
231 } 227 }
232 /* 228 /*
233 * if not empty save the List through DeviceHandler 229 * if not empty save the List through DeviceHandler
234 */ 230 */
235 if ( list.isEmpty() ) 231 if ( list.isEmpty() )
236 return; 232 return;
237 DeviceHandler handler; 233 DeviceHandler handler;
238 handler.save( list ); 234 handler.save( list );
239} 235}
240 236
241 237
242/** 238/**
243 * Set up the gui 239 * Set up the gui
244 */ 240 */
245void BlueBase::initGui() 241void BlueBase::initGui()
246{ 242{
247 StatusLabel->setText( status() ); // maybe move it to getStatus() 243 StatusLabel->setText( status() ); // maybe move it to getStatus()
248 cryptCheckBox->setChecked( m_useEncryption ); 244 cryptCheckBox->setChecked( m_useEncryption );
249 authCheckBox->setChecked( m_enableAuthentification ); 245 authCheckBox->setChecked( m_enableAuthentification );
250 pagescanCheckBox->setChecked( m_enablePagescan ); 246 pagescanCheckBox->setChecked( m_enablePagescan );
251 inquiryscanCheckBox->setChecked( m_enableInquiryscan ); 247 inquiryscanCheckBox->setChecked( m_enableInquiryscan );
252 deviceNameLine->setText( m_deviceName ); 248 deviceNameLine->setText( m_deviceName );
253 passkeyLine->setText( m_defaultPasskey ); 249 passkeyLine->setText( m_defaultPasskey );
254 // set info tab 250 // set info tab
255 setInfo(); 251 setInfo();
252 serDevName->setText(tr("/dev/ircomm0"));
253 for (unsigned int i = 0; i < (sizeof(speeds) / sizeof(speeds[0])); i++) {
254 serSpeed->insertItem(speeds[i].str);
255 }
256 serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1);
257 encCheckBox->setChecked(true);
256} 258}
257 259
258 260
259/** 261/**
260 * Get the status informations and returns it 262 * Get the status informations and returns it
261 * @return QString the status informations gathered 263 * @return QString the status informations gathered
262 */ 264 */
263QString BlueBase::status()const 265QString BlueBase::status()const
264{ 266{
265 QString infoString = tr( "<b>Device name : </b> Ipaq" ); 267 QString infoString = tr( "<b>Device name : </b> Ipaq" );
266 infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" ); 268 infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" );
267 infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" ); 269 infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" );
268 270
269 return (infoString); 271 return (infoString);
270} 272}
271 273
272 274
273/** 275/**
274 * Read the current values from the gui and invoke writeConfig() 276 * Read the current values from the gui and invoke writeConfig()
275 */ 277 */
276void BlueBase::applyConfigChanges() 278void BlueBase::applyConfigChanges()
277{ 279{
278 m_deviceName = deviceNameLine->text(); 280 m_deviceName = deviceNameLine->text();
279 m_defaultPasskey = passkeyLine->text(); 281 m_defaultPasskey = passkeyLine->text();
280 m_useEncryption = cryptCheckBox->isChecked(); 282 m_useEncryption = cryptCheckBox->isChecked();
281 m_enableAuthentification = authCheckBox->isChecked(); 283 m_enableAuthentification = authCheckBox->isChecked();
282 m_enablePagescan = pagescanCheckBox->isChecked(); 284 m_enablePagescan = pagescanCheckBox->isChecked();
283 m_enableInquiryscan = inquiryscanCheckBox->isChecked(); 285 m_enableInquiryscan = inquiryscanCheckBox->isChecked();
284 286
285 writeConfig(); 287 writeConfig();
286 288
287 QMessageBox::information( this, tr("Test") , tr("Changes were applied.") ); 289 QMessageBox::information( this, tr("Test") , tr("Changes were applied.") );
288} 290}
289 291
290/** 292/**
291 * Launch Rfcomm Bind dialog 293 * Launch Rfcomm Bind dialog
292 * 294 *
293 */ 295 */
294void BlueBase::rfcommDialog() 296void BlueBase::rfcommDialog()
295{ 297{
296 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); 298 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
297 299
298 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted ) 300 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
299 { 301 {
300 rfcommAssign.saveConfig(); 302 rfcommAssign.saveConfig();
301 } 303 }
302} 304}
303 305
304/** 306/**
305 * Add fresh found devices from scan dialog to the listing 307 * Add fresh found devices from scan dialog to the listing
306 * 308 *
307 */ 309 */
308void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) 310void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices )
309{ 311{
310 BTDeviceItem * deviceItem; 312 BTDeviceItem * deviceItem;
311 QValueList<RemoteDevice>::ConstIterator it; 313 QValueList<RemoteDevice>::ConstIterator it;
312 314
313 for( it = newDevices.begin(); it != newDevices.end() ; ++it ) 315 for( it = newDevices.begin(); it != newDevices.end() ; ++it )
314 { 316 {
315 317
316 if (find( (*it) )) // is already inserted 318 if (find( (*it) )) // is already inserted
317 continue; 319 continue;
318 320
319 deviceItem = new BTDeviceItem( devicesView , (*it) ); 321 deviceItem = new BTDeviceItem( devicesView , (*it) );
320 deviceItem->setPixmap( 1, m_findPix ); 322 deviceItem->setPixmap( 1, m_findPix );
321 deviceItem->setExpandable ( true ); 323 deviceItem->setExpandable ( true );
322 324
323 // look if device is avail. atm, async 325 // look if device is avail. atm, async
324 deviceActive( (*it) ); 326 deviceActive( (*it) );
325 } 327 }
326} 328}
327 329
328 330
329/** 331/**
330 * Action that is toggled on entrys on click 332 * Action that is toggled on entrys on click
331 */ 333 */
332void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) 334void BlueBase::startServiceActionClicked( QListViewItem */*item*/ )
333{} 335{}
334 336
335 337
336/** 338/**
337 * Action that are toggled on hold (mostly QPopups i guess) 339 * Action that are toggled on hold (mostly QPopups i guess)
338 */ 340 */
339void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) 341void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ )
340{ 342{
341 if (!item ) 343 if (!item )
342 return; 344 return;
343 345
344 QPopupMenu *menu = new QPopupMenu(); 346 QPopupMenu *menu = new QPopupMenu();
345 347
346 if ( static_cast<BTListItem*>( item )->type() == "device") 348 if ( static_cast<BTListItem*>( item )->type() == "device")
347 { 349 {
348 QPopupMenu *groups = new QPopupMenu(); 350 QPopupMenu *groups = new QPopupMenu();
349 351
350 menu->insertItem( static_cast<BTDeviceItem*>( item )->name(), 0 ); 352 menu->insertItem( static_cast<BTDeviceItem*>( item )->name(), 0 );
351 menu->insertSeparator( 1 ); 353 menu->insertSeparator( 1 );
352 menu->insertItem( tr( "&Rescan services" ), 2); 354 menu->insertItem( tr( "&Rescan services" ), 2);
353 // menu->insertItem( tr( "&Add to group" ), groups, 3); 355 // menu->insertItem( tr( "&Add to group" ), groups, 3);
354 menu->insertItem( tr( "&Delete"), 4); 356 menu->insertItem( tr( "&Delete"), 4);
355 int ret = menu->exec( point, 0); 357 int ret = menu->exec( point, 0);
356 358
357 switch(ret) 359 switch(ret)
358 { 360 {
359 case -1: 361 case -1:
360 break; 362 break;
361 case 2: 363 case 2:
362 addServicesToDevice( static_cast<BTDeviceItem*>( item ) ); 364 addServicesToDevice( static_cast<BTDeviceItem*>( item ) );
363 break; 365 break;
364 366
365 case 4: 367 case 4:
366 // deletes childs too 368 // deletes childs too
367 delete item; 369 delete item;
368 break; 370 break;
369 } 371 }
370 // delete groups; 372 // delete groups;
371 } 373 }
372 374
373 /* 375 /*
374 * We got service sensitive PopupMenus in our factory 376 * We got service sensitive PopupMenus in our factory
375 * We will create one through the factory and will insert 377 * We will create one through the factory and will insert
376 * our Separator + ShowInfo into the menu or create a new 378 * our Separator + ShowInfo into the menu or create a new
377 * one if the factory returns 0 379 * one if the factory returns 0
378 * PopupMenu deletion is kind of weird. 380 * PopupMenu deletion is kind of weird.
379 * If escaped( -1 ) or any of our items were chosen we'll 381 * If escaped( -1 ) or any of our items were chosen we'll
380 * delete the PopupMenu otherwise it's the responsibility of 382 * delete the PopupMenu otherwise it's the responsibility of
381 * the PopupMenu to delete itself 383 * the PopupMenu to delete itself
382 * 384 *
383 */ 385 */
384 else if ( ((BTListItem*)item)->type() == "service") 386 else if ( ((BTListItem*)item)->type() == "service")
385 { 387 {
386 BTServiceItem* service = (BTServiceItem*)item; 388 BTServiceItem* service = (BTServiceItem*)item;
387 QMap<int, QString> list = service->services().classIdList(); 389 QMap<int, QString> list = service->services().classIdList();
388 QMap<int, QString>::Iterator it = list.begin(); 390 QMap<int, QString>::Iterator it = list.begin();
389 QPopupMenu *popup =0l; 391 QPopupMenu *popup =0l;
390 if ( it != list.end() ) 392 if ( it != list.end() )
391 { 393 {
392 owarn << "Searching id " << it.key() << " " << it.data().latin1() << "" << oendl; 394 owarn << "Searching id " << it.key() << " " << it.data().latin1() << "" << oendl;
393 popup = m_popHelper.find( it.key(), 395 popup = m_popHelper.find( it.key(),
394 service->services(), 396 service->services(),
395 (BTDeviceItem*)service->parent() ); 397 (BTDeviceItem*)service->parent() );
396 } 398 }
397 else 399 else
398 { 400 {
399 owarn << "Empty" << oendl; 401 owarn << "Empty" << oendl;
400 } 402 }
401 403
402 if ( popup == 0l ) 404 if ( popup == 0l )
403 { 405 {
404 owarn << "factory returned 0l" << oendl; 406 owarn << "factory returned 0l" << oendl;
405 popup = new QPopupMenu(); 407 popup = new QPopupMenu();
406 } 408 }
407 int test1 = popup->insertItem( tr("Test1:"), 2); 409 int test1 = popup->insertItem( tr("Test1:"), 2);
408 410
409 int ret = popup->exec( point ); 411 int ret = popup->exec( point );
410 owarn << "returned from exec() " << oendl; 412 owarn << "returned from exec() " << oendl;
411 if ( ret == -1 ) 413 if ( ret == -1 )
412 { 414 {
413 ; 415 ;
414 } 416 }
415 else if ( ret == test1 ) 417 else if ( ret == test1 )
416 { 418 {
417 ; 419 ;
418 } 420 }
419 delete popup; 421 delete popup;
420 } 422 }
421 delete menu; 423 delete menu;
422} 424}
423 425
424 426
425void BlueBase::addServicesToDevices() 427void BlueBase::addServicesToDevices()
426{ 428{
427 odebug << "BlueBase::addServicesToDevices()" << oendl; 429 odebug << "BlueBase::addServicesToDevices()" << oendl;
428 BTDeviceItem* item = (BTDeviceItem*) devicesView->firstChild(); 430 BTDeviceItem* item = (BTDeviceItem*) devicesView->firstChild();
429 while ( item ) 431 while ( item )
430 { 432 {
431 addServicesToDevice( item ); 433 addServicesToDevice( item );
432 item = (BTDeviceItem*) static_cast<QListViewItem*>( item )->nextSibling(); 434 item = (BTDeviceItem*) static_cast<QListViewItem*>( item )->nextSibling();
433 } 435 }
434} 436}
435 437
436/** 438/**
437 * Search and display avail. services for a device (on expand from device listing) 439 * Search and display avail. services for a device (on expand from device listing)
438 * @param item the service item returned 440 * @param item the service item returned
439 */ 441 */
440void BlueBase::addServicesToDevice( BTDeviceItem * item ) 442void BlueBase::addServicesToDevice( BTDeviceItem * item )
441{ 443{
442 odebug << "BlueBase::addServicesToDevice" << oendl; 444 odebug << "BlueBase::addServicesToDevice" << oendl;
443 // row of mac adress text(3) 445 // row of mac adress text(3)
444 RemoteDevice device = item->remoteDevice(); 446 RemoteDevice device = item->remoteDevice();
445 m_deviceList.insert( item->mac() , item ); 447 m_deviceList.insert( item->mac() , item );
446 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back 448 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back
447 m_localDevice->searchServices( device ); 449 m_localDevice->searchServices( device );
448} 450}
449 451
450 452
451/** 453/**
452 * @param device the mac address of the remote device 454 * @param device the mac address of the remote device
453 * @param servicesList the list with the service the device has. 455 * @param servicesList the list with the service the device has.
454 */ 456 */
455void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) 457void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList )
456{ 458{
457 odebug << "BlueBase::fill services list" << oendl; 459 odebug << "BlueBase::fill services list" << oendl;
458 460
459 QMap<QString,BTDeviceItem*>::Iterator it; 461 QMap<QString,BTDeviceItem*>::Iterator it;
460 BTDeviceItem* deviceItem = 0; 462 BTDeviceItem* deviceItem = 0;
461 463
462 // get the right devices which requested the search 464 // get the right devices which requested the search
463 it = m_deviceList.find( device ); 465 it = m_deviceList.find( device );
464 if( it == m_deviceList.end() ) 466 if( it == m_deviceList.end() )
465 return; 467 return;
466 deviceItem = it.data(); 468 deviceItem = it.data();
467 469
468 // remove previous entries 470 // remove previous entries
469 QList<QListViewItem> tempList; 471 QList<QListViewItem> tempList;
470 tempList.setAutoDelete( true ); 472 tempList.setAutoDelete( true );
471 QListViewItem * child = deviceItem->firstChild(); 473 QListViewItem * child = deviceItem->firstChild();
472 while( child ) 474 while( child )
473 { 475 {
474 tempList.append( child ); 476 tempList.append( child );
475 child = child->nextSibling(); 477 child = child->nextSibling();
476 } 478 }
477 tempList.clear(); 479 tempList.clear();
478 480
479 QValueList<OpieTooth::Services>::Iterator it2; 481 QValueList<OpieTooth::Services>::Iterator it2;
480 BTServiceItem* serviceItem; 482 BTServiceItem* serviceItem;
481 483
482 484
483 if (!servicesList.isEmpty() ) 485 if (!servicesList.isEmpty() )
484 { 486 {
485 // add services 487 // add services
486 QMap<int, QString> list; 488 QMap<int, QString> list;
487 QMap<int, QString>::Iterator classIt; 489 QMap<int, QString>::Iterator classIt;
488 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) 490 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 )
489 { 491 {
490 serviceItem = new BTServiceItem( deviceItem, (*it2) ); 492 serviceItem = new BTServiceItem( deviceItem, (*it2) );
491 list = (*it2).classIdList(); 493 list = (*it2).classIdList();
492 classIt = list.begin(); 494 classIt = list.begin();
493 int classId=0; 495 int classId=0;
494 if ( classIt != list.end() ) 496 if ( classIt != list.end() )
495 { 497 {
496 classId = classIt.key(); 498 classId = classIt.key();
497 } 499 }
498 500
499 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) ); 501 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) );
500 } 502 }
501 } 503 }
502 else 504 else
503 { 505 {
504 Services s1; 506 Services s1;
505 s1.setServiceName( tr("no services found") ); 507 s1.setServiceName( tr("no services found") );
506 serviceItem = new BTServiceItem( deviceItem, s1 ); 508 serviceItem = new BTServiceItem( deviceItem, s1 );
507 } 509 }
508 // now remove them from the list 510 // now remove them from the list
509 m_deviceList.remove( it ); 511 m_deviceList.remove( it );
510} 512}
511 513
512void BlueBase::addSignalStrength() 514void BlueBase::addSignalStrength()
513{ 515{
514 516
515 QListViewItemIterator it( connectionsView ); 517 QListViewItemIterator it( connectionsView );
516 for ( ; it.current(); ++it ) 518 for ( ; it.current(); ++it )
517 { 519 {
518 m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() ); 520 m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() );
519 } 521 }
520 522
521 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) ); 523 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
522} 524}
523 525
524void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) 526void BlueBase::addSignalStrength( const QString& mac, const QString& strength )
525{ 527{
526 528
527 QListViewItemIterator it( connectionsView ); 529 QListViewItemIterator it( connectionsView );
528 for ( ; it.current(); ++it ) 530 for ( ; it.current(); ++it )
529 { 531 {
530 if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) 532 if( ((BTConnectionItem*)it.current())->connection().mac() == mac )
531 { 533 {
532 ((BTConnectionItem*)it.current() )->setSignalStrength( strength ); 534 ((BTConnectionItem*)it.current() )->setSignalStrength( strength );
533 } 535 }
534 } 536 }
535} 537}
536 538
537/** 539/**
538 * Add the existing connections (pairs) to the connections tab. 540 * Add the existing connections (pairs) to the connections tab.
539 * This one triggers the search 541 * This one triggers the search
540 */ 542 */
541void BlueBase::addConnectedDevices() 543void BlueBase::addConnectedDevices()
542{ 544{
543 m_localDevice->searchConnections(); 545 m_localDevice->searchConnections();
544 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) ); 546 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
545} 547}
546 548
547/** 549/**
548 * This adds the found connections to the connection tab. 550 * This adds the found connections to the connection tab.
549 * @param connectionList the ValueList with all current connections 551 * @param connectionList the ValueList with all current connections
550 */ 552 */
551void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) 553void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
552{ 554{
553 555
554 QValueList<OpieTooth::ConnectionState>::Iterator it; 556 QValueList<OpieTooth::ConnectionState>::Iterator it;
555 BTConnectionItem * connectionItem; 557 BTConnectionItem * connectionItem;
556 558
557 if ( !connectionList.isEmpty() ) 559 if ( !connectionList.isEmpty() )
558 { 560 {
559 561
560 for (it = connectionList.begin(); it != connectionList.end(); ++it) 562 for (it = connectionList.begin(); it != connectionList.end(); ++it)
561 { 563 {
562 564
563 QListViewItemIterator it2( connectionsView ); 565 QListViewItemIterator it2( connectionsView );
564 bool found = false; 566 bool found = false;
565 for ( ; it2.current(); ++it2 ) 567 for ( ; it2.current(); ++it2 )
566 { 568 {
567 if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() ) 569 if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() )
568 { 570 {
569 found = true; 571 found = true;
570 } 572 }
571 } 573 }
572 574
573 if ( found == false ) 575 if ( found == false )
574 { 576 {
575 connectionItem = new BTConnectionItem( connectionsView, (*it) ); 577 connectionItem = new BTConnectionItem( connectionsView, (*it) );
576 578
577 if( m_deviceList.find((*it).mac()).data() ) 579 if( m_deviceList.find((*it).mac()).data() )
578 { 580 {
579 connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() ); 581 connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() );
580 } 582 }
581 } 583 }
582 584
583 } 585 }
584 586
585 QListViewItemIterator it2( connectionsView ); 587 QListViewItemIterator it2( connectionsView );
586 for ( ; it2.current(); ++it2 ) 588 for ( ; it2.current(); ++it2 )
587 { 589 {
588 bool found = false; 590 bool found = false;
589 for (it = connectionList.begin(); it != connectionList.end(); ++it) 591 for (it = connectionList.begin(); it != connectionList.end(); ++it)
590 { 592 {
591 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) 593 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() )
592 { 594 {
593 found = true; 595 found = true;
594 } 596 }
595 } 597 }
596 598
597 if ( !found ) 599 if ( !found )
598 { 600 {
599 delete it2.current(); 601 delete it2.current();
600 } 602 }
601 603
602 } 604 }
603 605
604 606
605 } 607 }
606 else 608 else
607 { 609 {
608 connectionsView->clear(); 610 connectionsView->clear();
609 ConnectionState con; 611 ConnectionState con;
610 con.setMac( tr("No connections found") ); 612 con.setMac( tr("No connections found") );
611 connectionItem = new BTConnectionItem( connectionsView , con ); 613 connectionItem = new BTConnectionItem( connectionsView , con );
612 } 614 }
613 615
614 // recall connection search after some time 616 // recall connection search after some time
615 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) ); 617 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) );
616} 618}
617 619
618 620
619/** 621/**
620 * Find out if a device can currently be reached 622 * Find out if a device can currently be reached
621 * @param device 623 * @param device
622 */ 624 */
623void BlueBase::deviceActive( const RemoteDevice &device ) 625void BlueBase::deviceActive( const RemoteDevice &device )
624{ 626{
625 // search by mac, async, gets a signal back 627 // search by mac, async, gets a signal back
626 // We should have a BTDeviceItem there or where does it get added to the map -zecke 628 // We should have a BTDeviceItem there or where does it get added to the map -zecke
627 m_localDevice->isAvailable( device.mac() ); 629 m_localDevice->isAvailable( device.mac() );
628} 630}
629 631
630 632
631/** 633/**
632 * The signal catcher. Set the avail. status on device. 634 * The signal catcher. Set the avail. status on device.
633 * @param device - the mac address 635 * @param device - the mac address
634 * @param connected - if it is avail. or not 636 * @param connected - if it is avail. or not
635 */ 637 */
636void BlueBase::deviceActive( const QString& device, bool connected ) 638void BlueBase::deviceActive( const QString& device, bool connected )
637{ 639{
638 odebug << "deviceActive slot" << oendl; 640 odebug << "deviceActive slot" << oendl;
639 641
640 QMap<QString,BTDeviceItem*>::Iterator it; 642 QMap<QString,BTDeviceItem*>::Iterator it;
641 643
642 it = m_deviceList.find( device ); 644 it = m_deviceList.find( device );
643 if( it == m_deviceList.end() ) 645 if( it == m_deviceList.end() )
644 return; 646 return;
645 647
646 BTDeviceItem* deviceItem = it.data(); 648 BTDeviceItem* deviceItem = it.data();
647 649
648 if ( connected ) 650 if ( connected )
649 { 651 {
650 deviceItem->setPixmap( 1, m_onPix ); 652 deviceItem->setPixmap( 1, m_onPix );
651 } 653 }
652 else 654 else
653 { 655 {
654 deviceItem->setPixmap( 1, m_offPix ); 656 deviceItem->setPixmap( 1, m_offPix );
655 } 657 }
656 m_deviceList.remove( it ); 658 m_deviceList.remove( it );
657} 659}
658 660
659 661
660/** 662/**
661 * Open the "scan for devices" dialog 663 * Open the "scan for devices" dialog
662 */ 664 */
663void BlueBase::startScan() 665void BlueBase::startScan()
664{ 666{
665 ScanDialog *scan = new ScanDialog( this, "ScanDialog", 667 ScanDialog *scan = new ScanDialog( this, "ScanDialog",
666 true, WDestructiveClose ); 668 true, WDestructiveClose );
667 QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ), 669 QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ),
668 this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) ); 670 this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) );
669 671
670 QPEApplication::showDialog( scan ); 672 QPEApplication::showDialog( scan );
671} 673}
672 674
673 675
674/** 676/**
675 * Set the informations about the local device in information Tab 677 * Set the informations about the local device in information Tab
676 */ 678 */
677void BlueBase::setInfo() 679void BlueBase::setInfo()
678{ 680{
679 StatusLabel->setText( status() ); 681 StatusLabel->setText( status() );
680} 682}
681 683
682 684
683/** 685/**
684 * Decontructor 686 * Decontructor
685 */ 687 */
686BlueBase::~BlueBase() 688BlueBase::~BlueBase()
687{ 689{
688 writeSavedDevices(); 690 writeSavedDevices();
689 delete m_iconLoader; 691 delete m_iconLoader;
690} 692}
691 693
692 694
693/** 695/**
694 * find searches the ListView for a BTDeviceItem containig 696 * find searches the ListView for a BTDeviceItem containig
695 * the same Device if found return true else false 697 * the same Device if found return true else false
696 * @param dev RemoteDevice to find 698 * @param dev RemoteDevice to find
697 * @return returns true if found 699 * @return returns true if found
698 */ 700 */
699bool BlueBase::find( const RemoteDevice& rem ) 701bool BlueBase::find( const RemoteDevice& rem )
700{ 702{
701 QListViewItemIterator it( devicesView ); 703 QListViewItemIterator it( devicesView );
702 BTListItem* item; 704 BTListItem* item;
703 BTDeviceItem* device; 705 BTDeviceItem* device;
704 for (; it.current(); ++it ) 706 for (; it.current(); ++it )
705 { 707 {
706 item = (BTListItem*) it.current(); 708 item = (BTListItem*) it.current();
707 if ( item->typeId() != BTListItem::Device ) 709 if ( item->typeId() != BTListItem::Device )
708 continue; 710 continue;
709 711
710 device = (BTDeviceItem*)item; 712 device = (BTDeviceItem*)item;
711 if ( rem.equals( device->remoteDevice() ) ) 713 if ( rem.equals( device->remoteDevice() ) )
712 return true; 714 return true;
713 } 715 }
714 return false; // not found 716 return false; // not found
715} 717}
716 718
717/** 719/**
718 * Start process of the cell phone forwarding 720 * Start process of the cell phone forwarding
719 */ 721 */
720void BlueBase::doForward() 722void BlueBase::doForward()
721{ 723{
722 if (forwarder && forwarder->isRunning()) { 724 if (forwarder && forwarder->isRunning()) {
723 runButton->setText("start gateway"); 725 runButton->setText("start gateway");
724 forwarder->stop(); 726 forwarder->stop();
725 delete forwarder; 727 delete forwarder;
726 forwarder = NULL; 728 forwarder = NULL;
727 return; 729 return;
728 } 730 }
729 QString str = serDevName->text(); 731 QString str = serDevName->text();
730 forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val); 732 forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val);
731 connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), 733 connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)),
732 this, SLOT(forwardExited(Opie::Core::OProcess*))); 734 this, SLOT(forwardExited(Opie::Core::OProcess*)));
733 if (forwarder->start(OProcess::NotifyOnExit) < 0) { 735 if (forwarder->start(OProcess::NotifyOnExit) < 0) {
734 QMessageBox::critical(this, tr("Forwarder Error"), 736 QMessageBox::critical(this, tr("Forwarder Error"),
735 tr("Forwarder start error:") + tr(strerror(errno))); 737 tr("Forwarder start error:") + tr(strerror(errno)));
736 return; 738 return;
737 } 739 }
738 runButton->setText("stop gateway"); 740 runButton->setText("stop gateway");
739} 741}
740 742
741/** 743/**
742 * React on the process end 744 * React on the process end
743 */ 745 */
744void BlueBase::forwardExit(Opie::Core::OProcess* proc) 746void BlueBase::forwardExit(Opie::Core::OProcess* proc)
745{ 747{
746 if (proc->exitStatus() != 0) 748 if (proc->exitStatus() != 0)
747 QMessageBox::critical(this, tr("Forwarder Error"), 749 QMessageBox::critical(this, tr("Forwarder Error"),
748 tr("Forwarder start error")); 750 tr("Forwarder start error"));
749 delete proc; 751 delete proc;
750 forwarder = NULL; 752 forwarder = NULL;
751 runButton->setText("start gateway"); 753 runButton->setText("start gateway");
752} 754}
753 755
754/** 756/**
755 * Encrypt entered passkey 757 * Encrypt entered passkey
756 * doit - do encryption of the key 758 * doit - do encryption of the key
757 */ 759 */
758void BlueBase::doEncrypt(bool doit) 760void BlueBase::doEncrypt(bool doit)
759{ 761{
760 passkeyLine->setEchoMode((doit)? QLineEdit::Password: QLineEdit::Normal); 762 passkeyLine->setEchoMode((doit)? QLineEdit::Password: QLineEdit::Normal);
761} 763}
762 764
765/**
766 * Start services edit dialog
767 */
768void BlueBase::editServices()
769{
770 QString conf = "/etc/default/bluetooth";
771//// Use for debugging purposes
772//// QString conf = "/mnt/net/opie/bin/bluetooth";
773 ServicesDialog svcEdit(conf, this, "ServicesDialog", true,
774 WStyle_ContextHelp);
775
776 if (QPEApplication::execDialog(&svcEdit) == QDialog::Accepted)
777 {
778 }
779}
780
763//eof 781//eof
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 9cbea56..d3e21f4 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -1,107 +1,108 @@
1 1
2#ifndef BLUEBASE_H 2#ifndef BLUEBASE_H
3#define BLUEBASE_H 3#define BLUEBASE_H
4 4
5#include <qvariant.h> 5#include <qvariant.h>
6#include <qwidget.h> 6#include <qwidget.h>
7#include <qscrollview.h> 7#include <qscrollview.h>
8#include <qsplitter.h> 8#include <qsplitter.h>
9#include <qlist.h> 9#include <qlist.h>
10#include <qpixmap.h> 10#include <qpixmap.h>
11 11
12#include "bluetoothbase.h" 12#include "bluetoothbase.h"
13 13
14#include "btserviceitem.h" 14#include "btserviceitem.h"
15#include "btdeviceitem.h" 15#include "btdeviceitem.h"
16 16
17#include "popuphelper.h" 17#include "popuphelper.h"
18 18
19#include "bticonloader.h" 19#include "bticonloader.h"
20#include "forwarder.h" 20#include "forwarder.h"
21 21
22#include <remotedevice.h> 22#include <remotedevice.h>
23#include <manager.h> 23#include <manager.h>
24 24
25class QVBox; 25class QVBox;
26class QHBoxLayout; 26class QHBoxLayout;
27class QGridLayout; 27class QGridLayout;
28class QFrame; 28class QFrame;
29class QLabel; 29class QLabel;
30class QPushButton; 30class QPushButton;
31class QTabWidget; 31class QTabWidget;
32class QCheckBox; 32class QCheckBox;
33class BTConnectionItem; 33class BTConnectionItem;
34 34
35 35
36namespace OpieTooth { 36namespace OpieTooth {
37 37
38 class BlueBase : public BluetoothBase { 38 class BlueBase : public BluetoothBase {
39 Q_OBJECT 39 Q_OBJECT
40 40
41 public: 41 public:
42 BlueBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 42 BlueBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
43 ~BlueBase(); 43 ~BlueBase();
44 44
45 static QString appName() { return QString::fromLatin1("bluetooth-manager"); } 45 static QString appName() { return QString::fromLatin1("bluetooth-manager"); }
46 46
47 protected: 47 protected:
48 48
49 49
50 private slots: 50 private slots:
51 void startScan(); 51 void startScan();
52 52
53 53
54 private: 54 private:
55 bool find( const RemoteDevice& device ); 55 bool find( const RemoteDevice& device );
56 void readConfig(); 56 void readConfig();
57 void writeConfig(); 57 void writeConfig();
58 void readSavedDevices(); 58 void readSavedDevices();
59 void writeSavedDevices(); 59 void writeSavedDevices();
60 void writeToHciConfig(); 60 void writeToHciConfig();
61 QString status()const; 61 QString status()const;
62 void initGui(); 62 void initGui();
63 void setInfo(); 63 void setInfo();
64 64
65 PopupHelper m_popHelper; 65 PopupHelper m_popHelper;
66 Manager *m_localDevice; 66 Manager *m_localDevice;
67 QMap<QString,BTDeviceItem*> m_deviceList; 67 QMap<QString,BTDeviceItem*> m_deviceList;
68 68
69 void deviceActive( const RemoteDevice &device ); 69 void deviceActive( const RemoteDevice &device );
70 70
71 QString m_deviceName; 71 QString m_deviceName;
72 QString m_defaultPasskey; 72 QString m_defaultPasskey;
73 bool m_useEncryption; 73 bool m_useEncryption;
74 bool m_enableAuthentification; 74 bool m_enableAuthentification;
75 bool m_enablePagescan; 75 bool m_enablePagescan;
76 bool m_enableInquiryscan; 76 bool m_enableInquiryscan;
77 77
78 QPixmap m_offPix; 78 QPixmap m_offPix;
79 QPixmap m_onPix; 79 QPixmap m_onPix;
80 QPixmap m_findPix; 80 QPixmap m_findPix;
81 81
82 BTIconLoader *m_iconLoader; 82 BTIconLoader *m_iconLoader;
83 SerialForwarder* forwarder; 83 SerialForwarder* forwarder;
84 84
85 private slots: 85 private slots:
86 void addSearchedDevices( const QValueList<RemoteDevice> &newDevices ); 86 void addSearchedDevices( const QValueList<RemoteDevice> &newDevices );
87 void addServicesToDevices(); 87 void addServicesToDevices();
88 void addServicesToDevice( BTDeviceItem *item ); 88 void addServicesToDevice( BTDeviceItem *item );
89 void addServicesToDevice( const QString& device, Services::ValueList ); 89 void addServicesToDevice( const QString& device, Services::ValueList );
90 void addConnectedDevices(); 90 void addConnectedDevices();
91 void addConnectedDevices( ConnectionState::ValueList ); 91 void addConnectedDevices( ConnectionState::ValueList );
92 void startServiceActionClicked( QListViewItem *item ); 92 void startServiceActionClicked( QListViewItem *item );
93 void startServiceActionHold( QListViewItem *, const QPoint &, int ); 93 void startServiceActionHold( QListViewItem *, const QPoint &, int );
94 void deviceActive( const QString& mac, bool connected ); 94 void deviceActive( const QString& mac, bool connected );
95 void applyConfigChanges(); 95 void applyConfigChanges();
96 void doForward(); 96 void doForward();
97 void doEncrypt(bool); 97 void doEncrypt(bool);
98 void forwardExit(Opie::Core::OProcess* proc); 98 void forwardExit(Opie::Core::OProcess* proc);
99 void editServices();
99 void addSignalStrength(); 100 void addSignalStrength();
100 void addSignalStrength( const QString& mac, const QString& strengh ); 101 void addSignalStrength( const QString& mac, const QString& strengh );
101 void rfcommDialog(); 102 void rfcommDialog();
102 103
103 }; 104 };
104 105
105} 106}
106 107
107#endif 108#endif
diff --git a/noncore/net/opietooth/manager/bluetoothbase.ui b/noncore/net/opietooth/manager/bluetoothbase.ui
index 5539181..350da63 100644
--- a/noncore/net/opietooth/manager/bluetoothbase.ui
+++ b/noncore/net/opietooth/manager/bluetoothbase.ui
@@ -1,522 +1,533 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>BluetoothBase</class> 2<class>BluetoothBase</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>BluetoothBase</cstring> 7 <cstring>BluetoothBase</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>273</width> 14 <width>269</width>
15 <height>368</height> 15 <height>368</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>Form1</string> 20 <string>Form1</string>
21 </property> 21 </property>
22 <hbox> 22 <hbox>
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>QTabWidget</class> 32 <class>QTabWidget</class>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>name</name> 34 <name>name</name>
35 <cstring>Status</cstring> 35 <cstring>Status</cstring>
36 </property> 36 </property>
37 <property> 37 <property>
38 <name>layoutMargin</name> 38 <name>layoutMargin</name>
39 </property> 39 </property>
40 <property> 40 <property>
41 <name>layoutSpacing</name> 41 <name>layoutSpacing</name>
42 </property> 42 </property>
43 <widget> 43 <widget>
44 <class>QWidget</class> 44 <class>QWidget</class>
45 <property stdset="1"> 45 <property stdset="1">
46 <name>name</name> 46 <name>name</name>
47 <cstring>tab</cstring> 47 <cstring>tab</cstring>
48 </property> 48 </property>
49 <attribute> 49 <attribute>
50 <name>title</name> 50 <name>title</name>
51 <string>Devices</string> 51 <string>Devices</string>
52 </attribute> 52 </attribute>
53 <vbox> 53 <vbox>
54 <property stdset="1"> 54 <property stdset="1">
55 <name>margin</name> 55 <name>margin</name>
56 <number>4</number> 56 <number>4</number>
57 </property> 57 </property>
58 <property stdset="1"> 58 <property stdset="1">
59 <name>spacing</name> 59 <name>spacing</name>
60 <number>2</number> 60 <number>2</number>
61 </property> 61 </property>
62 <widget> 62 <widget>
63 <class>QListView</class> 63 <class>QListView</class>
64 <column> 64 <column>
65 <property> 65 <property>
66 <name>text</name> 66 <name>text</name>
67 <string>Device Name</string> 67 <string>Device Name</string>
68 </property> 68 </property>
69 <property> 69 <property>
70 <name>clickable</name> 70 <name>clickable</name>
71 <bool>true</bool> 71 <bool>true</bool>
72 </property> 72 </property>
73 <property> 73 <property>
74 <name>resizeable</name> 74 <name>resizeable</name>
75 <bool>true</bool> 75 <bool>true</bool>
76 </property> 76 </property>
77 </column> 77 </column>
78 <column> 78 <column>
79 <property> 79 <property>
80 <name>text</name> 80 <name>text</name>
81 <string>Online</string> 81 <string>Online</string>
82 </property> 82 </property>
83 <property> 83 <property>
84 <name>clickable</name> 84 <name>clickable</name>
85 <bool>true</bool> 85 <bool>true</bool>
86 </property> 86 </property>
87 <property> 87 <property>
88 <name>resizeable</name> 88 <name>resizeable</name>
89 <bool>true</bool> 89 <bool>true</bool>
90 </property> 90 </property>
91 </column> 91 </column>
92 <property stdset="1"> 92 <property stdset="1">
93 <name>name</name> 93 <name>name</name>
94 <cstring>devicesView</cstring> 94 <cstring>devicesView</cstring>
95 </property> 95 </property>
96 </widget> 96 </widget>
97 <widget> 97 <widget>
98 <class>QPushButton</class> 98 <class>QPushButton</class>
99 <property stdset="1"> 99 <property stdset="1">
100 <name>name</name> 100 <name>name</name>
101 <cstring>PushButton2</cstring> 101 <cstring>PushButton2</cstring>
102 </property> 102 </property>
103 <property stdset="1"> 103 <property stdset="1">
104 <name>sizePolicy</name> 104 <name>sizePolicy</name>
105 <sizepolicy> 105 <sizepolicy>
106 <hsizetype>0</hsizetype> 106 <hsizetype>0</hsizetype>
107 <vsizetype>0</vsizetype> 107 <vsizetype>0</vsizetype>
108 </sizepolicy> 108 </sizepolicy>
109 </property> 109 </property>
110 <property stdset="1"> 110 <property stdset="1">
111 <name>text</name> 111 <name>text</name>
112 <string>&amp;Rescan Devices</string> 112 <string>&amp;Rescan Devices</string>
113 </property> 113 </property>
114 </widget> 114 </widget>
115 </vbox> 115 </vbox>
116 </widget> 116 </widget>
117 <widget> 117 <widget>
118 <class>QWidget</class> 118 <class>QWidget</class>
119 <property stdset="1"> 119 <property stdset="1">
120 <name>name</name> 120 <name>name</name>
121 <cstring>tab</cstring> 121 <cstring>tab</cstring>
122 </property> 122 </property>
123 <attribute> 123 <attribute>
124 <name>title</name> 124 <name>title</name>
125 <string>Connections</string> 125 <string>Connections</string>
126 </attribute> 126 </attribute>
127 <vbox> 127 <vbox>
128 <property stdset="1"> 128 <property stdset="1">
129 <name>margin</name> 129 <name>margin</name>
130 <number>4</number> 130 <number>4</number>
131 </property> 131 </property>
132 <property stdset="1"> 132 <property stdset="1">
133 <name>spacing</name> 133 <name>spacing</name>
134 <number>2</number> 134 <number>2</number>
135 </property> 135 </property>
136 <widget> 136 <widget>
137 <class>QListView</class> 137 <class>QListView</class>
138 <column> 138 <column>
139 <property> 139 <property>
140 <name>text</name> 140 <name>text</name>
141 <string>Device Name</string> 141 <string>Device Name</string>
142 </property> 142 </property>
143 <property> 143 <property>
144 <name>clickable</name> 144 <name>clickable</name>
145 <bool>true</bool> 145 <bool>true</bool>
146 </property> 146 </property>
147 <property> 147 <property>
148 <name>resizeable</name> 148 <name>resizeable</name>
149 <bool>true</bool> 149 <bool>true</bool>
150 </property> 150 </property>
151 </column> 151 </column>
152 <column> 152 <column>
153 <property> 153 <property>
154 <name>text</name> 154 <name>text</name>
155 <string>Connection type</string> 155 <string>Connection type</string>
156 </property> 156 </property>
157 <property> 157 <property>
158 <name>clickable</name> 158 <name>clickable</name>
159 <bool>true</bool> 159 <bool>true</bool>
160 </property> 160 </property>
161 <property> 161 <property>
162 <name>resizeable</name> 162 <name>resizeable</name>
163 <bool>true</bool> 163 <bool>true</bool>
164 </property> 164 </property>
165 </column> 165 </column>
166 <column> 166 <column>
167 <property> 167 <property>
168 <name>text</name> 168 <name>text</name>
169 <string>Signal</string> 169 <string>Signal</string>
170 </property> 170 </property>
171 <property> 171 <property>
172 <name>clickable</name> 172 <name>clickable</name>
173 <bool>true</bool> 173 <bool>true</bool>
174 </property> 174 </property>
175 <property> 175 <property>
176 <name>resizeable</name> 176 <name>resizeable</name>
177 <bool>true</bool> 177 <bool>true</bool>
178 </property> 178 </property>
179 </column> 179 </column>
180 <property stdset="1"> 180 <property stdset="1">
181 <name>name</name> 181 <name>name</name>
182 <cstring>connectionsView</cstring> 182 <cstring>connectionsView</cstring>
183 </property> 183 </property>
184 </widget> 184 </widget>
185 </vbox> 185 </vbox>
186 </widget> 186 </widget>
187 <widget> 187 <widget>
188 <class>QWidget</class> 188 <class>QWidget</class>
189 <property stdset="1"> 189 <property stdset="1">
190 <name>name</name> 190 <name>name</name>
191 <cstring>tab</cstring> 191 <cstring>tab</cstring>
192 </property> 192 </property>
193 <attribute> 193 <attribute>
194 <name>title</name> 194 <name>title</name>
195 <string>Config</string> 195 <string>Config</string>
196 </attribute> 196 </attribute>
197 <grid> 197 <vbox>
198 <property stdset="1"> 198 <property stdset="1">
199 <name>margin</name> 199 <name>margin</name>
200 <number>4</number> 200 <number>2</number>
201 </property> 201 </property>
202 <property stdset="1"> 202 <property stdset="1">
203 <name>spacing</name> 203 <name>spacing</name>
204 <number>2</number> 204 <number>2</number>
205 </property> 205 </property>
206 <widget row="1" column="0" > 206 <widget>
207 <class>QPushButton</class>
208 <property stdset="1">
209 <name>name</name>
210 <cstring>rfcommBindButton</cstring>
211 </property>
212 <property stdset="1">
213 <name>text</name>
214 <string>&amp;Edit RFCOMM Bind Table</string>
215 </property>
216 </widget>
217 <widget row="0" column="0" >
218 <class>QGroupBox</class> 207 <class>QGroupBox</class>
219 <property stdset="1"> 208 <property stdset="1">
220 <name>name</name> 209 <name>name</name>
221 <cstring>GroupBox1</cstring> 210 <cstring>GroupBox1</cstring>
222 </property> 211 </property>
223 <property stdset="1"> 212 <property stdset="1">
224 <name>title</name> 213 <name>title</name>
225 <string>Bluetooth Basic Config</string> 214 <string>Bluetooth Basic Config</string>
226 </property> 215 </property>
227 <property> 216 <property>
228 <name>layoutMargin</name> 217 <name>layoutMargin</name>
229 </property> 218 </property>
230 <property> 219 <property>
231 <name>layoutSpacing</name> 220 <name>layoutSpacing</name>
232 </property> 221 </property>
233 <grid> 222 <grid>
234 <property stdset="1"> 223 <property stdset="1">
235 <name>margin</name> 224 <name>margin</name>
236 <number>4</number> 225 <number>4</number>
237 </property> 226 </property>
238 <property stdset="1"> 227 <property stdset="1">
239 <name>spacing</name> 228 <name>spacing</name>
240 <number>2</number> 229 <number>2</number>
241 </property> 230 </property>
242 <widget row="0" column="0" > 231 <widget row="0" column="0" >
243 <class>QLabel</class> 232 <class>QLabel</class>
244 <property stdset="1"> 233 <property stdset="1">
245 <name>name</name> 234 <name>name</name>
246 <cstring>deviceNameLabel</cstring> 235 <cstring>deviceNameLabel</cstring>
247 </property> 236 </property>
248 <property stdset="1"> 237 <property stdset="1">
249 <name>text</name> 238 <name>text</name>
250 <string>Device Name</string> 239 <string>Device Name</string>
251 </property> 240 </property>
252 </widget> 241 </widget>
253 <widget row="1" column="0" > 242 <widget row="1" column="0" >
254 <class>QLabel</class> 243 <class>QLabel</class>
255 <property stdset="1"> 244 <property stdset="1">
256 <name>name</name> 245 <name>name</name>
257 <cstring>passkeyLabel</cstring> 246 <cstring>passkeyLabel</cstring>
258 </property> 247 </property>
259 <property stdset="1"> 248 <property stdset="1">
260 <name>text</name> 249 <name>text</name>
261 <string>Default Passkey</string> 250 <string>Default Passkey</string>
262 </property> 251 </property>
263 </widget> 252 </widget>
264 <widget row="0" column="1" > 253 <widget row="0" column="1" >
265 <class>QLineEdit</class> 254 <class>QLineEdit</class>
266 <property stdset="1"> 255 <property stdset="1">
267 <name>name</name> 256 <name>name</name>
268 <cstring>deviceNameLine</cstring> 257 <cstring>deviceNameLine</cstring>
269 </property> 258 </property>
270 </widget> 259 </widget>
271 <widget row="1" column="1" > 260 <widget row="1" column="1" >
272 <class>QLineEdit</class> 261 <class>QLineEdit</class>
273 <property stdset="1"> 262 <property stdset="1">
274 <name>name</name> 263 <name>name</name>
275 <cstring>passkeyLine</cstring> 264 <cstring>passkeyLine</cstring>
276 </property> 265 </property>
277 <property stdset="1"> 266 <property stdset="1">
278 <name>echoMode</name> 267 <name>echoMode</name>
279 <enum>Password</enum> 268 <enum>Password</enum>
280 </property> 269 </property>
281 </widget> 270 </widget>
282 <widget row="2" column="1" > 271 <widget row="2" column="1" >
283 <class>QCheckBox</class> 272 <class>QCheckBox</class>
284 <property stdset="1"> 273 <property stdset="1">
285 <name>name</name> 274 <name>name</name>
286 <cstring>encCheckBox</cstring> 275 <cstring>encCheckBox</cstring>
287 </property> 276 </property>
288 <property stdset="1"> 277 <property stdset="1">
289 <name>text</name> 278 <name>text</name>
290 <string>encrypt</string> 279 <string>encrypt</string>
291 </property> 280 </property>
292 </widget> 281 </widget>
293 <widget row="3" column="0" rowspan="1" colspan="2" > 282 <widget row="3" column="0" rowspan="1" colspan="2" >
294 <class>QCheckBox</class> 283 <class>QCheckBox</class>
295 <property stdset="1"> 284 <property stdset="1">
296 <name>name</name> 285 <name>name</name>
297 <cstring>authCheckBox</cstring> 286 <cstring>authCheckBox</cstring>
298 </property> 287 </property>
299 <property stdset="1"> 288 <property stdset="1">
300 <name>text</name> 289 <name>text</name>
301 <string>enable authentification</string> 290 <string>enable authentification</string>
302 </property> 291 </property>
303 </widget> 292 </widget>
304 <widget row="4" column="0" rowspan="1" colspan="2" > 293 <widget row="4" column="0" rowspan="1" colspan="2" >
305 <class>QCheckBox</class> 294 <class>QCheckBox</class>
306 <property stdset="1"> 295 <property stdset="1">
307 <name>name</name> 296 <name>name</name>
308 <cstring>cryptCheckBox</cstring> 297 <cstring>cryptCheckBox</cstring>
309 </property> 298 </property>
310 <property stdset="1"> 299 <property stdset="1">
311 <name>text</name> 300 <name>text</name>
312 <string>enable encryption</string> 301 <string>enable encryption</string>
313 </property> 302 </property>
314 </widget> 303 </widget>
315 <widget row="5" column="0" rowspan="1" colspan="2" > 304 <widget row="5" column="0" rowspan="1" colspan="2" >
316 <class>QCheckBox</class> 305 <class>QCheckBox</class>
317 <property stdset="1"> 306 <property stdset="1">
318 <name>name</name> 307 <name>name</name>
319 <cstring>pagescanCheckBox</cstring> 308 <cstring>pagescanCheckBox</cstring>
320 </property> 309 </property>
321 <property stdset="1"> 310 <property stdset="1">
322 <name>text</name> 311 <name>text</name>
323 <string>Enable Page scan</string> 312 <string>Enable Page scan</string>
324 </property> 313 </property>
325 </widget> 314 </widget>
326 <widget row="6" column="0" rowspan="1" colspan="2" > 315 <widget row="6" column="0" rowspan="1" colspan="2" >
327 <class>QCheckBox</class> 316 <class>QCheckBox</class>
328 <property stdset="1"> 317 <property stdset="1">
329 <name>name</name> 318 <name>name</name>
330 <cstring>inquiryscanCheckBox</cstring> 319 <cstring>inquiryscanCheckBox</cstring>
331 </property> 320 </property>
332 <property stdset="1"> 321 <property stdset="1">
333 <name>text</name> 322 <name>text</name>
334 <string>Enable Inquiry scan</string> 323 <string>Enable Inquiry scan</string>
335 </property> 324 </property>
336 </widget> 325 </widget>
337 <widget row="7" column="0" rowspan="1" colspan="2" > 326 <widget row="7" column="0" rowspan="1" colspan="2" >
338 <class>QPushButton</class> 327 <class>QPushButton</class>
339 <property stdset="1"> 328 <property stdset="1">
340 <name>name</name> 329 <name>name</name>
341 <cstring>configApplyButton</cstring> 330 <cstring>configApplyButton</cstring>
342 </property> 331 </property>
343 <property stdset="1"> 332 <property stdset="1">
344 <name>text</name> 333 <name>text</name>
345 <string>Apply</string> 334 <string>Apply</string>
346 </property> 335 </property>
347 </widget> 336 </widget>
348 </grid> 337 </grid>
349 </widget> 338 </widget>
350 </grid> 339 <widget>
340 <class>QPushButton</class>
341 <property stdset="1">
342 <name>name</name>
343 <cstring>servicesEditButton</cstring>
344 </property>
345 <property stdset="1">
346 <name>text</name>
347 <string>Edit Services Configuration</string>
348 </property>
349 </widget>
350 <widget>
351 <class>QPushButton</class>
352 <property stdset="1">
353 <name>name</name>
354 <cstring>rfcommBindButton</cstring>
355 </property>
356 <property stdset="1">
357 <name>text</name>
358 <string>&amp;Edit RFCOMM Bind Table</string>
359 </property>
360 </widget>
361 </vbox>
351 </widget> 362 </widget>
352 <widget> 363 <widget>
353 <class>QWidget</class> 364 <class>QWidget</class>
354 <property stdset="1"> 365 <property stdset="1">
355 <name>name</name> 366 <name>name</name>
356 <cstring>tab</cstring> 367 <cstring>tab</cstring>
357 </property> 368 </property>
358 <attribute> 369 <attribute>
359 <name>title</name> 370 <name>title</name>
360 <string>Status</string> 371 <string>Status</string>
361 </attribute> 372 </attribute>
362 <vbox> 373 <vbox>
363 <property stdset="1"> 374 <property stdset="1">
364 <name>margin</name> 375 <name>margin</name>
365 <number>0</number> 376 <number>0</number>
366 </property> 377 </property>
367 <property stdset="1"> 378 <property stdset="1">
368 <name>spacing</name> 379 <name>spacing</name>
369 <number>0</number> 380 <number>0</number>
370 </property> 381 </property>
371 <widget> 382 <widget>
372 <class>QLabel</class> 383 <class>QLabel</class>
373 <property stdset="1"> 384 <property stdset="1">
374 <name>name</name> 385 <name>name</name>
375 <cstring>StatusLabel</cstring> 386 <cstring>StatusLabel</cstring>
376 </property> 387 </property>
377 <property stdset="1"> 388 <property stdset="1">
378 <name>text</name> 389 <name>text</name>
379 <string>Status Label</string> 390 <string>Status Label</string>
380 </property> 391 </property>
381 </widget> 392 </widget>
382 </vbox> 393 </vbox>
383 </widget> 394 </widget>
384 <widget> 395 <widget>
385 <class>QWidget</class> 396 <class>QWidget</class>
386 <property stdset="1"> 397 <property stdset="1">
387 <name>name</name> 398 <name>name</name>
388 <cstring>tab</cstring> 399 <cstring>tab</cstring>
389 </property> 400 </property>
390 <attribute> 401 <attribute>
391 <name>title</name> 402 <name>title</name>
392 <string>Phone</string> 403 <string>Phone</string>
393 </attribute> 404 </attribute>
394 <vbox> 405 <vbox>
395 <property stdset="1"> 406 <property stdset="1">
396 <name>margin</name> 407 <name>margin</name>
397 <number>4</number> 408 <number>4</number>
398 </property> 409 </property>
399 <property stdset="1"> 410 <property stdset="1">
400 <name>spacing</name> 411 <name>spacing</name>
401 <number>2</number> 412 <number>2</number>
402 </property> 413 </property>
403 <widget> 414 <widget>
404 <class>QGroupBox</class> 415 <class>QGroupBox</class>
405 <property stdset="1"> 416 <property stdset="1">
406 <name>name</name> 417 <name>name</name>
407 <cstring>cellForwarder</cstring> 418 <cstring>cellForwarder</cstring>
408 </property> 419 </property>
409 <property stdset="1"> 420 <property stdset="1">
410 <name>title</name> 421 <name>title</name>
411 <string>Cell Forwarder</string> 422 <string>Cell Forwarder</string>
412 </property> 423 </property>
413 <property> 424 <property>
414 <name>layoutMargin</name> 425 <name>layoutMargin</name>
415 </property> 426 </property>
416 <property> 427 <property>
417 <name>layoutSpacing</name> 428 <name>layoutSpacing</name>
418 </property> 429 </property>
419 <grid> 430 <grid>
420 <property stdset="1"> 431 <property stdset="1">
421 <name>margin</name> 432 <name>margin</name>
422 <number>4</number> 433 <number>4</number>
423 </property> 434 </property>
424 <property stdset="1"> 435 <property stdset="1">
425 <name>spacing</name> 436 <name>spacing</name>
426 <number>2</number> 437 <number>2</number>
427 </property> 438 </property>
428 <widget row="2" column="0" rowspan="1" colspan="3" > 439 <widget row="2" column="0" rowspan="1" colspan="3" >
429 <class>QPushButton</class> 440 <class>QPushButton</class>
430 <property stdset="1"> 441 <property stdset="1">
431 <name>name</name> 442 <name>name</name>
432 <cstring>runButton</cstring> 443 <cstring>runButton</cstring>
433 </property> 444 </property>
434 <property stdset="1"> 445 <property stdset="1">
435 <name>text</name> 446 <name>text</name>
436 <string>start gateway</string> 447 <string>start gateway</string>
437 </property> 448 </property>
438 </widget> 449 </widget>
439 <widget row="0" column="0" rowspan="1" colspan="2" > 450 <widget row="0" column="0" rowspan="1" colspan="2" >
440 <class>QLabel</class> 451 <class>QLabel</class>
441 <property stdset="1"> 452 <property stdset="1">
442 <name>name</name> 453 <name>name</name>
443 <cstring>serDevLabel</cstring> 454 <cstring>serDevLabel</cstring>
444 </property> 455 </property>
445 <property stdset="1"> 456 <property stdset="1">
446 <name>text</name> 457 <name>text</name>
447 <string>Serial device:</string> 458 <string>Serial device:</string>
448 </property> 459 </property>
449 </widget> 460 </widget>
450 <widget row="0" column="2" > 461 <widget row="0" column="2" >
451 <class>QLineEdit</class> 462 <class>QLineEdit</class>
452 <property stdset="1"> 463 <property stdset="1">
453 <name>name</name> 464 <name>name</name>
454 <cstring>serDevName</cstring> 465 <cstring>serDevName</cstring>
455 </property> 466 </property>
456 </widget> 467 </widget>
457 <widget row="1" column="1" rowspan="1" colspan="2" > 468 <widget row="1" column="1" rowspan="1" colspan="2" >
458 <class>QComboBox</class> 469 <class>QComboBox</class>
459 <property stdset="1"> 470 <property stdset="1">
460 <name>name</name> 471 <name>name</name>
461 <cstring>serSpeed</cstring> 472 <cstring>serSpeed</cstring>
462 </property> 473 </property>
463 </widget> 474 </widget>
464 <widget row="1" column="0" > 475 <widget row="1" column="0" >
465 <class>QLabel</class> 476 <class>QLabel</class>
466 <property stdset="1"> 477 <property stdset="1">
467 <name>name</name> 478 <name>name</name>
468 <cstring>serSpeedLabel</cstring> 479 <cstring>serSpeedLabel</cstring>
469 </property> 480 </property>
470 <property stdset="1"> 481 <property stdset="1">
471 <name>text</name> 482 <name>text</name>
472 <string>Speed:</string> 483 <string>Speed:</string>
473 </property> 484 </property>
474 </widget> 485 </widget>
475 </grid> 486 </grid>
476 </widget> 487 </widget>
477 </vbox> 488 </vbox>
478 </widget> 489 </widget>
479 </widget> 490 </widget>
480 </hbox> 491 </hbox>
481</widget> 492</widget>
482<customwidgets> 493<customwidgets>
483 <customwidget> 494 <customwidget>
484 <class>QWidget</class> 495 <class>QWidget</class>
485 <header location="local">qwidget.h</header> 496 <header location="local">qwidget.h</header>
486 <sizehint> 497 <sizehint>
487 <width>100</width> 498 <width>100</width>
488 <height>100</height> 499 <height>100</height>
489 </sizehint> 500 </sizehint>
490 <container>0</container> 501 <container>0</container>
491 <sizepolicy> 502 <sizepolicy>
492 <hordata>7</hordata> 503 <hordata>7</hordata>
493 <verdata>7</verdata> 504 <verdata>7</verdata>
494 </sizepolicy> 505 </sizepolicy>
495 <pixmap>image0</pixmap> 506 <pixmap>image0</pixmap>
496 </customwidget> 507 </customwidget>
497</customwidgets> 508</customwidgets>
498<images> 509<images>
499 <image> 510 <image>
500 <name>image0</name> 511 <name>image0</name>
501 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> 512 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
502 </image> 513 </image>
503</images> 514</images>
504<tabstops> 515<tabstops>
505 <tabstop>Status</tabstop> 516 <tabstop>Status</tabstop>
506 <tabstop>devicesView</tabstop> 517 <tabstop>devicesView</tabstop>
507 <tabstop>PushButton2</tabstop> 518 <tabstop>PushButton2</tabstop>
508 <tabstop>connectionsView</tabstop> 519 <tabstop>connectionsView</tabstop>
509 <tabstop>deviceNameLine</tabstop> 520 <tabstop>deviceNameLine</tabstop>
510 <tabstop>passkeyLine</tabstop> 521 <tabstop>passkeyLine</tabstop>
511 <tabstop>encCheckBox</tabstop> 522 <tabstop>encCheckBox</tabstop>
512 <tabstop>authCheckBox</tabstop> 523 <tabstop>authCheckBox</tabstop>
513 <tabstop>cryptCheckBox</tabstop> 524 <tabstop>cryptCheckBox</tabstop>
514 <tabstop>pagescanCheckBox</tabstop> 525 <tabstop>pagescanCheckBox</tabstop>
515 <tabstop>inquiryscanCheckBox</tabstop> 526 <tabstop>inquiryscanCheckBox</tabstop>
516 <tabstop>configApplyButton</tabstop> 527 <tabstop>configApplyButton</tabstop>
517 <tabstop>rfcommBindButton</tabstop> 528 <tabstop>rfcommBindButton</tabstop>
518 <tabstop>serDevName</tabstop> 529 <tabstop>serDevName</tabstop>
519 <tabstop>serSpeed</tabstop> 530 <tabstop>serSpeed</tabstop>
520 <tabstop>runButton</tabstop> 531 <tabstop>runButton</tabstop>
521</tabstops> 532</tabstops>
522</UI> 533</UI>
diff --git a/noncore/net/opietooth/manager/btconfhandler.cpp b/noncore/net/opietooth/manager/btconfhandler.cpp
new file mode 100644
index 0000000..0048993
--- a/dev/null
+++ b/noncore/net/opietooth/manager/btconfhandler.cpp
@@ -0,0 +1,391 @@
1/* $Id$ */
2/* Bluetooth services configuration file handler */
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 ***************************************************************************/
11#include "btconfhandler.h"
12#include <string.h>
13#include <stdlib.h>
14#include <getopt.h>
15#include <qstring.h>
16#include <qstringlist.h>
17#include <qfile.h>
18#include <qtextstream.h>
19#include <opie2/odebug.h>
20
21//Keywords
22static QCString k_hcidEnable("HCID_ENABLE=");
23static QCString k_hiddEnable("HIDD_ENABLE=");
24static QCString k_sdpdEnable("SDPD_ENABLE=");
25static QCString k_rfcommEnable("RFCOMM_ENABLE=");
26static QCString k_dundEnable("DUND_ENABLE=");
27static QCString k_pandEnable("PAND_ENABLE=");
28static QCString k_pandOpts("PAND_OPTIONS=");
29static QCString k_dundOpts("DUND_OPTIONS=");
30
31const struct option pandCLOpts[] = //Pand command line options
32{
33 { "listen", 0, NULL, 's' },
34 { "encrypt", 0, NULL, 'E' },
35 { "secure", 0, NULL, 'S' },
36 { "master", 0, NULL, 'M' },
37 { "nosdp", 0, NULL, 'D' },
38 { "role", 1, NULL, 'r' },
39 { "persist", 0, NULL, 'p' },
40 { "cache", 0, NULL, 'C' },
41 { NULL, 0, NULL, 0 } //Marker of the end
42};
43
44const struct option dundCLOpts[] = //Pand command line options
45{
46 { "listen", 0, NULL, 's' },
47 { "nosdp", 0, NULL, 'D' },
48 { "persist", 0, NULL, 'p' },
49 { "cache", 0, NULL, 'C' },
50 { "msdun", 0, NULL, 'X' },
51 { "channel", 1, NULL, 'P' },
52 { "pppd", 1, NULL, 'd' },
53 { NULL, 0, NULL, 0 } //Marker of the end
54};
55
56using namespace OpieTooth;
57BTConfHandler::BTConfHandler(const QString& conf): confName(conf)
58{
59 hcidEnable = false;
60 hiddEnable = false;
61 sdpdEnable = false;
62 rfcommEnable = false;
63
64 //dund parameters
65 dundEnable = false;
66 dundDisableSDP = false;
67 dundPersist = false;
68 dundPersistPeriod = "";
69 dundCache = false;
70 dundCachePeriod = "";
71 dundMsdun = false;
72 dundMsdunTimeout = "";
73 dundChannel = "1";
74 dundPPPd = false;
75 dundPPPdPath = "";
76 dundPPPdOptions = "";
77
78 //pandparameters
79 pandEnable = false;
80 pandEncrypt = false;
81 pandSecure = false;
82 pandMaster = false;
83 pandDisableSDP = false;
84 pandRole = "";
85 pandPersist = false;
86 pandPersistPeriod = "";
87 pandCache = false;
88 pandCachePeriod = "";
89
90 readConfig(confName);
91}
92
93BTConfHandler::~BTConfHandler()
94{
95}
96
97/**
98 * getBoolArg
99 * Gets boolean argument from a string str with a keyword key
100 */
101bool BTConfHandler::getBoolArg(QString& str, QCString& keyword)
102{
103 QString arg = str.mid(keyword.length(), str.length() - keyword.length());
104 return (bool)(arg == "true");
105}
106
107/**
108 * getStringArg
109 * Gets string argument from a string str with a keyword key
110 */
111QString BTConfHandler::getStringArg(QString& str, QCString& keyword)
112{
113 QString arg = str.mid(keyword.length(), str.length() - keyword.length());
114 if (arg.left(1) == "\"")
115 arg.remove(0, 1);
116 if (arg.right(1) == "\"")
117 arg.remove(arg.length() - 1, 1);
118 return arg;
119}
120
121/**
122 * parsePanParameters
123 * Function gets PAND parameters from the command line conf
124 */
125void BTConfHandler::parsePanParameters(const QString& conf)
126{
127 int i; //just an index variable
128 int argc;
129 QStringList panList = QStringList::split(" ", conf);
130 argc = panList.count();
131 char* argv[argc + 1];
132 int shOpt;
133 i = 1;
134 optind = 0;
135 argv[0] = strdup("pand");
136 for (QStringList::Iterator arg = panList.begin();
137 arg != panList.end() && i < argc + 1; arg++, i++) {
138 argv[i] = strdup((*arg));
139 }
140 do {
141 shOpt = getopt_long(argc + 1, argv, "sESMDr:p:C:", pandCLOpts, NULL);
142 switch(shOpt) {
143 case 'E':
144 pandEncrypt = true;
145 break;
146 case 'S':
147 pandSecure = true;
148 break;
149 case 'M':
150 pandMaster = true;
151 break;
152 case 'D':
153 pandDisableSDP = true;
154 break;
155 case 'r':
156 if (optarg)
157 pandRole = optarg;
158 else
159 pandRole = "NG";
160 break;
161 case 'p':
162 pandPersist = true;
163 if (optarg)
164 pandPersistPeriod = optarg;
165 break;
166 case 'C':
167 pandCache = true;
168 if (optarg)
169 pandCachePeriod = optarg;
170 break;
171 case 's':
172 case '?':
173 default:
174 break;
175 }
176 } while (shOpt != -1);
177 for (i = 0; i < argc + 1; i++) {
178 free(argv[i]);
179 }
180}
181
182/**
183 * parseDunParameters
184 * Function gets PAND parameters from the command line conf
185 */
186void BTConfHandler::parseDunParameters(const QString& conf)
187{
188 int i; //just an index variable
189 int argc;
190 QStringList dunList = QStringList::split(" ", conf);
191 argc = dunList.count();
192 char* argv[argc + 1];
193 int shOpt;
194 i = 1;
195 optind = 0;
196 argv[0] = strdup("dund");
197 for (QStringList::Iterator arg = dunList.begin();
198 arg != dunList.end() && i < argc + 1; arg++, i++) {
199 argv[i] = strdup((*arg));
200 }
201 do {
202 shOpt = getopt_long(argc + 1, argv, "sDp:C:X:P:d:", dundCLOpts, NULL);
203 switch(shOpt) {
204 case 'D':
205 dundDisableSDP = true;
206 break;
207 case 'p':
208 dundPersist = true;
209 if (optarg)
210 dundPersistPeriod = optarg;
211 break;
212 case 'C':
213 dundCache = true;
214 if (optarg)
215 dundCachePeriod = optarg;
216 break;
217 case 'X':
218 dundMsdun = true;
219 if (optarg)
220 dundMsdunTimeout = optarg;
221 break;
222 case 'P':
223 if (optarg)
224 dundChannel = optarg;
225 else
226 dundChannel = "1";
227 break;
228 case 'd':
229 dundPPPd = true;
230 if (optarg)
231 dundPPPdPath = optarg;
232 break;
233 case 's':
234 case '?':
235 default:
236 break;
237 }
238 } while (shOpt != -1);
239 if (optind < argc + 1) {
240 for (i = optind; i < argc + 1; i++) {
241 if (!dundPPPdOptions.isEmpty())
242 dundPPPdOptions += " ";
243 dundPPPdOptions += argv[i];
244 }
245 }
246 for (i = 0; i < argc + 1; i++) {
247 free(argv[i]);
248 }
249}
250
251/**
252 * readConfig
253 * Reads configuration file with conf as a file name
254 * return true on success and false on failure
255 */
256bool BTConfHandler::readConfig(const QString& conf)
257{
258 QFile btConf(conf); //File we read
259 QString tmp; //temporary string
260 if (btConf.open(IO_ReadOnly)) {
261 QTextStream inStream(&btConf);
262 list = QStringList::split("\n", inStream.read(), true);
263 for (QStringList::Iterator line = list.begin();
264 line != list.end(); line++) {
265 QString tmpLine = (*line).simplifyWhiteSpace();
266 if (tmpLine.startsWith("#"))
267 continue;
268 else if (tmpLine.startsWith(k_hcidEnable))
269 hcidEnable = getBoolArg(tmpLine, k_hcidEnable);
270 else if (tmpLine.startsWith(k_hiddEnable))
271 hiddEnable = getBoolArg(tmpLine, k_hiddEnable);
272 else if (tmpLine.startsWith(k_sdpdEnable))
273 sdpdEnable = getBoolArg(tmpLine, k_sdpdEnable);
274 else if (tmpLine.startsWith(k_rfcommEnable))
275 rfcommEnable = getBoolArg(tmpLine, k_rfcommEnable);
276 else if (tmpLine.startsWith(k_dundEnable))
277 dundEnable = getBoolArg(tmpLine, k_dundEnable);
278 else if (tmpLine.startsWith(k_pandEnable))
279 pandEnable = getBoolArg(tmpLine, k_pandEnable);
280 else if (tmpLine.startsWith(k_pandOpts)) {
281 tmp = getStringArg(tmpLine, k_pandOpts);
282 parsePanParameters(tmp);
283 }
284 else if (tmpLine.startsWith(k_dundOpts)) {
285 tmp = getStringArg(tmpLine, k_dundOpts);
286 parseDunParameters(tmp);
287 }
288 }
289 return true;
290 }
291 return false;
292}
293
294/**
295 * writeConfig
296 * Writes configuration file with conf as a file name
297 * return true on success and false on failure
298 */
299bool BTConfHandler::saveConfig()
300{
301 QFile btConf(confName); //File we read
302 if (!btConf.open(IO_WriteOnly))
303 return false;
304 QTextStream stream(&btConf);
305 for (QStringList::Iterator line = list.begin();
306 line != list.end(); line++) {
307 QString tmpLine = (*line).simplifyWhiteSpace();
308 if (tmpLine.startsWith(k_hcidEnable))
309 (*line) = k_hcidEnable + ((hcidEnable)? "true": "false");
310 else if (tmpLine.startsWith(k_hiddEnable))
311 (*line) = k_hiddEnable + ((hiddEnable)? "true": "false");
312 else if (tmpLine.startsWith(k_sdpdEnable))
313 (*line) = k_sdpdEnable + ((sdpdEnable)? "true": "false");
314 else if (tmpLine.startsWith(k_rfcommEnable))
315 (*line) = k_rfcommEnable + ((rfcommEnable)? "true": "false");
316 else if (tmpLine.startsWith(k_dundEnable))
317 (*line) = k_dundEnable + ((dundEnable)? "true": "false");
318 else if (tmpLine.startsWith(k_pandEnable))
319 (*line) = k_pandEnable + ((pandEnable)? "true": "false");
320 else if (tmpLine.startsWith(k_pandOpts)) {
321 (*line) = k_pandOpts + "\"--listen";
322 (*line) += " --role " + pandRole;
323 if (pandEncrypt)
324 (*line) += " --encrypt";
325 if (pandSecure)
326 (*line) += " --secure";
327 if (pandMaster)
328 (*line) += " --master";
329 if (pandDisableSDP)
330 (*line) += " --nosdp";
331 if (pandPersist) {
332 if (pandPersistPeriod.isEmpty())
333 (*line) += " --persist";
334 else {
335 (*line) += " -p ";
336 (*line) += pandPersistPeriod;
337 }
338 }
339 if (pandCache) {
340 if (pandCachePeriod.isEmpty())
341 (*line) += " --cache";
342 else {
343 (*line) += " -C ";
344 (*line) += pandCachePeriod;
345 }
346 }
347 (*line) += "\"";
348 }
349 else if (tmpLine.startsWith(k_dundOpts)) {
350 (*line) = k_dundOpts + "\"--listen";
351 (*line) += " --channel " + dundChannel;
352 if (dundDisableSDP)
353 (*line) += " --nosdp";
354 if (dundPersist) {
355 if (dundPersistPeriod.isEmpty())
356 (*line) += " --persist";
357 else {
358 (*line) += " -p ";
359 (*line) += dundPersistPeriod;
360 }
361 }
362 if (dundCache) {
363 if (dundCachePeriod.isEmpty())
364 (*line) += " --cache";
365 else {
366 (*line) += " -C ";
367 (*line) += dundCachePeriod;
368 }
369 }
370 if (dundPPPd)
371 (*line) += " --pppd " + dundPPPdPath;
372 if (dundMsdun) {
373 if (dundMsdunTimeout.isEmpty())
374 (*line) += " --msdun";
375 else {
376 (*line) += " -X ";
377 (*line) += dundMsdunTimeout;
378 }
379 }
380 if (!dundPPPdOptions.isEmpty()) {
381 (*line) += " ";
382 (*line) += dundPPPdOptions;
383 }
384 (*line) += "\"";
385 }
386 stream << (*line) << endl;
387 }
388 return true;
389}
390
391//eof
diff --git a/noncore/net/opietooth/manager/btconfhandler.h b/noncore/net/opietooth/manager/btconfhandler.h
new file mode 100644
index 0000000..5638d00
--- a/dev/null
+++ b/noncore/net/opietooth/manager/btconfhandler.h
@@ -0,0 +1,126 @@
1/* $Id$ */
2/* Bluetooth services configuration file handler */
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 ***************************************************************************/
11
12#ifndef _BTCONFHANDLER_H_
13#define _BTCONFHANDLER_H_
14#include <qstring.h>
15#include <qstringlist.h>
16
17namespace OpieTooth {
18 class BTConfHandler {
19 public:
20 BTConfHandler(const QString& conf);
21 ~BTConfHandler();
22 bool saveConfig();
23
24 bool getHcidEnable() { return hcidEnable; }
25 void setHcidEnable(bool arg) { hcidEnable = arg; }
26
27 bool getHiddEnable() { return hiddEnable; }
28 void setHiddEnable(bool arg) { hiddEnable = arg; }
29
30 bool getSdpdEnable() { return sdpdEnable; }
31 void setSdpdEnable(bool arg) { sdpdEnable = arg; }
32
33 bool getRfcommEnable() { return rfcommEnable; }
34 void setRfcommEnable(bool arg) { rfcommEnable = arg; }
35
36 //DUND parameter
37 bool getDundEnable() { return dundEnable; }
38 void setDundEnable(bool arg) { dundEnable = arg; }
39 bool getDunDisableSDP() { return dundDisableSDP; }
40 void setDunDisableSDP(bool arg) { dundDisableSDP = arg; }
41 bool getDunPersist() { return dundPersist; }
42 void setDunPersist(bool arg) { dundPersist = arg; }
43 QString getDunPersistPeriod() { return dundPersistPeriod; }
44 void setDunPersistPeriod(QString& arg) { dundPersistPeriod = arg; }
45 bool getDunCache() { return dundCache; }
46 void setDunCache(bool arg) { dundCache = arg; }
47 QString getDunCachePeriod() { return dundCachePeriod; }
48 void setDunCachePeriod(QString& arg) { dundCachePeriod = arg; }
49 bool getDunMsdun() { return dundMsdun; }
50 void setDunMsdun(bool arg) { dundMsdun = arg; }
51 QString getDunMsdunTimeout() { return dundMsdunTimeout; }
52 void setDunMsdunTimeout(QString& arg) { dundMsdunTimeout = arg; }
53 QString getDunChannel() { return dundChannel; }
54 void setDunChannel(QString& arg) { dundChannel = arg; }
55 bool getDunPPPd() { return dundPPPd; }
56 void setDunPPPd(bool arg) { dundPPPd = arg; }
57 QString getDunPPPdPath() { return dundPPPdPath; }
58 void setDunPPPdPath(QString& arg) { dundPPPdPath = arg; }
59 QString getDunPPPdOptions() { return dundPPPdOptions; }
60 void setDunPPPdOptions(QString& arg) { dundPPPdOptions = arg; }
61
62 //PAND parameters
63 bool getPanEnable() { return pandEnable; }
64 void setPanEnable(bool arg) { pandEnable = arg; }
65 bool getPanEncrypt() { return pandEncrypt; }
66 void setPanEncrypt(bool arg) { pandEncrypt = arg; }
67 bool getPanSecure() { return pandSecure; }
68 void setPanSecure(bool arg) { pandSecure = arg; }
69 bool getPanMaster() { return pandMaster; }
70 void setPanMaster(bool arg) { pandMaster = arg; }
71 bool getPanDisableSDP() { return pandDisableSDP; }
72 void setPanDisableSDP(bool arg) { pandDisableSDP = arg; }
73 QString getPanRole() { return pandRole; }
74 void setPanRole(QString& arg) { pandRole = arg; }
75 bool getPanPersist() { return pandPersist; }
76 void setPanPersist(bool arg) { pandPersist = arg; }
77 QString getPanPersistPeriod() { return pandPersistPeriod; }
78 void setPanPersistPeriod(QString& arg) { pandPersistPeriod = arg; }
79 bool getPanCache() { return pandCache; }
80 void setPanCache(bool arg) { pandCache = arg; }
81 QString getPanCachePeriod() { return pandCachePeriod; }
82 void setPanCachePeriod(QString& arg) { pandCachePeriod = arg; }
83
84 QString& getConfName() { return confName; }
85 protected:
86 bool getBoolArg(QString& str, QCString& keyword);
87 QString getStringArg(QString& str, QCString& keyword);
88 bool readConfig(const QString& conf);
89 void parsePanParameters(const QString& conf);
90 void parseDunParameters(const QString& conf);
91 protected:
92 bool hcidEnable;
93 bool hiddEnable;
94 bool sdpdEnable;
95 bool rfcommEnable;
96 //DUND parameters
97 bool dundEnable;
98 bool dundDisableSDP;
99 bool dundPersist;
100 QString dundPersistPeriod;
101 bool dundCache;
102 QString dundCachePeriod;
103 bool dundMsdun;
104 QString dundMsdunTimeout;
105 QString dundChannel;
106 bool dundPPPd;
107 QString dundPPPdPath;
108 QString dundPPPdOptions;
109
110 //PAND parameters
111 bool pandEnable;
112 bool pandEncrypt;
113 bool pandSecure;
114 bool pandMaster;
115 bool pandDisableSDP;
116 bool pandPersist;
117 QString pandPersistPeriod;
118 bool pandCache;
119 QString pandCachePeriod;
120 QString pandRole;
121 QStringList list; //list of strings we read from configuration file
122 QString confName; //Configuration filename
123 };
124};
125#endif
126//eof
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro
index dc43f40..09bd10e 100644
--- a/noncore/net/opietooth/manager/manager.pro
+++ b/noncore/net/opietooth/manager/manager.pro
@@ -1,42 +1,45 @@
1CONFIG = qt warn_on quick-app 1CONFIG = qt warn_on quick-app
2HEADERS = btconnectionitem.h btdeviceitem.h \ 2HEADERS = btconnectionitem.h btdeviceitem.h \
3 btserviceitem.h stdpopups.h \ 3 btserviceitem.h stdpopups.h \
4 popuphelper.h bluebase.h \ 4 popuphelper.h bluebase.h \
5 scandialog.h btlistitem.h filistitem.h \ 5 scandialog.h btlistitem.h filistitem.h \
6 hciconfwrapper.h bticonloader.h \ 6 hciconfwrapper.h bticonloader.h \
7 pppdialog.h dundialog.h pandialog.h \ 7 pppdialog.h dundialog.h pandialog.h \
8 obexdialog.h obexftpdialog.h \ 8 obexdialog.h obexftpdialog.h \
9 rfcommassigndialogimpl.h rfcommassigndialogitem.h \ 9 rfcommassigndialogimpl.h rfcommassigndialogitem.h \
10 devicehandler.h rfcpopup.h obexpopup.h obexftpopup.h \ 10 devicehandler.h rfcpopup.h obexpopup.h obexftpopup.h \
11 rfcommhelper.h panpopup.h dunpopup.h rfcommconfhandler.h 11 rfcommhelper.h panpopup.h dunpopup.h rfcommconfhandler.h \
12 servicesdialog.h btconfhandler.h
12 13
13SOURCES = btconnectionitem.cpp btdeviceitem.cpp \ 14SOURCES = btconnectionitem.cpp btdeviceitem.cpp \
14 btserviceitem.cpp filelistitem.cpp stdpopups.cpp \ 15 btserviceitem.cpp filelistitem.cpp stdpopups.cpp \
15 popuphelper.cpp main.cpp \ 16 popuphelper.cpp main.cpp \
16 bluebase.cpp scandialog.cpp \ 17 bluebase.cpp scandialog.cpp \
17 btlistitem.cpp hciconfwrapper.cpp \ 18 btlistitem.cpp hciconfwrapper.cpp \
18 bticonloader.cpp pppdialog.cpp dundialog.cpp pandialog.cpp \ 19 bticonloader.cpp pppdialog.cpp dundialog.cpp pandialog.cpp \
19 rfcommassigndialogimpl.cpp rfcommassigndialogitem.cpp \ 20 rfcommassigndialogimpl.cpp rfcommassigndialogitem.cpp \
20 obexdialog.cpp devicehandler.cpp \ 21 obexdialog.cpp devicehandler.cpp \
21 rfcpopup.cpp obexpopup.cpp obexftpopup.cpp obexftpdialog.cpp \ 22 rfcpopup.cpp obexpopup.cpp obexftpopup.cpp obexftpdialog.cpp \
22 rfcommhelper.cpp panpopup.cpp dunpopup.cpp rfcommconfhandler.cpp 23 rfcommhelper.cpp panpopup.cpp dunpopup.cpp rfcommconfhandler.cpp \
24 servicesdialog.cpp btconfhandler.cpp
23INCLUDEPATH += $(OPIEDIR)/include 25INCLUDEPATH += $(OPIEDIR)/include
24INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib 26INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib
25DEPENDPATH += $(OPIEDIR)/include 27DEPENDPATH += $(OPIEDIR)/include
26LIBS += -lqpe -lbluetooth -lopietooth1 -lopiecore2 -lopieui2 -lopenobex 28LIBS += -lqpe -lbluetooth -lopietooth1 -lopiecore2 -lopieui2 -lopenobex
27INTERFACES = bluetoothbase.ui devicedialog.ui rfcommassigndialogbase.ui \ 29INTERFACES = bluetoothbase.ui devicedialog.ui rfcommassigndialogbase.ui \
28 rfcommdialogitembase.ui obexftpdialogbase.ui 30 rfcommdialogitembase.ui obexftpdialogbase.ui \
31 servicesdialogbase.ui
29 32
30 TARGET = bluetooth-manager 33 TARGET = bluetooth-manager
31 34
32include( $(OPIEDIR)/include.pro ) 35include( $(OPIEDIR)/include.pro )
33 36
34!isEmpty( LIBOBEXFTP_INC_DIR ) { 37!isEmpty( LIBOBEXFTP_INC_DIR ) {
35 INCLUDEPATH += $$LIBOBEXFTP_INC_DIR 38 INCLUDEPATH += $$LIBOBEXFTP_INC_DIR
36} 39}
37 40
38!isEmpty( LIBOBEXFTP_LIB_DIR ) { 41!isEmpty( LIBOBEXFTP_LIB_DIR ) {
39 LIBS += $$LIBOBEXFTP_LIB_DIR/libobexftp.a 42 LIBS += $$LIBOBEXFTP_LIB_DIR/libobexftp.a
40 LIBS += $$LIBOBEXFTP_LIB_DIR/libmulticobex.a 43 LIBS += $$LIBOBEXFTP_LIB_DIR/libmulticobex.a
41 LIBS += $$LIBOBEXFTP_LIB_DIR/libbfb.a 44 LIBS += $$LIBOBEXFTP_LIB_DIR/libbfb.a
42} 45}
diff --git a/noncore/net/opietooth/manager/servicesdialog.cpp b/noncore/net/opietooth/manager/servicesdialog.cpp
new file mode 100644
index 0000000..114c360
--- a/dev/null
+++ b/noncore/net/opietooth/manager/servicesdialog.cpp
@@ -0,0 +1,120 @@
1/* $Id$ */
2/* Bluetooth services configuration 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 ***************************************************************************/
11#include "servicesdialog.h"
12#include "btconfhandler.h"
13#include <opie2/odebug.h>
14#include <qstring.h>
15#include <qcheckbox.h>
16#include <qlineedit.h>
17#include <qcombobox.h>
18using namespace Opie::Core;
19
20using namespace OpieTooth;
21
22ServicesDialog::ServicesDialog(const QString& conf,
23 QWidget* parent, const char* name, bool modal, WFlags fl) :
24 ServicesDialogBase(parent, name, modal, fl),
25 cfg(conf)
26{
27 int i; //just an index
28 QString role;
29 hcidEnableCBox->setChecked(cfg.getHcidEnable());
30 hiddEnableCBox->setChecked(cfg.getHiddEnable());
31 sdpdEnableCBox->setChecked(cfg.getSdpdEnable());
32 rfcommEnableCBox->setChecked(cfg.getRfcommEnable());
33 dundEnableCBox->setChecked(cfg.getDundEnable());
34 dundDisableSDPCBox->setChecked(cfg.getDunDisableSDP());
35 dundPersistCBox->setChecked(cfg.getDunPersist());
36 dundPersistEdit->setText(cfg.getDunPersistPeriod());
37 dundCacheCBox->setChecked(cfg.getDunCache());
38 dundCacheEdit->setText(cfg.getDunCachePeriod());
39 for (i = 1; i < 32; i++)
40 dundChannelCBox->insertItem(QString::number(i));
41 role = cfg.getDunChannel();
42 for (i = 0; i < dundChannelCBox->count(); i++) {
43 if (role == dundChannelCBox->text(i)) {
44 dundChannelCBox->setCurrentItem(i);
45 break;
46 }
47 }
48 dundMsdunCBox->setChecked(cfg.getDunMsdun());
49 dundMsdunTimeoutEdit->setText(cfg.getDunMsdunTimeout());
50 dundPPPdCBox->setChecked(cfg.getDunPPPd());
51 dundPPPdPathEdit->setText(cfg.getDunPPPdPath());
52 dundPPPdOptionsEdit->setText(cfg.getDunPPPdOptions());
53
54 pandEnableCBox->setChecked(cfg.getPanEnable());
55 pandEncryptCBox->setChecked(cfg.getPanEncrypt());
56 pandSecureCBox->setChecked(cfg.getPanSecure());
57 pandMasterCBox->setChecked(cfg.getPanMaster());
58 role = cfg.getPanRole();
59 for (i = 0; i < pandRoleComboBox->count(); i++) {
60 if (role == pandRoleComboBox->text(i)) {
61 pandRoleComboBox->setCurrentItem(i);
62 break;
63 }
64 }
65 pandDisableSDPCBox->setChecked(cfg.getPanDisableSDP());
66 pandPersistCBox->setChecked(cfg.getPanPersist());
67 pandPersistEdit->setText(cfg.getPanPersistPeriod());
68 pandCacheCBox->setChecked(cfg.getPanCache());
69 pandCacheEdit->setText(cfg.getPanCachePeriod());
70}
71
72ServicesDialog::~ServicesDialog()
73{
74}
75
76void ServicesDialog::accept()
77{
78 QString tmp;
79 odebug << "save configuration" << oendl;
80 cfg.setHcidEnable(hcidEnableCBox->isChecked());
81 cfg.setHiddEnable(hiddEnableCBox->isChecked());
82 cfg.setSdpdEnable(sdpdEnableCBox->isChecked());
83 cfg.setRfcommEnable(rfcommEnableCBox->isChecked());
84 cfg.setDundEnable(dundEnableCBox->isChecked());
85 cfg.setDunDisableSDP(dundDisableSDPCBox->isChecked());
86 cfg.setDunPersist(dundPersistCBox->isChecked());
87 tmp = dundPersistEdit->text();
88 cfg.setDunPersistPeriod(tmp);
89 cfg.setDunCache(dundCacheCBox->isChecked());
90 tmp = dundCacheEdit->text();
91 cfg.setDunCachePeriod(tmp);
92 tmp = dundChannelCBox->currentText();
93 cfg.setDunChannel(tmp);
94 cfg.setDunMsdun(dundMsdunCBox->isChecked());
95 tmp = dundMsdunTimeoutEdit->text();
96 cfg.setDunMsdunTimeout(tmp);
97 cfg.setDunPPPd(dundPPPdCBox->isChecked());
98 tmp = dundPPPdPathEdit->text();
99 cfg.setDunPPPdPath(tmp);
100 tmp = dundPPPdOptionsEdit->text();
101 cfg.setDunPPPdOptions(tmp);
102
103 cfg.setPanEnable(pandEnableCBox->isChecked());
104 cfg.setPanEncrypt(pandEncryptCBox->isChecked());
105 cfg.setPanSecure(pandSecureCBox->isChecked());
106 cfg.setPanMaster(pandMasterCBox->isChecked());
107 cfg.setPanDisableSDP(pandDisableSDPCBox->isChecked());
108 tmp = pandRoleComboBox->currentText();
109 cfg.setPanRole(tmp);
110 cfg.setPanPersist(pandPersistCBox->isChecked());
111 tmp = pandPersistEdit->text();
112 cfg.setPanPersistPeriod(tmp);
113 cfg.setPanCache(pandCacheCBox->isChecked());
114 tmp = pandCacheEdit->text();
115 cfg.setPanCachePeriod(tmp);
116 cfg.saveConfig();
117 ServicesDialogBase::accept();
118}
119
120//eof
diff --git a/noncore/net/opietooth/manager/servicesdialog.h b/noncore/net/opietooth/manager/servicesdialog.h
new file mode 100644
index 0000000..b42f290
--- a/dev/null
+++ b/noncore/net/opietooth/manager/servicesdialog.h
@@ -0,0 +1,30 @@
1/* $Id$ */
2/* Bluetooth services configuration 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 ***************************************************************************/
11#ifndef _SERVICESDIALOG_H_
12#define _SERVICESDIALOG_H_
13#include "servicesdialogbase.h"
14#include "btconfhandler.h"
15namespace OpieTooth {
16 class ServicesDialog : public ServicesDialogBase {
17 Q_OBJECT
18 public:
19 ServicesDialog(const QString& conf,
20 QWidget* parent = 0, const char* name = 0, bool modal = TRUE,
21 WFlags fl = 0);
22 ~ServicesDialog();
23 public:
24 BTConfHandler cfg; //configuration file
25 protected slots:
26 virtual void accept();
27 };
28};
29#endif
30//eof
diff --git a/noncore/net/opietooth/manager/servicesdialogbase.ui b/noncore/net/opietooth/manager/servicesdialogbase.ui
new file mode 100644
index 0000000..410e513
--- a/dev/null
+++ b/noncore/net/opietooth/manager/servicesdialogbase.ui
@@ -0,0 +1,658 @@
1<!DOCTYPE UI><UI>
2<class>ServicesDialogBase</class>
3<widget>
4 <class>QDialog</class>
5 <property stdset="1">
6 <name>name</name>
7 <cstring>ServicesDialogBase</cstring>
8 </property>
9 <property stdset="1">
10 <name>geometry</name>
11 <rect>
12 <x>0</x>
13 <y>0</y>
14 <width>258</width>
15 <height>368</height>
16 </rect>
17 </property>
18 <property stdset="1">
19 <name>sizePolicy</name>
20 <sizepolicy>
21 <hsizetype>7</hsizetype>
22 <vsizetype>7</vsizetype>
23 </sizepolicy>
24 </property>
25 <property stdset="1">
26 <name>baseSize</name>
27 <size>
28 <width>240</width>
29 <height>320</height>
30 </size>
31 </property>
32 <property stdset="1">
33 <name>caption</name>
34 <string>Configure Services</string>
35 </property>
36 <property>
37 <name>layoutMargin</name>
38 </property>
39 <property>
40 <name>layoutSpacing</name>
41 </property>
42 <vbox>
43 <property stdset="1">
44 <name>margin</name>
45 <number>0</number>
46 </property>
47 <property stdset="1">
48 <name>spacing</name>
49 <number>0</number>
50 </property>
51 <widget>
52 <class>QTabWidget</class>
53 <property stdset="1">
54 <name>name</name>
55 <cstring>servicesTab</cstring>
56 </property>
57 <property stdset="1">
58 <name>tabShape</name>
59 <enum>Rounded</enum>
60 </property>
61 <property>
62 <name>layoutMargin</name>
63 </property>
64 <property>
65 <name>layoutSpacing</name>
66 </property>
67 <widget>
68 <class>QWidget</class>
69 <property stdset="1">
70 <name>name</name>
71 <cstring>tab</cstring>
72 </property>
73 <attribute>
74 <name>title</name>
75 <string>HCID</string>
76 </attribute>
77 <vbox>
78 <property stdset="1">
79 <name>margin</name>
80 <number>0</number>
81 </property>
82 <property stdset="1">
83 <name>spacing</name>
84 <number>0</number>
85 </property>
86 <widget>
87 <class>QGroupBox</class>
88 <property stdset="1">
89 <name>name</name>
90 <cstring>GroupBox3</cstring>
91 </property>
92 <property stdset="1">
93 <name>title</name>
94 <string>Host Controller Interface</string>
95 </property>
96 <property>
97 <name>layoutMargin</name>
98 </property>
99 <property>
100 <name>layoutSpacing</name>
101 </property>
102 <grid>
103 <property stdset="1">
104 <name>margin</name>
105 <number>11</number>
106 </property>
107 <property stdset="1">
108 <name>spacing</name>
109 <number>6</number>
110 </property>
111 <widget row="0" column="0" >
112 <class>QCheckBox</class>
113 <property stdset="1">
114 <name>name</name>
115 <cstring>hcidEnableCBox</cstring>
116 </property>
117 <property stdset="1">
118 <name>text</name>
119 <string>Enable</string>
120 </property>
121 </widget>
122 </grid>
123 </widget>
124 </vbox>
125 </widget>
126 <widget>
127 <class>QWidget</class>
128 <property stdset="1">
129 <name>name</name>
130 <cstring>tab</cstring>
131 </property>
132 <attribute>
133 <name>title</name>
134 <string>SDPD</string>
135 </attribute>
136 <vbox>
137 <property stdset="1">
138 <name>margin</name>
139 <number>0</number>
140 </property>
141 <property stdset="1">
142 <name>spacing</name>
143 <number>0</number>
144 </property>
145 <widget>
146 <class>QGroupBox</class>
147 <property stdset="1">
148 <name>name</name>
149 <cstring>GroupBox4</cstring>
150 </property>
151 <property stdset="1">
152 <name>title</name>
153 <string>Service Discovery Protocol </string>
154 </property>
155 <grid>
156 <property stdset="1">
157 <name>margin</name>
158 <number>11</number>
159 </property>
160 <property stdset="1">
161 <name>spacing</name>
162 <number>6</number>
163 </property>
164 <widget row="0" column="0" >
165 <class>QCheckBox</class>
166 <property stdset="1">
167 <name>name</name>
168 <cstring>sdpdEnableCBox</cstring>
169 </property>
170 <property stdset="1">
171 <name>text</name>
172 <string>Enable</string>
173 </property>
174 </widget>
175 </grid>
176 </widget>
177 </vbox>
178 </widget>
179 <widget>
180 <class>QWidget</class>
181 <property stdset="1">
182 <name>name</name>
183 <cstring>tab</cstring>
184 </property>
185 <attribute>
186 <name>title</name>
187 <string>HIDD</string>
188 </attribute>
189 <grid>
190 <property stdset="1">
191 <name>margin</name>
192 <number>0</number>
193 </property>
194 <property stdset="1">
195 <name>spacing</name>
196 <number>0</number>
197 </property>
198 <widget row="0" column="0" >
199 <class>QGroupBox</class>
200 <property stdset="1">
201 <name>name</name>
202 <cstring>GroupBox6</cstring>
203 </property>
204 <property stdset="1">
205 <name>title</name>
206 <string>Human Interface Devices</string>
207 </property>
208 <grid>
209 <property stdset="1">
210 <name>margin</name>
211 <number>11</number>
212 </property>
213 <property stdset="1">
214 <name>spacing</name>
215 <number>6</number>
216 </property>
217 <widget row="0" column="0" >
218 <class>QCheckBox</class>
219 <property stdset="1">
220 <name>name</name>
221 <cstring>hiddEnableCBox</cstring>
222 </property>
223 <property stdset="1">
224 <name>text</name>
225 <string>Enable</string>
226 </property>
227 </widget>
228 </grid>
229 </widget>
230 </grid>
231 </widget>
232 <widget>
233 <class>QWidget</class>
234 <property stdset="1">
235 <name>name</name>
236 <cstring>tab</cstring>
237 </property>
238 <attribute>
239 <name>title</name>
240 <string>RFCOMM</string>
241 </attribute>
242 <vbox>
243 <property stdset="1">
244 <name>margin</name>
245 <number>0</number>
246 </property>
247 <property stdset="1">
248 <name>spacing</name>
249 <number>0</number>
250 </property>
251 <widget>
252 <class>QGroupBox</class>
253 <property stdset="1">
254 <name>name</name>
255 <cstring>GroupBox5</cstring>
256 </property>
257 <property stdset="1">
258 <name>title</name>
259 <string>RFCOMM</string>
260 </property>
261 <property>
262 <name>layoutMargin</name>
263 </property>
264 <property>
265 <name>layoutSpacing</name>
266 </property>
267 <grid>
268 <property stdset="1">
269 <name>margin</name>
270 <number>11</number>
271 </property>
272 <property stdset="1">
273 <name>spacing</name>
274 <number>6</number>
275 </property>
276 <widget row="0" column="0" >
277 <class>QCheckBox</class>
278 <property stdset="1">
279 <name>name</name>
280 <cstring>rfcommEnableCBox</cstring>
281 </property>
282 <property stdset="1">
283 <name>text</name>
284 <string>Enable</string>
285 </property>
286 </widget>
287 </grid>
288 </widget>
289 </vbox>
290 </widget>
291 <widget>
292 <class>QWidget</class>
293 <property stdset="1">
294 <name>name</name>
295 <cstring>tab</cstring>
296 </property>
297 <attribute>
298 <name>title</name>
299 <string>DUND</string>
300 </attribute>
301 <vbox>
302 <property stdset="1">
303 <name>margin</name>
304 <number>0</number>
305 </property>
306 <property stdset="1">
307 <name>spacing</name>
308 <number>0</number>
309 </property>
310 <widget>
311 <class>QGroupBox</class>
312 <property stdset="1">
313 <name>name</name>
314 <cstring>GroupBox7</cstring>
315 </property>
316 <property stdset="1">
317 <name>title</name>
318 <string>DialUp Network</string>
319 </property>
320 <property>
321 <name>layoutMargin</name>
322 </property>
323 <property>
324 <name>layoutSpacing</name>
325 </property>
326 <grid>
327 <property stdset="1">
328 <name>margin</name>
329 <number>4</number>
330 </property>
331 <property stdset="1">
332 <name>spacing</name>
333 <number>2</number>
334 </property>
335 <widget row="0" column="0" rowspan="1" colspan="3" >
336 <class>QCheckBox</class>
337 <property stdset="1">
338 <name>name</name>
339 <cstring>dundEnableCBox</cstring>
340 </property>
341 <property stdset="1">
342 <name>text</name>
343 <string>Enable</string>
344 </property>
345 </widget>
346 <widget row="1" column="3" >
347 <class>QCheckBox</class>
348 <property stdset="1">
349 <name>name</name>
350 <cstring>dundCacheCBox</cstring>
351 </property>
352 <property stdset="1">
353 <name>text</name>
354 <string>Cache</string>
355 </property>
356 </widget>
357 <widget row="1" column="0" rowspan="1" colspan="2" >
358 <class>QCheckBox</class>
359 <property stdset="1">
360 <name>name</name>
361 <cstring>dundPersistCBox</cstring>
362 </property>
363 <property stdset="1">
364 <name>text</name>
365 <string>Persist</string>
366 </property>
367 </widget>
368 <widget row="1" column="2" >
369 <class>QLineEdit</class>
370 <property stdset="1">
371 <name>name</name>
372 <cstring>dundPersistEdit</cstring>
373 </property>
374 </widget>
375 <widget row="1" column="4" >
376 <class>QLineEdit</class>
377 <property stdset="1">
378 <name>name</name>
379 <cstring>dundCacheEdit</cstring>
380 </property>
381 </widget>
382 <widget row="0" column="3" rowspan="1" colspan="2" >
383 <class>QCheckBox</class>
384 <property stdset="1">
385 <name>name</name>
386 <cstring>dundDisableSDPCBox</cstring>
387 </property>
388 <property stdset="1">
389 <name>text</name>
390 <string>Disable SDP</string>
391 </property>
392 </widget>
393 <widget row="2" column="0" rowspan="1" colspan="5" >
394 <class>QLabel</class>
395 <property stdset="1">
396 <name>name</name>
397 <cstring>dundPPPdLabel</cstring>
398 </property>
399 <property stdset="1">
400 <name>text</name>
401 <string>PPPD Options:</string>
402 </property>
403 </widget>
404 <widget row="3" column="0" rowspan="1" colspan="5" >
405 <class>QLineEdit</class>
406 <property stdset="1">
407 <name>name</name>
408 <cstring>dundPPPdOptionsEdit</cstring>
409 </property>
410 </widget>
411 <widget row="4" column="0" rowspan="1" colspan="5" >
412 <class>QCheckBox</class>
413 <property stdset="1">
414 <name>name</name>
415 <cstring>dundPPPdCBox</cstring>
416 </property>
417 <property stdset="1">
418 <name>text</name>
419 <string>Specify pppd path</string>
420 </property>
421 </widget>
422 <widget row="7" column="1" rowspan="1" colspan="4" >
423 <class>QLineEdit</class>
424 <property stdset="1">
425 <name>name</name>
426 <cstring>dundMsdunTimeoutEdit</cstring>
427 </property>
428 </widget>
429 <widget row="7" column="0" >
430 <class>QLabel</class>
431 <property stdset="1">
432 <name>name</name>
433 <cstring>dundMsdunLabel</cstring>
434 </property>
435 <property stdset="1">
436 <name>text</name>
437 <string>Timeout: </string>
438 </property>
439 </widget>
440 <widget row="6" column="0" rowspan="1" colspan="5" >
441 <class>QCheckBox</class>
442 <property stdset="1">
443 <name>name</name>
444 <cstring>dundMsdunCBox</cstring>
445 </property>
446 <property stdset="1">
447 <name>text</name>
448 <string>Enable Microsoft dialup networking</string>
449 </property>
450 </widget>
451 <widget row="5" column="0" rowspan="1" colspan="5" >
452 <class>QLineEdit</class>
453 <property stdset="1">
454 <name>name</name>
455 <cstring>dundPPPdPathEdit</cstring>
456 </property>
457 </widget>
458 <widget row="8" column="0" rowspan="1" colspan="2" >
459 <class>QLabel</class>
460 <property stdset="1">
461 <name>name</name>
462 <cstring>dundChannelLabel</cstring>
463 </property>
464 <property stdset="1">
465 <name>text</name>
466 <string>Channel:</string>
467 </property>
468 </widget>
469 <widget row="8" column="2" rowspan="1" colspan="3" >
470 <class>QComboBox</class>
471 <property stdset="1">
472 <name>name</name>
473 <cstring>dundChannelCBox</cstring>
474 </property>
475 </widget>
476 </grid>
477 </widget>
478 </vbox>
479 </widget>
480 <widget>
481 <class>QWidget</class>
482 <property stdset="1">
483 <name>name</name>
484 <cstring>tab</cstring>
485 </property>
486 <attribute>
487 <name>title</name>
488 <string>PAND</string>
489 </attribute>
490 <vbox>
491 <property stdset="1">
492 <name>margin</name>
493 <number>0</number>
494 </property>
495 <property stdset="1">
496 <name>spacing</name>
497 <number>0</number>
498 </property>
499 <widget>
500 <class>QGroupBox</class>
501 <property stdset="1">
502 <name>name</name>
503 <cstring>GroupBox6_2</cstring>
504 </property>
505 <property stdset="1">
506 <name>title</name>
507 <string>Personal Area Network</string>
508 </property>
509 <property>
510 <name>layoutMargin</name>
511 </property>
512 <property>
513 <name>layoutSpacing</name>
514 </property>
515 <grid>
516 <property stdset="1">
517 <name>margin</name>
518 <number>4</number>
519 </property>
520 <property stdset="1">
521 <name>spacing</name>
522 <number>2</number>
523 </property>
524 <widget row="0" column="0" rowspan="1" colspan="3" >
525 <class>QCheckBox</class>
526 <property stdset="1">
527 <name>name</name>
528 <cstring>pandEnableCBox</cstring>
529 </property>
530 <property stdset="1">
531 <name>text</name>
532 <string>Enable</string>
533 </property>
534 </widget>
535 <widget row="1" column="2" >
536 <class>QCheckBox</class>
537 <property stdset="1">
538 <name>name</name>
539 <cstring>pandSecureCBox</cstring>
540 </property>
541 <property stdset="1">
542 <name>text</name>
543 <string>Secure</string>
544 </property>
545 </widget>
546 <widget row="2" column="2" >
547 <class>QCheckBox</class>
548 <property stdset="1">
549 <name>name</name>
550 <cstring>pandDisableSDPCBox</cstring>
551 </property>
552 <property stdset="1">
553 <name>text</name>
554 <string>Disable SDP</string>
555 </property>
556 </widget>
557 <widget row="3" column="0" >
558 <class>QCheckBox</class>
559 <property stdset="1">
560 <name>name</name>
561 <cstring>pandPersistCBox</cstring>
562 </property>
563 <property stdset="1">
564 <name>text</name>
565 <string>Persist</string>
566 </property>
567 </widget>
568 <widget row="3" column="1" rowspan="1" colspan="2" >
569 <class>QLineEdit</class>
570 <property stdset="1">
571 <name>name</name>
572 <cstring>pandPersistEdit</cstring>
573 </property>
574 </widget>
575 <widget row="4" column="0" >
576 <class>QCheckBox</class>
577 <property stdset="1">
578 <name>name</name>
579 <cstring>pandCacheCBox</cstring>
580 </property>
581 <property stdset="1">
582 <name>text</name>
583 <string>Cache</string>
584 </property>
585 </widget>
586 <widget row="4" column="1" rowspan="1" colspan="2" >
587 <class>QLineEdit</class>
588 <property stdset="1">
589 <name>name</name>
590 <cstring>pandCacheEdit</cstring>
591 </property>
592 </widget>
593 <widget row="2" column="0" rowspan="1" colspan="2" >
594 <class>QCheckBox</class>
595 <property stdset="1">
596 <name>name</name>
597 <cstring>pandMasterCBox</cstring>
598 </property>
599 <property stdset="1">
600 <name>text</name>
601 <string>Master</string>
602 </property>
603 </widget>
604 <widget row="1" column="0" >
605 <class>QCheckBox</class>
606 <property stdset="1">
607 <name>name</name>
608 <cstring>pandEncryptCBox</cstring>
609 </property>
610 <property stdset="1">
611 <name>text</name>
612 <string>Encrypt</string>
613 </property>
614 </widget>
615 <widget row="5" column="0" >
616 <class>QLabel</class>
617 <property stdset="1">
618 <name>name</name>
619 <cstring>pandRoleLabel</cstring>
620 </property>
621 <property stdset="1">
622 <name>text</name>
623 <string>Role: </string>
624 </property>
625 </widget>
626 <widget row="5" column="1" rowspan="1" colspan="2" >
627 <class>QComboBox</class>
628 <item>
629 <property>
630 <name>text</name>
631 <string>PANU</string>
632 </property>
633 </item>
634 <item>
635 <property>
636 <name>text</name>
637 <string>NAP</string>
638 </property>
639 </item>
640 <item>
641 <property>
642 <name>text</name>
643 <string>GN</string>
644 </property>
645 </item>
646 <property stdset="1">
647 <name>name</name>
648 <cstring>pandRoleComboBox</cstring>
649 </property>
650 </widget>
651 </grid>
652 </widget>
653 </vbox>
654 </widget>
655 </widget>
656 </vbox>
657</widget>
658</UI>