summaryrefslogtreecommitdiff
authorkorovkin <korovkin>2006-04-15 16:03:19 (UTC)
committer korovkin <korovkin>2006-04-15 16:03:19 (UTC)
commit6d3a8eaf3b92f8eec9908eed91568342fac5de1d (patch) (unidiff)
treedeb2f977342b99f72ddcbbaec4066c81278cd65f
parenta1bcbe41d45924713c4ead9b25ac5518473c9ca9 (diff)
downloadopie-6d3a8eaf3b92f8eec9908eed91568342fac5de1d.zip
opie-6d3a8eaf3b92f8eec9908eed91568342fac5de1d.tar.gz
opie-6d3a8eaf3b92f8eec9908eed91568342fac5de1d.tar.bz2
Added default passkey writing to /etc/bluetooth/pin file.
Added encrypt default passkey in edit line button.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp20
-rw-r--r--noncore/net/opietooth/manager/bluebase.h1
-rw-r--r--noncore/net/opietooth/manager/bluetoothbase.ui264
3 files changed, 145 insertions, 140 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 9ec5bf8..924d191 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -1,743 +1,763 @@
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 <termios.h> 25#include <termios.h>
26#include <string.h> 26#include <string.h>
27#include <errno.h> 27#include <errno.h>
28 28
29/* OPIE */ 29/* OPIE */
30#include <qpe/qpeapplication.h> 30#include <qpe/qpeapplication.h>
31#include <qpe/resource.h> 31#include <qpe/resource.h>
32#include <qpe/config.h> 32#include <qpe/config.h>
33#include <opie2/odebug.h> 33#include <opie2/odebug.h>
34using namespace Opie::Core; 34using namespace Opie::Core;
35 35
36/* QT */ 36/* QT */
37#include <qframe.h> 37#include <qframe.h>
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qpushbutton.h> 39#include <qpushbutton.h>
40#include <qlayout.h> 40#include <qlayout.h>
41#include <qvariant.h> 41#include <qvariant.h>
42#include <qimage.h> 42#include <qimage.h>
43#include <qpixmap.h> 43#include <qpixmap.h>
44#include <qtabwidget.h> 44#include <qtabwidget.h>
45#include <qscrollview.h> 45#include <qscrollview.h>
46#include <qvbox.h> 46#include <qvbox.h>
47#include <qmessagebox.h> 47#include <qmessagebox.h>
48#include <qcombobox.h> 48#include <qcombobox.h>
49#include <qcheckbox.h> 49#include <qcheckbox.h>
50#include <qlineedit.h> 50#include <qlineedit.h>
51#include <qlistview.h> 51#include <qlistview.h>
52#include <qdir.h> 52#include <qdir.h>
53#include <qpopupmenu.h> 53#include <qpopupmenu.h>
54#include <qtimer.h> 54#include <qtimer.h>
55#include <qlist.h> 55#include <qlist.h>
56#include <qfile.h>
56 57
57/* STD */ 58/* STD */
58#include <remotedevice.h> 59#include <remotedevice.h>
59#include <services.h> 60#include <services.h>
60#include <stdlib.h> 61#include <stdlib.h>
61 62
62using namespace OpieTooth; 63using namespace OpieTooth;
63//Array of possible speeds of the serial port 64//Array of possible speeds of the serial port
64struct SerSpeed { 65struct SerSpeed {
65 const char* str; //string value 66 const char* str; //string value
66 int val; //value itself 67 int val; //value itself
67} speeds[] = { 68} speeds[] = {
68 { "150", B150 }, { "300", B300 }, { "600", B600 }, { "1200", B1200 }, 69 { "150", B150 }, { "300", B300 }, { "600", B600 }, { "1200", B1200 },
69 { "2400", B2400 }, { "4800", B4800 }, { "9600", B9600 }, 70 { "2400", B2400 }, { "4800", B4800 }, { "9600", B9600 },
70 { "19200", B19200 }, { "38400", B38400 }, { "57600", B57600 }, 71 { "19200", B19200 }, { "38400", B38400 }, { "57600", B57600 },
71 { "115200", B115200} 72 { "115200", B115200}
72}; 73};
73 74
74BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 75BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
75 : BluetoothBase( parent, name, fl ) 76 : BluetoothBase( parent, name, fl )
76{ 77{
77 m_localDevice = new Manager( "hci0" ); 78 m_localDevice = new Manager( "hci0" );
78 79
79 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); 80 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) );
80 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); 81 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) );
81 82
82 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) ); 83 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) );
83 84
84 connect( devicesView, SIGNAL( clicked(QListViewItem*)), 85 connect( devicesView, SIGNAL( clicked(QListViewItem*)),
85 this, SLOT( startServiceActionClicked(QListViewItem*) ) ); 86 this, SLOT( startServiceActionClicked(QListViewItem*) ) );
86 connect( devicesView, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), 87 connect( devicesView, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ),
87 this, SLOT(startServiceActionHold(QListViewItem*,const QPoint&,int) ) ); 88 this, SLOT(startServiceActionHold(QListViewItem*,const QPoint&,int) ) );
88 connect( m_localDevice , SIGNAL( foundServices(const QString&,Services::ValueList) ), 89 connect( m_localDevice , SIGNAL( foundServices(const QString&,Services::ValueList) ),
89 this, SLOT( addServicesToDevice(const QString&,Services::ValueList) ) ); 90 this, SLOT( addServicesToDevice(const QString&,Services::ValueList) ) );
90 connect( m_localDevice, SIGNAL( available(const QString&,bool) ), 91 connect( m_localDevice, SIGNAL( available(const QString&,bool) ),
91 this, SLOT( deviceActive(const QString&,bool) ) ); 92 this, SLOT( deviceActive(const QString&,bool) ) );
92 connect( m_localDevice, SIGNAL( connections(ConnectionState::ValueList) ), 93 connect( m_localDevice, SIGNAL( connections(ConnectionState::ValueList) ),
93 this, SLOT( addConnectedDevices(ConnectionState::ValueList) ) ); 94 this, SLOT( addConnectedDevices(ConnectionState::ValueList) ) );
94 connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ), 95 connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ),
95 this, SLOT( addSignalStrength(const QString&,const QString&) ) ); 96 this, SLOT( addSignalStrength(const QString&,const QString&) ) );
96 connect(runButton, SIGNAL(clicked()), this, SLOT(doForward())); 97 connect(runButton, SIGNAL(clicked()), this, SLOT(doForward()));
98 connect(encCheckBox, SIGNAL(toggled(bool)), this, SLOT(doEncrypt(bool)));
97 99
98 // let hold be rightButtonClicked() 100 // let hold be rightButtonClicked()
99 QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold); 101 QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold);
100 QPEApplication::setStylusOperation( connectionsView->viewport(), QPEApplication::RightOnHold); 102 QPEApplication::setStylusOperation( connectionsView->viewport(), QPEApplication::RightOnHold);
101 103
102 //Load all icons needed 104 //Load all icons needed
103 m_offPix = Resource::loadPixmap( "opietooth/notconnected" ); 105 m_offPix = Resource::loadPixmap( "opietooth/notconnected" );
104 m_onPix = Resource::loadPixmap( "opietooth/connected" ); 106 m_onPix = Resource::loadPixmap( "opietooth/connected" );
105 m_findPix = Resource::loadPixmap( "opietooth/find" ); 107 m_findPix = Resource::loadPixmap( "opietooth/find" );
106 108
107 QPalette pal = this->palette(); 109 QPalette pal = this->palette();
108 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 110 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
109 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 111 pal.setColor( QPalette::Active, QColorGroup::Button, col );
110 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 112 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
111 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 113 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
112 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 114 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
113 this->setPalette( pal ); 115 this->setPalette( pal );
114 116
115 setCaption( tr( "Bluetooth Manager" ) ); 117 setCaption( tr( "Bluetooth Manager" ) );
116 118
117 readConfig(); 119 readConfig();
118 initGui(); 120 initGui();
119 121
120 devicesView->setRootIsDecorated(true); 122 devicesView->setRootIsDecorated(true);
121 m_iconLoader = new BTIconLoader(); 123 m_iconLoader = new BTIconLoader();
122 writeToHciConfig(); 124 writeToHciConfig();
123 addConnectedDevices(); 125 addConnectedDevices();
124 readSavedDevices(); 126 readSavedDevices();
125 addServicesToDevices(); 127 addServicesToDevices();
126 QTimer::singleShot( 3000, this, SLOT( addServicesToDevices() ) ); 128 QTimer::singleShot( 3000, this, SLOT( addServicesToDevices() ) );
127 forwarder = NULL; 129 forwarder = NULL;
128 serDevName->setText(tr("/dev/ircomm0")); 130 serDevName->setText(tr("/dev/ircomm0"));
129 for (unsigned int i = 0; i < (sizeof(speeds) / sizeof(speeds[0])); i++) { 131 for (unsigned int i = 0; i < (sizeof(speeds) / sizeof(speeds[0])); i++) {
130 serSpeed->insertItem(speeds[i].str); 132 serSpeed->insertItem(speeds[i].str);
131 } 133 }
132 serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1); 134 serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1);
135 encCheckBox->setChecked(true);
133} 136}
134 137
135/** 138/**
136 * Reads all options from the config file 139 * Reads all options from the config file
137 */ 140 */
138void BlueBase::readConfig() 141void BlueBase::readConfig()
139{ 142{
140 143
141 Config cfg( "bluetoothmanager" ); 144 Config cfg( "bluetoothmanager" );
142 cfg.setGroup( "bluezsettings" ); 145 cfg.setGroup( "bluezsettings" );
143 146
144 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with 147 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with
145 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak 148 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak
146 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE ); 149 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE );
147 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE ); 150 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE );
148 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE ); 151 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE );
149 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE ); 152 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE );
150} 153}
151 154
152/** 155/**
153 * Writes all options to the config file 156 * Writes all options to the config file
154 */ 157 */
155void BlueBase::writeConfig() 158void BlueBase::writeConfig()
156{ 159{
157 160
158 Config cfg( "bluetoothmanager" ); 161 Config cfg( "bluetoothmanager" );
159 cfg.setGroup( "bluezsettings" ); 162 cfg.setGroup( "bluezsettings" );
160 163
161 cfg.writeEntry( "name" , m_deviceName ); 164 cfg.writeEntry( "name" , m_deviceName );
162 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey ); 165 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey );
163 cfg.writeEntry( "useEncryption" , m_useEncryption ); 166 cfg.writeEntry( "useEncryption" , m_useEncryption );
164 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification ); 167 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification );
165 cfg.writeEntry( "enablePagescan" , m_enablePagescan ); 168 cfg.writeEntry( "enablePagescan" , m_enablePagescan );
166 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); 169 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan );
167 170
168 writeToHciConfig(); 171 writeToHciConfig();
169} 172}
170 173
171/** 174/**
172 * Modify the hcid.conf file to our needs 175 * Modify the hcid.conf file to our needs
173 */ 176 */
174void BlueBase::writeToHciConfig() 177void BlueBase::writeToHciConfig()
175{ 178{
179 QFile pinFile("/etc/bluetooth/pin"); // /etc/bluetooth/pin file
176 owarn << "writeToHciConfig" << oendl; 180 owarn << "writeToHciConfig" << oendl;
181 //Write /etc/bluetooth/hcid.conf file
177 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 182 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
178 hciconf.load(); 183 hciconf.load();
179 hciconf.setPinHelper( QPEApplication::qpeDir() + "bin/bluepin" ); 184 hciconf.setPinHelper( QPEApplication::qpeDir() + "bin/bluepin" );
180 hciconf.setName( m_deviceName ); 185 hciconf.setName( m_deviceName );
181 hciconf.setEncrypt( m_useEncryption ); 186 hciconf.setEncrypt( m_useEncryption );
182 hciconf.setAuth( m_enableAuthentification ); 187 hciconf.setAuth( m_enableAuthentification );
183 hciconf.setPscan( m_enablePagescan ); 188 hciconf.setPscan( m_enablePagescan );
184 hciconf.setIscan( m_enableInquiryscan ); 189 hciconf.setIscan( m_enableInquiryscan );
185 hciconf.save(); 190 hciconf.save();
191 // Write /etc/bluetooth/pin (default PIN file)
192 pinFile.open(IO_WriteOnly | IO_Truncate);
193 pinFile.writeBlock(m_defaultPasskey, m_defaultPasskey.length());
194 pinFile.writeBlock("\n", sizeof("\n"));
195 pinFile.flush();
196 pinFile.close();
186} 197}
187 198
188 199
189/** 200/**
190 * Read the list of already known devices 201 * Read the list of already known devices
191 */ 202 */
192void BlueBase::readSavedDevices() 203void BlueBase::readSavedDevices()
193{ 204{
194 205
195 QValueList<RemoteDevice> loadedDevices; 206 QValueList<RemoteDevice> loadedDevices;
196 DeviceHandler handler; 207 DeviceHandler handler;
197 loadedDevices = handler.load(); 208 loadedDevices = handler.load();
198 209
199 addSearchedDevices( loadedDevices ); 210 addSearchedDevices( loadedDevices );
200} 211}
201 212
202 213
203/** 214/**
204 * Write the list of already known devices 215 * Write the list of already known devices
205 */ 216 */
206void BlueBase::writeSavedDevices() 217void BlueBase::writeSavedDevices()
207{ 218{
208 QListViewItemIterator it( devicesView ); 219 QListViewItemIterator it( devicesView );
209 BTListItem* item; 220 BTListItem* item;
210 BTDeviceItem* device; 221 BTDeviceItem* device;
211 RemoteDevice::ValueList list; 222 RemoteDevice::ValueList list;
212 for ( ; it.current(); ++it ) 223 for ( ; it.current(); ++it )
213 { 224 {
214 item = (BTListItem*)it.current(); 225 item = (BTListItem*)it.current();
215 if(item->typeId() != BTListItem::Device ) 226 if(item->typeId() != BTListItem::Device )
216 continue; 227 continue;
217 device = (BTDeviceItem*)item; 228 device = (BTDeviceItem*)item;
218 229
219 list.append( device->remoteDevice() ); 230 list.append( device->remoteDevice() );
220 } 231 }
221 /* 232 /*
222 * if not empty save the List through DeviceHandler 233 * if not empty save the List through DeviceHandler
223 */ 234 */
224 if ( list.isEmpty() ) 235 if ( list.isEmpty() )
225 return; 236 return;
226 DeviceHandler handler; 237 DeviceHandler handler;
227 handler.save( list ); 238 handler.save( list );
228} 239}
229 240
230 241
231/** 242/**
232 * Set up the gui 243 * Set up the gui
233 */ 244 */
234void BlueBase::initGui() 245void BlueBase::initGui()
235{ 246{
236 StatusLabel->setText( status() ); // maybe move it to getStatus() 247 StatusLabel->setText( status() ); // maybe move it to getStatus()
237 cryptCheckBox->setChecked( m_useEncryption ); 248 cryptCheckBox->setChecked( m_useEncryption );
238 authCheckBox->setChecked( m_enableAuthentification ); 249 authCheckBox->setChecked( m_enableAuthentification );
239 pagescanCheckBox->setChecked( m_enablePagescan ); 250 pagescanCheckBox->setChecked( m_enablePagescan );
240 inquiryscanCheckBox->setChecked( m_enableInquiryscan ); 251 inquiryscanCheckBox->setChecked( m_enableInquiryscan );
241 deviceNameLine->setText( m_deviceName ); 252 deviceNameLine->setText( m_deviceName );
242 passkeyLine->setText( m_defaultPasskey ); 253 passkeyLine->setText( m_defaultPasskey );
243 // set info tab 254 // set info tab
244 setInfo(); 255 setInfo();
245} 256}
246 257
247 258
248/** 259/**
249 * Get the status informations and returns it 260 * Get the status informations and returns it
250 * @return QString the status informations gathered 261 * @return QString the status informations gathered
251 */ 262 */
252QString BlueBase::status()const 263QString BlueBase::status()const
253{ 264{
254 QString infoString = tr( "<b>Device name : </b> Ipaq" ); 265 QString infoString = tr( "<b>Device name : </b> Ipaq" );
255 infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" ); 266 infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" );
256 infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" ); 267 infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" );
257 268
258 return (infoString); 269 return (infoString);
259} 270}
260 271
261 272
262/** 273/**
263 * Read the current values from the gui and invoke writeConfig() 274 * Read the current values from the gui and invoke writeConfig()
264 */ 275 */
265void BlueBase::applyConfigChanges() 276void BlueBase::applyConfigChanges()
266{ 277{
267 m_deviceName = deviceNameLine->text(); 278 m_deviceName = deviceNameLine->text();
268 m_defaultPasskey = passkeyLine->text(); 279 m_defaultPasskey = passkeyLine->text();
269 m_useEncryption = cryptCheckBox->isChecked(); 280 m_useEncryption = cryptCheckBox->isChecked();
270 m_enableAuthentification = authCheckBox->isChecked(); 281 m_enableAuthentification = authCheckBox->isChecked();
271 m_enablePagescan = pagescanCheckBox->isChecked(); 282 m_enablePagescan = pagescanCheckBox->isChecked();
272 m_enableInquiryscan = inquiryscanCheckBox->isChecked(); 283 m_enableInquiryscan = inquiryscanCheckBox->isChecked();
273 284
274 writeConfig(); 285 writeConfig();
275 286
276 QMessageBox::information( this, tr("Test") , tr("Changes were applied.") ); 287 QMessageBox::information( this, tr("Test") , tr("Changes were applied.") );
277} 288}
278 289
279/** 290/**
280 * Launch Rfcomm Bind dialog 291 * Launch Rfcomm Bind dialog
281 * 292 *
282 */ 293 */
283void BlueBase::rfcommDialog() 294void BlueBase::rfcommDialog()
284{ 295{
285 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); 296 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
286 297
287 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted ) 298 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
288 { 299 {
289 rfcommAssign.saveConfig(); 300 rfcommAssign.saveConfig();
290 } 301 }
291} 302}
292 303
293/** 304/**
294 * Add fresh found devices from scan dialog to the listing 305 * Add fresh found devices from scan dialog to the listing
295 * 306 *
296 */ 307 */
297void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) 308void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices )
298{ 309{
299 BTDeviceItem * deviceItem; 310 BTDeviceItem * deviceItem;
300 QValueList<RemoteDevice>::ConstIterator it; 311 QValueList<RemoteDevice>::ConstIterator it;
301 312
302 for( it = newDevices.begin(); it != newDevices.end() ; ++it ) 313 for( it = newDevices.begin(); it != newDevices.end() ; ++it )
303 { 314 {
304 315
305 if (find( (*it) )) // is already inserted 316 if (find( (*it) )) // is already inserted
306 continue; 317 continue;
307 318
308 deviceItem = new BTDeviceItem( devicesView , (*it) ); 319 deviceItem = new BTDeviceItem( devicesView , (*it) );
309 deviceItem->setPixmap( 1, m_findPix ); 320 deviceItem->setPixmap( 1, m_findPix );
310 deviceItem->setExpandable ( true ); 321 deviceItem->setExpandable ( true );
311 322
312 // look if device is avail. atm, async 323 // look if device is avail. atm, async
313 deviceActive( (*it) ); 324 deviceActive( (*it) );
314 } 325 }
315} 326}
316 327
317 328
318/** 329/**
319 * Action that is toggled on entrys on click 330 * Action that is toggled on entrys on click
320 */ 331 */
321void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) 332void BlueBase::startServiceActionClicked( QListViewItem */*item*/ )
322{} 333{}
323 334
324 335
325/** 336/**
326 * Action that are toggled on hold (mostly QPopups i guess) 337 * Action that are toggled on hold (mostly QPopups i guess)
327 */ 338 */
328void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) 339void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ )
329{ 340{
330 if (!item ) 341 if (!item )
331 return; 342 return;
332 343
333 QPopupMenu *menu = new QPopupMenu(); 344 QPopupMenu *menu = new QPopupMenu();
334 345
335 if ( static_cast<BTListItem*>( item )->type() == "device") 346 if ( static_cast<BTListItem*>( item )->type() == "device")
336 { 347 {
337 QPopupMenu *groups = new QPopupMenu(); 348 QPopupMenu *groups = new QPopupMenu();
338 349
339 menu->insertItem( static_cast<BTDeviceItem*>( item )->name(), 0 ); 350 menu->insertItem( static_cast<BTDeviceItem*>( item )->name(), 0 );
340 menu->insertSeparator( 1 ); 351 menu->insertSeparator( 1 );
341 menu->insertItem( tr( "&Rescan services" ), 2); 352 menu->insertItem( tr( "&Rescan services" ), 2);
342 // menu->insertItem( tr( "&Add to group" ), groups, 3); 353 // menu->insertItem( tr( "&Add to group" ), groups, 3);
343 menu->insertItem( tr( "&Delete"), 4); 354 menu->insertItem( tr( "&Delete"), 4);
344 int ret = menu->exec( point, 0); 355 int ret = menu->exec( point, 0);
345 356
346 switch(ret) 357 switch(ret)
347 { 358 {
348 case -1: 359 case -1:
349 break; 360 break;
350 case 2: 361 case 2:
351 addServicesToDevice( static_cast<BTDeviceItem*>( item ) ); 362 addServicesToDevice( static_cast<BTDeviceItem*>( item ) );
352 break; 363 break;
353 364
354 case 4: 365 case 4:
355 // deletes childs too 366 // deletes childs too
356 delete item; 367 delete item;
357 break; 368 break;
358 } 369 }
359 // delete groups; 370 // delete groups;
360 } 371 }
361 372
362 /* 373 /*
363 * We got service sensitive PopupMenus in our factory 374 * We got service sensitive PopupMenus in our factory
364 * We will create one through the factory and will insert 375 * We will create one through the factory and will insert
365 * our Separator + ShowInfo into the menu or create a new 376 * our Separator + ShowInfo into the menu or create a new
366 * one if the factory returns 0 377 * one if the factory returns 0
367 * PopupMenu deletion is kind of weird. 378 * PopupMenu deletion is kind of weird.
368 * If escaped( -1 ) or any of our items were chosen we'll 379 * If escaped( -1 ) or any of our items were chosen we'll
369 * delete the PopupMenu otherwise it's the responsibility of 380 * delete the PopupMenu otherwise it's the responsibility of
370 * the PopupMenu to delete itself 381 * the PopupMenu to delete itself
371 * 382 *
372 */ 383 */
373 else if ( ((BTListItem*)item)->type() == "service") 384 else if ( ((BTListItem*)item)->type() == "service")
374 { 385 {
375 BTServiceItem* service = (BTServiceItem*)item; 386 BTServiceItem* service = (BTServiceItem*)item;
376 QMap<int, QString> list = service->services().classIdList(); 387 QMap<int, QString> list = service->services().classIdList();
377 QMap<int, QString>::Iterator it = list.begin(); 388 QMap<int, QString>::Iterator it = list.begin();
378 QPopupMenu *popup =0l; 389 QPopupMenu *popup =0l;
379 if ( it != list.end() ) 390 if ( it != list.end() )
380 { 391 {
381 owarn << "Searching id " << it.key() << " " << it.data().latin1() << "" << oendl; 392 owarn << "Searching id " << it.key() << " " << it.data().latin1() << "" << oendl;
382 popup = m_popHelper.find( it.key(), 393 popup = m_popHelper.find( it.key(),
383 service->services(), 394 service->services(),
384 (BTDeviceItem*)service->parent() ); 395 (BTDeviceItem*)service->parent() );
385 } 396 }
386 else 397 else
387 { 398 {
388 owarn << "Empty" << oendl; 399 owarn << "Empty" << oendl;
389 } 400 }
390 401
391 if ( popup == 0l ) 402 if ( popup == 0l )
392 { 403 {
393 owarn << "factory returned 0l" << oendl; 404 owarn << "factory returned 0l" << oendl;
394 popup = new QPopupMenu(); 405 popup = new QPopupMenu();
395 } 406 }
396 int test1 = popup->insertItem( tr("Test1:"), 2); 407 int test1 = popup->insertItem( tr("Test1:"), 2);
397 408
398 int ret = popup->exec( point ); 409 int ret = popup->exec( point );
399 owarn << "returned from exec() " << oendl; 410 owarn << "returned from exec() " << oendl;
400 if ( ret == -1 ) 411 if ( ret == -1 )
401 { 412 {
402 ; 413 ;
403 } 414 }
404 else if ( ret == test1 ) 415 else if ( ret == test1 )
405 { 416 {
406 ; 417 ;
407 } 418 }
408 delete popup; 419 delete popup;
409 } 420 }
410 delete menu; 421 delete menu;
411} 422}
412 423
413 424
414void BlueBase::addServicesToDevices() 425void BlueBase::addServicesToDevices()
415{ 426{
416 odebug << "BlueBase::addServicesToDevices()" << oendl; 427 odebug << "BlueBase::addServicesToDevices()" << oendl;
417 BTDeviceItem* item = (BTDeviceItem*) devicesView->firstChild(); 428 BTDeviceItem* item = (BTDeviceItem*) devicesView->firstChild();
418 while ( item ) 429 while ( item )
419 { 430 {
420 addServicesToDevice( item ); 431 addServicesToDevice( item );
421 item = (BTDeviceItem*) static_cast<QListViewItem*>( item )->nextSibling(); 432 item = (BTDeviceItem*) static_cast<QListViewItem*>( item )->nextSibling();
422 } 433 }
423} 434}
424 435
425/** 436/**
426 * Search and display avail. services for a device (on expand from device listing) 437 * Search and display avail. services for a device (on expand from device listing)
427 * @param item the service item returned 438 * @param item the service item returned
428 */ 439 */
429void BlueBase::addServicesToDevice( BTDeviceItem * item ) 440void BlueBase::addServicesToDevice( BTDeviceItem * item )
430{ 441{
431 odebug << "BlueBase::addServicesToDevice" << oendl; 442 odebug << "BlueBase::addServicesToDevice" << oendl;
432 // row of mac adress text(3) 443 // row of mac adress text(3)
433 RemoteDevice device = item->remoteDevice(); 444 RemoteDevice device = item->remoteDevice();
434 m_deviceList.insert( item->mac() , item ); 445 m_deviceList.insert( item->mac() , item );
435 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back 446 // and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back
436 m_localDevice->searchServices( device ); 447 m_localDevice->searchServices( device );
437} 448}
438 449
439 450
440/** 451/**
441 * @param device the mac address of the remote device 452 * @param device the mac address of the remote device
442 * @param servicesList the list with the service the device has. 453 * @param servicesList the list with the service the device has.
443 */ 454 */
444void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) 455void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList )
445{ 456{
446 odebug << "BlueBase::fill services list" << oendl; 457 odebug << "BlueBase::fill services list" << oendl;
447 458
448 QMap<QString,BTDeviceItem*>::Iterator it; 459 QMap<QString,BTDeviceItem*>::Iterator it;
449 BTDeviceItem* deviceItem = 0; 460 BTDeviceItem* deviceItem = 0;
450 461
451 // get the right devices which requested the search 462 // get the right devices which requested the search
452 it = m_deviceList.find( device ); 463 it = m_deviceList.find( device );
453 if( it == m_deviceList.end() ) 464 if( it == m_deviceList.end() )
454 return; 465 return;
455 deviceItem = it.data(); 466 deviceItem = it.data();
456 467
457 // remove previous entries 468 // remove previous entries
458 QList<QListViewItem> tempList; 469 QList<QListViewItem> tempList;
459 tempList.setAutoDelete( true ); 470 tempList.setAutoDelete( true );
460 QListViewItem * child = deviceItem->firstChild(); 471 QListViewItem * child = deviceItem->firstChild();
461 while( child ) 472 while( child )
462 { 473 {
463 tempList.append( child ); 474 tempList.append( child );
464 child = child->nextSibling(); 475 child = child->nextSibling();
465 } 476 }
466 tempList.clear(); 477 tempList.clear();
467 478
468 QValueList<OpieTooth::Services>::Iterator it2; 479 QValueList<OpieTooth::Services>::Iterator it2;
469 BTServiceItem* serviceItem; 480 BTServiceItem* serviceItem;
470 481
471 482
472 if (!servicesList.isEmpty() ) 483 if (!servicesList.isEmpty() )
473 { 484 {
474 // add services 485 // add services
475 QMap<int, QString> list; 486 QMap<int, QString> list;
476 QMap<int, QString>::Iterator classIt; 487 QMap<int, QString>::Iterator classIt;
477 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) 488 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 )
478 { 489 {
479 serviceItem = new BTServiceItem( deviceItem, (*it2) ); 490 serviceItem = new BTServiceItem( deviceItem, (*it2) );
480 list = (*it2).classIdList(); 491 list = (*it2).classIdList();
481 classIt = list.begin(); 492 classIt = list.begin();
482 int classId=0; 493 int classId=0;
483 if ( classIt != list.end() ) 494 if ( classIt != list.end() )
484 { 495 {
485 classId = classIt.key(); 496 classId = classIt.key();
486 } 497 }
487 498
488 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) ); 499 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) );
489 } 500 }
490 } 501 }
491 else 502 else
492 { 503 {
493 Services s1; 504 Services s1;
494 s1.setServiceName( tr("no services found") ); 505 s1.setServiceName( tr("no services found") );
495 serviceItem = new BTServiceItem( deviceItem, s1 ); 506 serviceItem = new BTServiceItem( deviceItem, s1 );
496 } 507 }
497 // now remove them from the list 508 // now remove them from the list
498 m_deviceList.remove( it ); 509 m_deviceList.remove( it );
499} 510}
500 511
501void BlueBase::addSignalStrength() 512void BlueBase::addSignalStrength()
502{ 513{
503 514
504 QListViewItemIterator it( connectionsView ); 515 QListViewItemIterator it( connectionsView );
505 for ( ; it.current(); ++it ) 516 for ( ; it.current(); ++it )
506 { 517 {
507 m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() ); 518 m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() );
508 } 519 }
509 520
510 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) ); 521 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
511} 522}
512 523
513void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) 524void BlueBase::addSignalStrength( const QString& mac, const QString& strength )
514{ 525{
515 526
516 QListViewItemIterator it( connectionsView ); 527 QListViewItemIterator it( connectionsView );
517 for ( ; it.current(); ++it ) 528 for ( ; it.current(); ++it )
518 { 529 {
519 if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) 530 if( ((BTConnectionItem*)it.current())->connection().mac() == mac )
520 { 531 {
521 ((BTConnectionItem*)it.current() )->setSignalStrength( strength ); 532 ((BTConnectionItem*)it.current() )->setSignalStrength( strength );
522 } 533 }
523 } 534 }
524} 535}
525 536
526/** 537/**
527 * Add the existing connections (pairs) to the connections tab. 538 * Add the existing connections (pairs) to the connections tab.
528 * This one triggers the search 539 * This one triggers the search
529 */ 540 */
530void BlueBase::addConnectedDevices() 541void BlueBase::addConnectedDevices()
531{ 542{
532 m_localDevice->searchConnections(); 543 m_localDevice->searchConnections();
533 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) ); 544 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
534} 545}
535 546
536/** 547/**
537 * This adds the found connections to the connection tab. 548 * This adds the found connections to the connection tab.
538 * @param connectionList the ValueList with all current connections 549 * @param connectionList the ValueList with all current connections
539 */ 550 */
540void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) 551void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
541{ 552{
542 553
543 QValueList<OpieTooth::ConnectionState>::Iterator it; 554 QValueList<OpieTooth::ConnectionState>::Iterator it;
544 BTConnectionItem * connectionItem; 555 BTConnectionItem * connectionItem;
545 556
546 if ( !connectionList.isEmpty() ) 557 if ( !connectionList.isEmpty() )
547 { 558 {
548 559
549 for (it = connectionList.begin(); it != connectionList.end(); ++it) 560 for (it = connectionList.begin(); it != connectionList.end(); ++it)
550 { 561 {
551 562
552 QListViewItemIterator it2( connectionsView ); 563 QListViewItemIterator it2( connectionsView );
553 bool found = false; 564 bool found = false;
554 for ( ; it2.current(); ++it2 ) 565 for ( ; it2.current(); ++it2 )
555 { 566 {
556 if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() ) 567 if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() )
557 { 568 {
558 found = true; 569 found = true;
559 } 570 }
560 } 571 }
561 572
562 if ( found == false ) 573 if ( found == false )
563 { 574 {
564 connectionItem = new BTConnectionItem( connectionsView, (*it) ); 575 connectionItem = new BTConnectionItem( connectionsView, (*it) );
565 576
566 if( m_deviceList.find((*it).mac()).data() ) 577 if( m_deviceList.find((*it).mac()).data() )
567 { 578 {
568 connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() ); 579 connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() );
569 } 580 }
570 } 581 }
571 582
572 } 583 }
573 584
574 QListViewItemIterator it2( connectionsView ); 585 QListViewItemIterator it2( connectionsView );
575 for ( ; it2.current(); ++it2 ) 586 for ( ; it2.current(); ++it2 )
576 { 587 {
577 bool found = false; 588 bool found = false;
578 for (it = connectionList.begin(); it != connectionList.end(); ++it) 589 for (it = connectionList.begin(); it != connectionList.end(); ++it)
579 { 590 {
580 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) 591 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() )
581 { 592 {
582 found = true; 593 found = true;
583 } 594 }
584 } 595 }
585 596
586 if ( !found ) 597 if ( !found )
587 { 598 {
588 delete it2.current(); 599 delete it2.current();
589 } 600 }
590 601
591 } 602 }
592 603
593 604
594 } 605 }
595 else 606 else
596 { 607 {
597 connectionsView->clear(); 608 connectionsView->clear();
598 ConnectionState con; 609 ConnectionState con;
599 con.setMac( tr("No connections found") ); 610 con.setMac( tr("No connections found") );
600 connectionItem = new BTConnectionItem( connectionsView , con ); 611 connectionItem = new BTConnectionItem( connectionsView , con );
601 } 612 }
602 613
603 // recall connection search after some time 614 // recall connection search after some time
604 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) ); 615 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) );
605} 616}
606 617
607 618
608/** 619/**
609 * Find out if a device can currently be reached 620 * Find out if a device can currently be reached
610 * @param device 621 * @param device
611 */ 622 */
612void BlueBase::deviceActive( const RemoteDevice &device ) 623void BlueBase::deviceActive( const RemoteDevice &device )
613{ 624{
614 // search by mac, async, gets a signal back 625 // search by mac, async, gets a signal back
615 // We should have a BTDeviceItem there or where does it get added to the map -zecke 626 // We should have a BTDeviceItem there or where does it get added to the map -zecke
616 m_localDevice->isAvailable( device.mac() ); 627 m_localDevice->isAvailable( device.mac() );
617} 628}
618 629
619 630
620/** 631/**
621 * The signal catcher. Set the avail. status on device. 632 * The signal catcher. Set the avail. status on device.
622 * @param device - the mac address 633 * @param device - the mac address
623 * @param connected - if it is avail. or not 634 * @param connected - if it is avail. or not
624 */ 635 */
625void BlueBase::deviceActive( const QString& device, bool connected ) 636void BlueBase::deviceActive( const QString& device, bool connected )
626{ 637{
627 odebug << "deviceActive slot" << oendl; 638 odebug << "deviceActive slot" << oendl;
628 639
629 QMap<QString,BTDeviceItem*>::Iterator it; 640 QMap<QString,BTDeviceItem*>::Iterator it;
630 641
631 it = m_deviceList.find( device ); 642 it = m_deviceList.find( device );
632 if( it == m_deviceList.end() ) 643 if( it == m_deviceList.end() )
633 return; 644 return;
634 645
635 BTDeviceItem* deviceItem = it.data(); 646 BTDeviceItem* deviceItem = it.data();
636 647
637 if ( connected ) 648 if ( connected )
638 { 649 {
639 deviceItem->setPixmap( 1, m_onPix ); 650 deviceItem->setPixmap( 1, m_onPix );
640 } 651 }
641 else 652 else
642 { 653 {
643 deviceItem->setPixmap( 1, m_offPix ); 654 deviceItem->setPixmap( 1, m_offPix );
644 } 655 }
645 m_deviceList.remove( it ); 656 m_deviceList.remove( it );
646} 657}
647 658
648 659
649/** 660/**
650 * Open the "scan for devices" dialog 661 * Open the "scan for devices" dialog
651 */ 662 */
652void BlueBase::startScan() 663void BlueBase::startScan()
653{ 664{
654 ScanDialog *scan = new ScanDialog( this, "ScanDialog", 665 ScanDialog *scan = new ScanDialog( this, "ScanDialog",
655 true, WDestructiveClose ); 666 true, WDestructiveClose );
656 QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ), 667 QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ),
657 this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) ); 668 this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) );
658 669
659 QPEApplication::showDialog( scan ); 670 QPEApplication::showDialog( scan );
660} 671}
661 672
662 673
663/** 674/**
664 * Set the informations about the local device in information Tab 675 * Set the informations about the local device in information Tab
665 */ 676 */
666void BlueBase::setInfo() 677void BlueBase::setInfo()
667{ 678{
668 StatusLabel->setText( status() ); 679 StatusLabel->setText( status() );
669} 680}
670 681
671 682
672/** 683/**
673 * Decontructor 684 * Decontructor
674 */ 685 */
675BlueBase::~BlueBase() 686BlueBase::~BlueBase()
676{ 687{
677 writeSavedDevices(); 688 writeSavedDevices();
678 delete m_iconLoader; 689 delete m_iconLoader;
679} 690}
680 691
681 692
682/** 693/**
683 * find searches the ListView for a BTDeviceItem containig 694 * find searches the ListView for a BTDeviceItem containig
684 * the same Device if found return true else false 695 * the same Device if found return true else false
685 * @param dev RemoteDevice to find 696 * @param dev RemoteDevice to find
686 * @return returns true if found 697 * @return returns true if found
687 */ 698 */
688bool BlueBase::find( const RemoteDevice& rem ) 699bool BlueBase::find( const RemoteDevice& rem )
689{ 700{
690 QListViewItemIterator it( devicesView ); 701 QListViewItemIterator it( devicesView );
691 BTListItem* item; 702 BTListItem* item;
692 BTDeviceItem* device; 703 BTDeviceItem* device;
693 for (; it.current(); ++it ) 704 for (; it.current(); ++it )
694 { 705 {
695 item = (BTListItem*) it.current(); 706 item = (BTListItem*) it.current();
696 if ( item->typeId() != BTListItem::Device ) 707 if ( item->typeId() != BTListItem::Device )
697 continue; 708 continue;
698 709
699 device = (BTDeviceItem*)item; 710 device = (BTDeviceItem*)item;
700 if ( rem.equals( device->remoteDevice() ) ) 711 if ( rem.equals( device->remoteDevice() ) )
701 return true; 712 return true;
702 } 713 }
703 return false; // not found 714 return false; // not found
704} 715}
705 716
706/** 717/**
707 * Start process of the cell phone forwarding 718 * Start process of the cell phone forwarding
708 */ 719 */
709void BlueBase::doForward() 720void BlueBase::doForward()
710{ 721{
711 if (forwarder && forwarder->isRunning()) { 722 if (forwarder && forwarder->isRunning()) {
712 runButton->setText("start gateway"); 723 runButton->setText("start gateway");
713 forwarder->stop(); 724 forwarder->stop();
714 delete forwarder; 725 delete forwarder;
715 forwarder = NULL; 726 forwarder = NULL;
716 return; 727 return;
717 } 728 }
718 QString str = serDevName->text(); 729 QString str = serDevName->text();
719 forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val); 730 forwarder = new SerialForwarder(str, speeds[serSpeed->currentItem()].val);
720 connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)), 731 connect(forwarder, SIGNAL(processExited(Opie::Core::OProcess*)),
721 this, SLOT(forwardExited(Opie::Core::OProcess*))); 732 this, SLOT(forwardExited(Opie::Core::OProcess*)));
722 if (forwarder->start(OProcess::NotifyOnExit) < 0) { 733 if (forwarder->start(OProcess::NotifyOnExit) < 0) {
723 QMessageBox::critical(this, tr("Forwarder Error"), 734 QMessageBox::critical(this, tr("Forwarder Error"),
724 tr("Forwarder start error:") + tr(strerror(errno))); 735 tr("Forwarder start error:") + tr(strerror(errno)));
725 return; 736 return;
726 } 737 }
727 runButton->setText("stop gateway"); 738 runButton->setText("stop gateway");
728} 739}
729 740
730/** 741/**
731 * React on the process end 742 * React on the process end
732 */ 743 */
733void BlueBase::forwardExit(Opie::Core::OProcess* proc) 744void BlueBase::forwardExit(Opie::Core::OProcess* proc)
734{ 745{
735 if (proc->exitStatus() != 0) 746 if (proc->exitStatus() != 0)
736 QMessageBox::critical(this, tr("Forwarder Error"), 747 QMessageBox::critical(this, tr("Forwarder Error"),
737 tr("Forwarder start error")); 748 tr("Forwarder start error"));
738 delete proc; 749 delete proc;
739 forwarder = NULL; 750 forwarder = NULL;
740 runButton->setText("start gateway"); 751 runButton->setText("start gateway");
741} 752}
742 753
754/**
755 * Encrypt entered passkey
756 * doit - do encryption of the key
757 */
758void BlueBase::doEncrypt(bool doit)
759{
760 passkeyLine->setEchoMode((doit)? QLineEdit::Password: QLineEdit::Normal);
761}
762
743//eof 763//eof
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 0128a88..9cbea56 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -1,106 +1,107 @@
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 forwardExit(Opie::Core::OProcess* proc); 98 void forwardExit(Opie::Core::OProcess* proc);
98 void addSignalStrength(); 99 void addSignalStrength();
99 void addSignalStrength( const QString& mac, const QString& strengh ); 100 void addSignalStrength( const QString& mac, const QString& strengh );
100 void rfcommDialog(); 101 void rfcommDialog();
101 102
102 }; 103 };
103 104
104} 105}
105 106
106#endif 107#endif
diff --git a/noncore/net/opietooth/manager/bluetoothbase.ui b/noncore/net/opietooth/manager/bluetoothbase.ui
index a5e2c6f..5539181 100644
--- a/noncore/net/opietooth/manager/bluetoothbase.ui
+++ b/noncore/net/opietooth/manager/bluetoothbase.ui
@@ -1,538 +1,522 @@
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>268</width> 14 <width>273</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 <vbox> 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 <grid>
198 <property stdset="1"> 198 <property stdset="1">
199 <name>margin</name> 199 <name>margin</name>
200 <number>4</number> 200 <number>4</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 row="1" column="0" >
207 <class>QPushButton</class> 207 <class>QPushButton</class>
208 <property stdset="1"> 208 <property stdset="1">
209 <name>name</name> 209 <name>name</name>
210 <cstring>rfcommBindButton</cstring> 210 <cstring>rfcommBindButton</cstring>
211 </property> 211 </property>
212 <property stdset="1"> 212 <property stdset="1">
213 <name>text</name> 213 <name>text</name>
214 <string>&amp;Edit RFCOMM Bind Table</string> 214 <string>&amp;Edit RFCOMM Bind Table</string>
215 </property> 215 </property>
216 </widget> 216 </widget>
217 <widget row="0" column="0" > 217 <widget row="0" column="0" >
218 <class>QGroupBox</class> 218 <class>QGroupBox</class>
219 <property stdset="1"> 219 <property stdset="1">
220 <name>name</name> 220 <name>name</name>
221 <cstring>GroupBox1</cstring> 221 <cstring>GroupBox1</cstring>
222 </property> 222 </property>
223 <property stdset="1"> 223 <property stdset="1">
224 <name>title</name> 224 <name>title</name>
225 <string>Bluetooth Basic Config</string> 225 <string>Bluetooth Basic Config</string>
226 </property> 226 </property>
227 <property> 227 <property>
228 <name>layoutMargin</name> 228 <name>layoutMargin</name>
229 </property> 229 </property>
230 <property> 230 <property>
231 <name>layoutSpacing</name> 231 <name>layoutSpacing</name>
232 </property> 232 </property>
233 <grid> 233 <grid>
234 <property stdset="1"> 234 <property stdset="1">
235 <name>margin</name> 235 <name>margin</name>
236 <number>4</number> 236 <number>4</number>
237 </property> 237 </property>
238 <property stdset="1"> 238 <property stdset="1">
239 <name>spacing</name> 239 <name>spacing</name>
240 <number>2</number> 240 <number>2</number>
241 </property> 241 </property>
242 <widget row="6" column="0" rowspan="1" colspan="2" > 242 <widget row="0" column="0" >
243 <class>QPushButton</class> 243 <class>QLabel</class>
244 <property stdset="1"> 244 <property stdset="1">
245 <name>name</name> 245 <name>name</name>
246 <cstring>configApplyButton</cstring> 246 <cstring>deviceNameLabel</cstring>
247 </property> 247 </property>
248 <property stdset="1"> 248 <property stdset="1">
249 <name>text</name> 249 <name>text</name>
250 <string>Apply</string> 250 <string>Device Name</string>
251 </property> 251 </property>
252 </widget> 252 </widget>
253 <widget row="2" column="0" rowspan="1" colspan="2" > 253 <widget row="1" column="0" >
254 <class>QCheckBox</class> 254 <class>QLabel</class>
255 <property stdset="1"> 255 <property stdset="1">
256 <name>name</name> 256 <name>name</name>
257 <cstring>authCheckBox</cstring> 257 <cstring>passkeyLabel</cstring>
258 </property> 258 </property>
259 <property stdset="1"> 259 <property stdset="1">
260 <name>text</name> 260 <name>text</name>
261 <string>enable authentification</string> 261 <string>Default Passkey</string>
262 </property> 262 </property>
263 </widget> 263 </widget>
264 <widget row="3" column="0" rowspan="1" colspan="2" > 264 <widget row="0" column="1" >
265 <class>QCheckBox</class> 265 <class>QLineEdit</class>
266 <property stdset="1"> 266 <property stdset="1">
267 <name>name</name> 267 <name>name</name>
268 <cstring>cryptCheckBox</cstring> 268 <cstring>deviceNameLine</cstring>
269 </property> 269 </property>
270 </widget>
271 <widget row="1" column="1" >
272 <class>QLineEdit</class>
270 <property stdset="1"> 273 <property stdset="1">
271 <name>text</name> 274 <name>name</name>
272 <string>enable encryption</string> 275 <cstring>passkeyLine</cstring>
276 </property>
277 <property stdset="1">
278 <name>echoMode</name>
279 <enum>Password</enum>
273 </property> 280 </property>
274 </widget> 281 </widget>
275 <widget row="4" column="0" rowspan="1" colspan="2" > 282 <widget row="2" column="1" >
276 <class>QCheckBox</class> 283 <class>QCheckBox</class>
277 <property stdset="1"> 284 <property stdset="1">
278 <name>name</name> 285 <name>name</name>
279 <cstring>pagescanCheckBox</cstring> 286 <cstring>encCheckBox</cstring>
280 </property> 287 </property>
281 <property stdset="1"> 288 <property stdset="1">
282 <name>text</name> 289 <name>text</name>
283 <string>Enable Page scan</string> 290 <string>encrypt</string>
284 </property> 291 </property>
285 </widget> 292 </widget>
286 <widget row="5" column="0" rowspan="1" colspan="2" > 293 <widget row="3" column="0" rowspan="1" colspan="2" >
287 <class>QCheckBox</class> 294 <class>QCheckBox</class>
288 <property stdset="1"> 295 <property stdset="1">
289 <name>name</name> 296 <name>name</name>
290 <cstring>inquiryscanCheckBox</cstring> 297 <cstring>authCheckBox</cstring>
291 </property> 298 </property>
292 <property stdset="1"> 299 <property stdset="1">
293 <name>text</name> 300 <name>text</name>
294 <string>Enable Inquiry scan</string> 301 <string>enable authentification</string>
295 </property> 302 </property>
296 </widget> 303 </widget>
297 <widget row="0" column="0" > 304 <widget row="4" column="0" rowspan="1" colspan="2" >
298 <class>QLabel</class> 305 <class>QCheckBox</class>
299 <property stdset="1"> 306 <property stdset="1">
300 <name>name</name> 307 <name>name</name>
301 <cstring>deviceNameLabel</cstring> 308 <cstring>cryptCheckBox</cstring>
302 </property> 309 </property>
303 <property stdset="1"> 310 <property stdset="1">
304 <name>text</name> 311 <name>text</name>
305 <string>Device Name</string> 312 <string>enable encryption</string>
306 </property> 313 </property>
307 </widget> 314 </widget>
308 <widget row="1" column="0" > 315 <widget row="5" column="0" rowspan="1" colspan="2" >
309 <class>QLabel</class> 316 <class>QCheckBox</class>
310 <property stdset="1"> 317 <property stdset="1">
311 <name>name</name> 318 <name>name</name>
312 <cstring>passkeyLabel</cstring> 319 <cstring>pagescanCheckBox</cstring>
313 </property> 320 </property>
314 <property stdset="1"> 321 <property stdset="1">
315 <name>text</name> 322 <name>text</name>
316 <string>Default Passkey</string> 323 <string>Enable Page scan</string>
317 </property> 324 </property>
318 </widget> 325 </widget>
319 <widget row="0" column="1" > 326 <widget row="6" column="0" rowspan="1" colspan="2" >
320 <class>QLineEdit</class> 327 <class>QCheckBox</class>
321 <property stdset="1"> 328 <property stdset="1">
322 <name>name</name> 329 <name>name</name>
323 <cstring>deviceNameLine</cstring> 330 <cstring>inquiryscanCheckBox</cstring>
331 </property>
332 <property stdset="1">
333 <name>text</name>
334 <string>Enable Inquiry scan</string>
324 </property> 335 </property>
325 </widget> 336 </widget>
326 <widget row="1" column="1" > 337 <widget row="7" column="0" rowspan="1" colspan="2" >
327 <class>QLineEdit</class> 338 <class>QPushButton</class>
328 <property stdset="1"> 339 <property stdset="1">
329 <name>name</name> 340 <name>name</name>
330 <cstring>passkeyLine</cstring> 341 <cstring>configApplyButton</cstring>
331 </property> 342 </property>
332 <property stdset="1"> 343 <property stdset="1">
333 <name>echoMode</name> 344 <name>text</name>
334 <enum>Password</enum> 345 <string>Apply</string>
335 </property> 346 </property>
336 </widget> 347 </widget>
337 </grid> 348 </grid>
338 </widget> 349 </widget>
339 </grid> 350 </grid>
340 </widget> 351 </widget>
341 <widget> 352 <widget>
342 <class>QWidget</class> 353 <class>QWidget</class>
343 <property stdset="1"> 354 <property stdset="1">
344 <name>name</name> 355 <name>name</name>
345 <cstring>tab</cstring> 356 <cstring>tab</cstring>
346 </property> 357 </property>
347 <attribute> 358 <attribute>
348 <name>title</name> 359 <name>title</name>
349 <string>Status</string> 360 <string>Status</string>
350 </attribute> 361 </attribute>
351 <vbox> 362 <vbox>
352 <property stdset="1"> 363 <property stdset="1">
353 <name>margin</name> 364 <name>margin</name>
354 <number>4</number> 365 <number>0</number>
355 </property> 366 </property>
356 <property stdset="1"> 367 <property stdset="1">
357 <name>spacing</name> 368 <name>spacing</name>
358 <number>2</number> 369 <number>0</number>
359 </property> 370 </property>
360 <widget> 371 <widget>
361 <class>QLabel</class> 372 <class>QLabel</class>
362 <property stdset="1"> 373 <property stdset="1">
363 <name>name</name> 374 <name>name</name>
364 <cstring>StatusLabel</cstring> 375 <cstring>StatusLabel</cstring>
365 </property> 376 </property>
366 <property stdset="1"> 377 <property stdset="1">
367 <name>text</name> 378 <name>text</name>
368 <string>Status Label</string> 379 <string>Status Label</string>
369 </property> 380 </property>
370 </widget> 381 </widget>
371 </vbox> 382 </vbox>
372 </widget> 383 </widget>
373 <widget> 384 <widget>
374 <class>QWidget</class> 385 <class>QWidget</class>
375 <property stdset="1"> 386 <property stdset="1">
376 <name>name</name> 387 <name>name</name>
377 <cstring>tab</cstring> 388 <cstring>tab</cstring>
378 </property> 389 </property>
379 <attribute> 390 <attribute>
380 <name>title</name> 391 <name>title</name>
381 <string>Phone</string> 392 <string>Phone</string>
382 </attribute> 393 </attribute>
383 <vbox> 394 <vbox>
384 <property stdset="1"> 395 <property stdset="1">
385 <name>margin</name> 396 <name>margin</name>
386 <number>0</number> 397 <number>4</number>
387 </property> 398 </property>
388 <property stdset="1"> 399 <property stdset="1">
389 <name>spacing</name> 400 <name>spacing</name>
390 <number>0</number> 401 <number>2</number>
391 </property> 402 </property>
392 <widget> 403 <widget>
393 <class>QGroupBox</class> 404 <class>QGroupBox</class>
394 <property stdset="1"> 405 <property stdset="1">
395 <name>name</name> 406 <name>name</name>
396 <cstring>cellForwarder</cstring> 407 <cstring>cellForwarder</cstring>
397 </property> 408 </property>
398 <property stdset="1"> 409 <property stdset="1">
399 <name>title</name> 410 <name>title</name>
400 <string>Cell Forwarder</string> 411 <string>Cell Forwarder</string>
401 </property> 412 </property>
402 <vbox> 413 <property>
414 <name>layoutMargin</name>
415 </property>
416 <property>
417 <name>layoutSpacing</name>
418 </property>
419 <grid>
403 <property stdset="1"> 420 <property stdset="1">
404 <name>margin</name> 421 <name>margin</name>
405 <number>11</number> 422 <number>4</number>
406 </property> 423 </property>
407 <property stdset="1"> 424 <property stdset="1">
408 <name>spacing</name> 425 <name>spacing</name>
409 <number>6</number> 426 <number>2</number>
410 </property> 427 </property>
411 <widget> 428 <widget row="2" column="0" rowspan="1" colspan="3" >
412 <class>QLayoutWidget</class> 429 <class>QPushButton</class>
430 <property stdset="1">
431 <name>name</name>
432 <cstring>runButton</cstring>
433 </property>
434 <property stdset="1">
435 <name>text</name>
436 <string>start gateway</string>
437 </property>
438 </widget>
439 <widget row="0" column="0" rowspan="1" colspan="2" >
440 <class>QLabel</class>
413 <property stdset="1"> 441 <property stdset="1">
414 <name>name</name> 442 <name>name</name>
415 <cstring>Layout9</cstring> 443 <cstring>serDevLabel</cstring>
444 </property>
445 <property stdset="1">
446 <name>text</name>
447 <string>Serial device:</string>
416 </property> 448 </property>
417 <vbox>
418 <property stdset="1">
419 <name>margin</name>
420 <number>0</number>
421 </property>
422 <property stdset="1">
423 <name>spacing</name>
424 <number>6</number>
425 </property>
426 <widget>
427 <class>QLayoutWidget</class>
428 <property stdset="1">
429 <name>name</name>
430 <cstring>Layout5</cstring>
431 </property>
432 <hbox>
433 <property stdset="1">
434 <name>margin</name>
435 <number>0</number>
436 </property>
437 <property stdset="1">
438 <name>spacing</name>
439 <number>6</number>
440 </property>
441 <widget>
442 <class>QLabel</class>
443 <property stdset="1">
444 <name>name</name>
445 <cstring>serDevLabel</cstring>
446 </property>
447 <property stdset="1">
448 <name>text</name>
449 <string>Serial device:</string>
450 </property>
451 </widget>
452 <widget>
453 <class>QLineEdit</class>
454 <property stdset="1">
455 <name>name</name>
456 <cstring>serDevName</cstring>
457 </property>
458 </widget>
459 </hbox>
460 </widget>
461 <widget>
462 <class>QLayoutWidget</class>
463 <property stdset="1">
464 <name>name</name>
465 <cstring>Layout6</cstring>
466 </property>
467 <hbox>
468 <property stdset="1">
469 <name>margin</name>
470 <number>0</number>
471 </property>
472 <property stdset="1">
473 <name>spacing</name>
474 <number>6</number>
475 </property>
476 <widget>
477 <class>QLabel</class>
478 <property stdset="1">
479 <name>name</name>
480 <cstring>serSpeedLabel</cstring>
481 </property>
482 <property stdset="1">
483 <name>text</name>
484 <string>Speed:</string>
485 </property>
486 </widget>
487 <widget>
488 <class>QComboBox</class>
489 <property stdset="1">
490 <name>name</name>
491 <cstring>serSpeed</cstring>
492 </property>
493 </widget>
494 </hbox>
495 </widget>
496 <widget>
497 <class>QPushButton</class>
498 <property stdset="1">
499 <name>name</name>
500 <cstring>runButton</cstring>
501 </property>
502 <property stdset="1">
503 <name>text</name>
504 <string>start gateway</string>
505 </property>
506 </widget>
507 </vbox>
508 </widget> 449 </widget>
509 </vbox> 450 <widget row="0" column="2" >
451 <class>QLineEdit</class>
452 <property stdset="1">
453 <name>name</name>
454 <cstring>serDevName</cstring>
455 </property>
456 </widget>
457 <widget row="1" column="1" rowspan="1" colspan="2" >
458 <class>QComboBox</class>
459 <property stdset="1">
460 <name>name</name>
461 <cstring>serSpeed</cstring>
462 </property>
463 </widget>
464 <widget row="1" column="0" >
465 <class>QLabel</class>
466 <property stdset="1">
467 <name>name</name>
468 <cstring>serSpeedLabel</cstring>
469 </property>
470 <property stdset="1">
471 <name>text</name>
472 <string>Speed:</string>
473 </property>
474 </widget>
475 </grid>
510 </widget> 476 </widget>
511 </vbox> 477 </vbox>
512 </widget> 478 </widget>
513 </widget> 479 </widget>
514 </vbox> 480 </hbox>
515</widget> 481</widget>
516<customwidgets> 482<customwidgets>
517 <customwidget> 483 <customwidget>
518 <class>QWidget</class> 484 <class>QWidget</class>
519 <header location="local">qwidget.h</header> 485 <header location="local">qwidget.h</header>
520 <sizehint> 486 <sizehint>
521 <width>100</width> 487 <width>100</width>
522 <height>100</height> 488 <height>100</height>
523 </sizehint> 489 </sizehint>
524 <container>0</container> 490 <container>0</container>
525 <sizepolicy> 491 <sizepolicy>
526 <hordata>7</hordata> 492 <hordata>7</hordata>
527 <verdata>7</verdata> 493 <verdata>7</verdata>
528 </sizepolicy> 494 </sizepolicy>
529 <pixmap>image0</pixmap> 495 <pixmap>image0</pixmap>
530 </customwidget> 496 </customwidget>
531</customwidgets> 497</customwidgets>
532<images> 498<images>
533 <image> 499 <image>
534 <name>image0</name> 500 <name>image0</name>
535 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> 501 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
536 </image> 502 </image>
537</images> 503</images>
504<tabstops>
505 <tabstop>Status</tabstop>
506 <tabstop>devicesView</tabstop>
507 <tabstop>PushButton2</tabstop>
508 <tabstop>connectionsView</tabstop>
509 <tabstop>deviceNameLine</tabstop>
510 <tabstop>passkeyLine</tabstop>
511 <tabstop>encCheckBox</tabstop>
512 <tabstop>authCheckBox</tabstop>
513 <tabstop>cryptCheckBox</tabstop>
514 <tabstop>pagescanCheckBox</tabstop>
515 <tabstop>inquiryscanCheckBox</tabstop>
516 <tabstop>configApplyButton</tabstop>
517 <tabstop>rfcommBindButton</tabstop>
518 <tabstop>serDevName</tabstop>
519 <tabstop>serSpeed</tabstop>
520 <tabstop>runButton</tabstop>
521</tabstops>
538</UI> 522</UI>