summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-07-09 13:33:21 (UTC)
committer mickeyl <mickeyl>2005-07-09 13:33:21 (UTC)
commit7bccb3143fbfb4dd70cc22d5233e6275245d0285 (patch) (unidiff)
tree34972468579899cbe3eff62f669217b6fbec112d
parentdf81736967930c523b3c1be163f830e9120b7b27 (diff)
downloadopie-7bccb3143fbfb4dd70cc22d5233e6275245d0285.zip
opie-7bccb3143fbfb4dd70cc22d5233e6275245d0285.tar.gz
opie-7bccb3143fbfb4dd70cc22d5233e6275245d0285.tar.bz2
change the default generated names of Qt Designer to something meaningful
~lart Harlekin for being unbelievable lazy :/ ~lart all other Opie developers for not correcting this when they spotted it...
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp32
-rw-r--r--noncore/net/opietooth/manager/bluetoothbase.ui6
-rw-r--r--noncore/net/opietooth/manager/devicedialog.ui12
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp18
-rw-r--r--noncore/net/opietooth/manager/scandialog.h2
5 files changed, 35 insertions, 35 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 90e44cb..7954cc3 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -22,219 +22,219 @@
22#include "btconnectionitem.h" 22#include "btconnectionitem.h"
23#include "rfcommassigndialogimpl.h" 23#include "rfcommassigndialogimpl.h"
24 24
25/* OPIE */ 25/* OPIE */
26#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
27#include <qpe/resource.h> 27#include <qpe/resource.h>
28#include <qpe/config.h> 28#include <qpe/config.h>
29#include <opie2/odebug.h> 29#include <opie2/odebug.h>
30using namespace Opie::Core; 30using namespace Opie::Core;
31 31
32/* QT */ 32/* QT */
33#include <qframe.h> 33#include <qframe.h>
34#include <qlabel.h> 34#include <qlabel.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qvariant.h> 37#include <qvariant.h>
38#include <qimage.h> 38#include <qimage.h>
39#include <qpixmap.h> 39#include <qpixmap.h>
40#include <qtabwidget.h> 40#include <qtabwidget.h>
41#include <qscrollview.h> 41#include <qscrollview.h>
42#include <qvbox.h> 42#include <qvbox.h>
43#include <qmessagebox.h> 43#include <qmessagebox.h>
44#include <qcheckbox.h> 44#include <qcheckbox.h>
45#include <qlineedit.h> 45#include <qlineedit.h>
46#include <qlistview.h> 46#include <qlistview.h>
47#include <qdir.h> 47#include <qdir.h>
48#include <qpopupmenu.h> 48#include <qpopupmenu.h>
49#include <qtimer.h> 49#include <qtimer.h>
50#include <qlist.h> 50#include <qlist.h>
51 51
52/* STD */ 52/* STD */
53#include <remotedevice.h> 53#include <remotedevice.h>
54#include <services.h> 54#include <services.h>
55#include <stdlib.h> 55#include <stdlib.h>
56 56
57using namespace OpieTooth; 57using namespace OpieTooth;
58 58
59BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 59BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
60 : BluetoothBase( parent, name, fl ) 60 : BluetoothBase( parent, name, fl )
61{ 61{
62 62
63 m_localDevice = new Manager( "hci0" ); 63 m_localDevice = new Manager( "hci0" );
64 64
65 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); 65 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) );
66 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); 66 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) );
67 67
68 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) ); 68 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) );
69 // not good since lib is async 69 // not good since lib is async
70 // connect( ListView2, SIGNAL( expanded(QListViewItem*) ), 70 // connect( devicesView, SIGNAL( expanded(QListViewItem*) ),
71 // this, SLOT( addServicesToDevice(QListViewItem*) ) ); 71 // this, SLOT( addServicesToDevice(QListViewItem*) ) );
72 connect( ListView2, SIGNAL( clicked(QListViewItem*)), 72 connect( devicesView, SIGNAL( clicked(QListViewItem*)),
73 this, SLOT( startServiceActionClicked(QListViewItem*) ) ); 73 this, SLOT( startServiceActionClicked(QListViewItem*) ) );
74 connect( ListView2, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), 74 connect( devicesView, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ),
75 this, SLOT(startServiceActionHold(QListViewItem*,const QPoint&,int) ) ); 75 this, SLOT(startServiceActionHold(QListViewItem*,const QPoint&,int) ) );
76 connect( m_localDevice , SIGNAL( foundServices(const QString&,Services::ValueList) ), 76 connect( m_localDevice , SIGNAL( foundServices(const QString&,Services::ValueList) ),
77 this, SLOT( addServicesToDevice(const QString&,Services::ValueList) ) ); 77 this, SLOT( addServicesToDevice(const QString&,Services::ValueList) ) );
78 connect( m_localDevice, SIGNAL( available(const QString&,bool) ), 78 connect( m_localDevice, SIGNAL( available(const QString&,bool) ),
79 this, SLOT( deviceActive(const QString&,bool) ) ); 79 this, SLOT( deviceActive(const QString&,bool) ) );
80 connect( m_localDevice, SIGNAL( connections(ConnectionState::ValueList) ), 80 connect( m_localDevice, SIGNAL( connections(ConnectionState::ValueList) ),
81 this, SLOT( addConnectedDevices(ConnectionState::ValueList) ) ); 81 this, SLOT( addConnectedDevices(ConnectionState::ValueList) ) );
82 connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ), 82 connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ),
83 this, SLOT( addSignalStrength(const QString&,const QString&) ) ); 83 this, SLOT( addSignalStrength(const QString&,const QString&) ) );
84 84
85 85
86 // let hold be rightButtonClicked() 86 // let hold be rightButtonClicked()
87 QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold); 87 QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold);
88 QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold); 88 QPEApplication::setStylusOperation( connectionsView->viewport(), QPEApplication::RightOnHold);
89 89
90 //Load all icons needed 90 //Load all icons needed
91 m_offPix = Resource::loadPixmap( "opietooth/notconnected" ); 91 m_offPix = Resource::loadPixmap( "opietooth/notconnected" );
92 m_onPix = Resource::loadPixmap( "opietooth/connected" ); 92 m_onPix = Resource::loadPixmap( "opietooth/connected" );
93 m_findPix = Resource::loadPixmap( "opietooth/find" ); 93 m_findPix = Resource::loadPixmap( "opietooth/find" );
94 94
95 QPalette pal = this->palette(); 95 QPalette pal = this->palette();
96 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 96 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
97 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 97 pal.setColor( QPalette::Active, QColorGroup::Button, col );
98 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 98 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
99 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 99 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
100 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 100 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
101 this->setPalette( pal ); 101 this->setPalette( pal );
102 102
103 setCaption( tr( "Bluetooth Manager" ) ); 103 setCaption( tr( "Bluetooth Manager" ) );
104 104
105 readConfig(); 105 readConfig();
106 initGui(); 106 initGui();
107 107
108 ListView2->setRootIsDecorated(true); 108 devicesView->setRootIsDecorated(true);
109 109
110 110
111 writeToHciConfig(); 111 writeToHciConfig();
112 // search conncetions 112 // search conncetions
113 addConnectedDevices(); 113 addConnectedDevices();
114 addSignalStrength(); 114 addSignalStrength();
115 m_iconLoader = new BTIconLoader(); 115 m_iconLoader = new BTIconLoader();
116 readSavedDevices(); 116 readSavedDevices();
117} 117}
118 118
119/** 119/**
120 * Reads all options from the config file 120 * Reads all options from the config file
121 */ 121 */
122void BlueBase::readConfig() 122void BlueBase::readConfig()
123{ 123{
124 124
125 Config cfg( "bluetoothmanager" ); 125 Config cfg( "bluetoothmanager" );
126 cfg.setGroup( "bluezsettings" ); 126 cfg.setGroup( "bluezsettings" );
127 127
128 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with 128 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with
129 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak 129 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak
130 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE ); 130 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE );
131 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE ); 131 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE );
132 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE ); 132 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE );
133 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE ); 133 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE );
134} 134}
135 135
136/** 136/**
137 * Writes all options to the config file 137 * Writes all options to the config file
138 */ 138 */
139void BlueBase::writeConfig() 139void BlueBase::writeConfig()
140{ 140{
141 141
142 Config cfg( "bluetoothmanager" ); 142 Config cfg( "bluetoothmanager" );
143 cfg.setGroup( "bluezsettings" ); 143 cfg.setGroup( "bluezsettings" );
144 144
145 cfg.writeEntry( "name" , m_deviceName ); 145 cfg.writeEntry( "name" , m_deviceName );
146 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey ); 146 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey );
147 cfg.writeEntry( "useEncryption" , m_useEncryption ); 147 cfg.writeEntry( "useEncryption" , m_useEncryption );
148 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification ); 148 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification );
149 cfg.writeEntry( "enablePagescan" , m_enablePagescan ); 149 cfg.writeEntry( "enablePagescan" , m_enablePagescan );
150 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); 150 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan );
151 151
152 writeToHciConfig(); 152 writeToHciConfig();
153} 153}
154 154
155/** 155/**
156 * Modify the hcid.conf file to our needs 156 * Modify the hcid.conf file to our needs
157 */ 157 */
158void BlueBase::writeToHciConfig() 158void BlueBase::writeToHciConfig()
159{ 159{
160 owarn << "writeToHciConfig" << oendl; 160 owarn << "writeToHciConfig" << oendl;
161 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 161 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
162 hciconf.load(); 162 hciconf.load();
163 hciconf.setPinHelper( QPEApplication::qpeDir() + "bin/bluepin" ); 163 hciconf.setPinHelper( QPEApplication::qpeDir() + "bin/bluepin" );
164 hciconf.setName( m_deviceName ); 164 hciconf.setName( m_deviceName );
165 hciconf.setEncrypt( m_useEncryption ); 165 hciconf.setEncrypt( m_useEncryption );
166 hciconf.setAuth( m_enableAuthentification ); 166 hciconf.setAuth( m_enableAuthentification );
167 hciconf.setPscan( m_enablePagescan ); 167 hciconf.setPscan( m_enablePagescan );
168 hciconf.setIscan( m_enableInquiryscan ); 168 hciconf.setIscan( m_enableInquiryscan );
169 hciconf.save(); 169 hciconf.save();
170} 170}
171 171
172 172
173/** 173/**
174 * Read the list of allready known devices 174 * Read the list of allready known devices
175 */ 175 */
176void BlueBase::readSavedDevices() 176void BlueBase::readSavedDevices()
177{ 177{
178 178
179 QValueList<RemoteDevice> loadedDevices; 179 QValueList<RemoteDevice> loadedDevices;
180 DeviceHandler handler; 180 DeviceHandler handler;
181 loadedDevices = handler.load(); 181 loadedDevices = handler.load();
182 182
183 addSearchedDevices( loadedDevices ); 183 addSearchedDevices( loadedDevices );
184} 184}
185 185
186 186
187/** 187/**
188 * Write the list of allready known devices 188 * Write the list of allready known devices
189 */ 189 */
190void BlueBase::writeSavedDevices() 190void BlueBase::writeSavedDevices()
191{ 191{
192 QListViewItemIterator it( ListView2 ); 192 QListViewItemIterator it( devicesView );
193 BTListItem* item; 193 BTListItem* item;
194 BTDeviceItem* device; 194 BTDeviceItem* device;
195 RemoteDevice::ValueList list; 195 RemoteDevice::ValueList list;
196 for ( ; it.current(); ++it ) 196 for ( ; it.current(); ++it )
197 { 197 {
198 item = (BTListItem*)it.current(); 198 item = (BTListItem*)it.current();
199 if(item->typeId() != BTListItem::Device ) 199 if(item->typeId() != BTListItem::Device )
200 continue; 200 continue;
201 device = (BTDeviceItem*)item; 201 device = (BTDeviceItem*)item;
202 202
203 list.append( device->remoteDevice() ); 203 list.append( device->remoteDevice() );
204 } 204 }
205 /* 205 /*
206 * if not empty save the List through DeviceHandler 206 * if not empty save the List through DeviceHandler
207 */ 207 */
208 if ( list.isEmpty() ) 208 if ( list.isEmpty() )
209 return; 209 return;
210 DeviceHandler handler; 210 DeviceHandler handler;
211 handler.save( list ); 211 handler.save( list );
212} 212}
213 213
214 214
215/** 215/**
216 * Set up the gui 216 * Set up the gui
217 */ 217 */
218void BlueBase::initGui() 218void BlueBase::initGui()
219{ 219{
220 StatusLabel->setText( status() ); // maybe move it to getStatus() 220 StatusLabel->setText( status() ); // maybe move it to getStatus()
221 cryptCheckBox->setChecked( m_useEncryption ); 221 cryptCheckBox->setChecked( m_useEncryption );
222 authCheckBox->setChecked( m_enableAuthentification ); 222 authCheckBox->setChecked( m_enableAuthentification );
223 pagescanCheckBox->setChecked( m_enablePagescan ); 223 pagescanCheckBox->setChecked( m_enablePagescan );
224 inquiryscanCheckBox->setChecked( m_enableInquiryscan ); 224 inquiryscanCheckBox->setChecked( m_enableInquiryscan );
225 deviceNameLine->setText( m_deviceName ); 225 deviceNameLine->setText( m_deviceName );
226 passkeyLine->setText( m_defaultPasskey ); 226 passkeyLine->setText( m_defaultPasskey );
227 // set info tab 227 // set info tab
228 setInfo(); 228 setInfo();
229} 229}
230 230
231 231
232/** 232/**
233 * Get the status informations and returns it 233 * Get the status informations and returns it
234 * @return QString the status informations gathered 234 * @return QString the status informations gathered
235 */ 235 */
236QString BlueBase::status()const 236QString BlueBase::status()const
237{ 237{
238 QString infoString = tr( "<b>Device name : </b> Ipaq" ); 238 QString infoString = tr( "<b>Device name : </b> Ipaq" );
239 infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" ); 239 infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" );
240 infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" ); 240 infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" );
@@ -244,97 +244,97 @@ QString BlueBase::status()const
244 244
245 245
246/** 246/**
247 * Read the current values from the gui and invoke writeConfig() 247 * Read the current values from the gui and invoke writeConfig()
248 */ 248 */
249void BlueBase::applyConfigChanges() 249void BlueBase::applyConfigChanges()
250{ 250{
251 m_deviceName = deviceNameLine->text(); 251 m_deviceName = deviceNameLine->text();
252 m_defaultPasskey = passkeyLine->text(); 252 m_defaultPasskey = passkeyLine->text();
253 m_useEncryption = cryptCheckBox->isChecked(); 253 m_useEncryption = cryptCheckBox->isChecked();
254 m_enableAuthentification = authCheckBox->isChecked(); 254 m_enableAuthentification = authCheckBox->isChecked();
255 m_enablePagescan = pagescanCheckBox->isChecked(); 255 m_enablePagescan = pagescanCheckBox->isChecked();
256 m_enableInquiryscan = inquiryscanCheckBox->isChecked(); 256 m_enableInquiryscan = inquiryscanCheckBox->isChecked();
257 257
258 writeConfig(); 258 writeConfig();
259 259
260 QMessageBox::information( this, tr("Test") , tr("Changes were applied.") ); 260 QMessageBox::information( this, tr("Test") , tr("Changes were applied.") );
261} 261}
262 262
263/** 263/**
264 * Launch Rfcomm Bind dialog 264 * Launch Rfcomm Bind dialog
265 * 265 *
266 */ 266 */
267void BlueBase::rfcommDialog() 267void BlueBase::rfcommDialog()
268{ 268{
269 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp ); 269 RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
270 270
271 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted ) 271 if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
272 { 272 {
273 rfcommAssign.saveConfig(); 273 rfcommAssign.saveConfig();
274 } 274 }
275} 275}
276 276
277/** 277/**
278 * Add fresh found devices from scan dialog to the listing 278 * Add fresh found devices from scan dialog to the listing
279 * 279 *
280 */ 280 */
281void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices ) 281void BlueBase::addSearchedDevices( const QValueList<RemoteDevice> &newDevices )
282{ 282{
283 BTDeviceItem * deviceItem; 283 BTDeviceItem * deviceItem;
284 QValueList<RemoteDevice>::ConstIterator it; 284 QValueList<RemoteDevice>::ConstIterator it;
285 285
286 for( it = newDevices.begin(); it != newDevices.end() ; ++it ) 286 for( it = newDevices.begin(); it != newDevices.end() ; ++it )
287 { 287 {
288 288
289 if (find( (*it) )) // is already inserted 289 if (find( (*it) )) // is already inserted
290 continue; 290 continue;
291 291
292 deviceItem = new BTDeviceItem( ListView2 , (*it) ); 292 deviceItem = new BTDeviceItem( devicesView , (*it) );
293 deviceItem->setPixmap( 1, m_findPix ); 293 deviceItem->setPixmap( 1, m_findPix );
294 deviceItem->setExpandable ( true ); 294 deviceItem->setExpandable ( true );
295 295
296 // look if device is avail. atm, async 296 // look if device is avail. atm, async
297 deviceActive( (*it) ); 297 deviceActive( (*it) );
298 298
299 // ggf auch hier? 299 // ggf auch hier?
300 addServicesToDevice( deviceItem ); 300 addServicesToDevice( deviceItem );
301 } 301 }
302} 302}
303 303
304 304
305/** 305/**
306 * Action that is toggled on entrys on click 306 * Action that is toggled on entrys on click
307 */ 307 */
308void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) 308void BlueBase::startServiceActionClicked( QListViewItem */*item*/ )
309{} 309{}
310 310
311 311
312/** 312/**
313 * Action that are toggled on hold (mostly QPopups i guess) 313 * Action that are toggled on hold (mostly QPopups i guess)
314 */ 314 */
315void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) 315void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ )
316{ 316{
317 if (!item ) 317 if (!item )
318 return; 318 return;
319 319
320 QPopupMenu *menu = new QPopupMenu(); 320 QPopupMenu *menu = new QPopupMenu();
321 int ret=0; 321 int ret=0;
322 322
323 if ( ((BTListItem*)item)->type() == "device") 323 if ( ((BTListItem*)item)->type() == "device")
324 { 324 {
325 325
326 QPopupMenu *groups = new QPopupMenu(); 326 QPopupMenu *groups = new QPopupMenu();
327 327
328 menu->insertItem( ((BTDeviceItem*)item)->name(),0 ); 328 menu->insertItem( ((BTDeviceItem*)item)->name(),0 );
329 menu->insertSeparator(1); 329 menu->insertSeparator(1);
330 menu->insertItem( tr("rescan sevices"), 2); 330 menu->insertItem( tr("rescan sevices"), 2);
331 menu->insertItem( tr("to group"), groups , 3); 331 menu->insertItem( tr("to group"), groups , 3);
332 menu->insertItem( tr("delete"), 4); 332 menu->insertItem( tr("delete"), 4);
333 333
334 ret = menu->exec( point , 0); 334 ret = menu->exec( point , 0);
335 335
336 switch(ret) 336 switch(ret)
337 { 337 {
338 case -1: 338 case -1:
339 break; 339 break;
340 case 2: 340 case 2:
@@ -442,249 +442,249 @@ void BlueBase::addServicesToDevice( const QString& device, Services::ValueList s
442 QListViewItem * child = deviceItem->firstChild(); 442 QListViewItem * child = deviceItem->firstChild();
443 while( child ) 443 while( child )
444 { 444 {
445 tempList.append( child ); 445 tempList.append( child );
446 child = child->nextSibling(); 446 child = child->nextSibling();
447 } 447 }
448 tempList.clear(); 448 tempList.clear();
449 449
450 QValueList<OpieTooth::Services>::Iterator it2; 450 QValueList<OpieTooth::Services>::Iterator it2;
451 BTServiceItem* serviceItem; 451 BTServiceItem* serviceItem;
452 452
453 453
454 if (!servicesList.isEmpty() ) 454 if (!servicesList.isEmpty() )
455 { 455 {
456 // add services 456 // add services
457 QMap<int, QString> list; 457 QMap<int, QString> list;
458 QMap<int, QString>::Iterator classIt; 458 QMap<int, QString>::Iterator classIt;
459 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) 459 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 )
460 { 460 {
461 serviceItem = new BTServiceItem( deviceItem, (*it2) ); 461 serviceItem = new BTServiceItem( deviceItem, (*it2) );
462 list = (*it2).classIdList(); 462 list = (*it2).classIdList();
463 classIt = list.begin(); 463 classIt = list.begin();
464 int classId=0; 464 int classId=0;
465 if ( classIt != list.end() ) 465 if ( classIt != list.end() )
466 { 466 {
467 classId = classIt.key(); 467 classId = classIt.key();
468 } 468 }
469 469
470 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) ); 470 serviceItem->setPixmap( 0, m_iconLoader->serviceIcon( classId ) );
471 } 471 }
472 } 472 }
473 else 473 else
474 { 474 {
475 Services s1; 475 Services s1;
476 s1.setServiceName( tr("no services found") ); 476 s1.setServiceName( tr("no services found") );
477 serviceItem = new BTServiceItem( deviceItem, s1 ); 477 serviceItem = new BTServiceItem( deviceItem, s1 );
478 } 478 }
479 // now remove them from the list 479 // now remove them from the list
480 m_deviceList.remove( it ); 480 m_deviceList.remove( it );
481} 481}
482 482
483 483
484 484
485 485
486 486
487void BlueBase::addSignalStrength() 487void BlueBase::addSignalStrength()
488{ 488{
489 489
490 QListViewItemIterator it( ListView4 ); 490 QListViewItemIterator it( connectionsView );
491 for ( ; it.current(); ++it ) 491 for ( ; it.current(); ++it )
492 { 492 {
493 m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() ); 493 m_localDevice->signalStrength( ((BTConnectionItem*)it.current() )->connection().mac() );
494 } 494 }
495 495
496 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) ); 496 QTimer::singleShot( 5000, this, SLOT( addSignalStrength() ) );
497} 497}
498 498
499void BlueBase::addSignalStrength( const QString& mac, const QString& strength ) 499void BlueBase::addSignalStrength( const QString& mac, const QString& strength )
500{ 500{
501 501
502 QListViewItemIterator it( ListView4 ); 502 QListViewItemIterator it( connectionsView );
503 for ( ; it.current(); ++it ) 503 for ( ; it.current(); ++it )
504 { 504 {
505 if( ((BTConnectionItem*)it.current())->connection().mac() == mac ) 505 if( ((BTConnectionItem*)it.current())->connection().mac() == mac )
506 { 506 {
507 ((BTConnectionItem*)it.current() )->setSignalStrength( strength ); 507 ((BTConnectionItem*)it.current() )->setSignalStrength( strength );
508 } 508 }
509 } 509 }
510} 510}
511 511
512/** 512/**
513 * Add the existing connections (pairs) to the connections tab. 513 * Add the existing connections (pairs) to the connections tab.
514 * This one triggers the search 514 * This one triggers the search
515 */ 515 */
516void BlueBase::addConnectedDevices() 516void BlueBase::addConnectedDevices()
517{ 517{
518 m_localDevice->searchConnections(); 518 m_localDevice->searchConnections();
519} 519}
520 520
521/** 521/**
522 * This adds the found connections to the connection tab. 522 * This adds the found connections to the connection tab.
523 * @param connectionList the ValueList with all current connections 523 * @param connectionList the ValueList with all current connections
524 */ 524 */
525void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList ) 525void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
526{ 526{
527 527
528 QValueList<OpieTooth::ConnectionState>::Iterator it; 528 QValueList<OpieTooth::ConnectionState>::Iterator it;
529 BTConnectionItem * connectionItem; 529 BTConnectionItem * connectionItem;
530 530
531 if ( !connectionList.isEmpty() ) 531 if ( !connectionList.isEmpty() )
532 { 532 {
533 533
534 for (it = connectionList.begin(); it != connectionList.end(); ++it) 534 for (it = connectionList.begin(); it != connectionList.end(); ++it)
535 { 535 {
536 536
537 QListViewItemIterator it2( ListView4 ); 537 QListViewItemIterator it2( connectionsView );
538 bool found = false; 538 bool found = false;
539 for ( ; it2.current(); ++it2 ) 539 for ( ; it2.current(); ++it2 )
540 { 540 {
541 if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() ) 541 if( ( (BTConnectionItem*)it2.current())->connection().mac() == (*it).mac() )
542 { 542 {
543 found = true; 543 found = true;
544 } 544 }
545 } 545 }
546 546
547 if ( found == false ) 547 if ( found == false )
548 { 548 {
549 connectionItem = new BTConnectionItem( ListView4, (*it) ); 549 connectionItem = new BTConnectionItem( connectionsView, (*it) );
550 550
551 if( m_deviceList.find((*it).mac()).data() ) 551 if( m_deviceList.find((*it).mac()).data() )
552 { 552 {
553 connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() ); 553 connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() );
554 } 554 }
555 } 555 }
556 556
557 } 557 }
558 558
559 QListViewItemIterator it2( ListView4 ); 559 QListViewItemIterator it2( connectionsView );
560 for ( ; it2.current(); ++it2 ) 560 for ( ; it2.current(); ++it2 )
561 { 561 {
562 bool found = false; 562 bool found = false;
563 for (it = connectionList.begin(); it != connectionList.end(); ++it) 563 for (it = connectionList.begin(); it != connectionList.end(); ++it)
564 { 564 {
565 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) 565 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() )
566 { 566 {
567 found = true; 567 found = true;
568 } 568 }
569 } 569 }
570 570
571 if ( !found ) 571 if ( !found )
572 { 572 {
573 delete it2.current(); 573 delete it2.current();
574 } 574 }
575 575
576 } 576 }
577 577
578 578
579 } 579 }
580 else 580 else
581 { 581 {
582 ListView4->clear(); 582 connectionsView->clear();
583 ConnectionState con; 583 ConnectionState con;
584 con.setMac( tr("No connections found") ); 584 con.setMac( tr("No connections found") );
585 connectionItem = new BTConnectionItem( ListView4 , con ); 585 connectionItem = new BTConnectionItem( connectionsView , con );
586 } 586 }
587 587
588 // recall connection search after some time 588 // recall connection search after some time
589 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) ); 589 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) );
590} 590}
591 591
592 592
593/** 593/**
594 * Find out if a device can currently be reached 594 * Find out if a device can currently be reached
595 * @param device 595 * @param device
596 */ 596 */
597void BlueBase::deviceActive( const RemoteDevice &device ) 597void BlueBase::deviceActive( const RemoteDevice &device )
598{ 598{
599 // search by mac, async, gets a signal back 599 // search by mac, async, gets a signal back
600 // We should have a BTDeviceItem there or where does it get added to the map -zecke 600 // We should have a BTDeviceItem there or where does it get added to the map -zecke
601 m_localDevice->isAvailable( device.mac() ); 601 m_localDevice->isAvailable( device.mac() );
602} 602}
603 603
604 604
605/** 605/**
606 * The signal catcher. Set the avail. status on device. 606 * The signal catcher. Set the avail. status on device.
607 * @param device - the mac address 607 * @param device - the mac address
608 * @param connected - if it is avail. or not 608 * @param connected - if it is avail. or not
609 */ 609 */
610void BlueBase::deviceActive( const QString& device, bool connected ) 610void BlueBase::deviceActive( const QString& device, bool connected )
611{ 611{
612 odebug << "deviceActive slot" << oendl; 612 odebug << "deviceActive slot" << oendl;
613 613
614 QMap<QString,BTDeviceItem*>::Iterator it; 614 QMap<QString,BTDeviceItem*>::Iterator it;
615 615
616 it = m_deviceList.find( device ); 616 it = m_deviceList.find( device );
617 if( it == m_deviceList.end() ) 617 if( it == m_deviceList.end() )
618 return; 618 return;
619 619
620 BTDeviceItem* deviceItem = it.data(); 620 BTDeviceItem* deviceItem = it.data();
621 621
622 622
623 if ( connected ) 623 if ( connected )
624 { 624 {
625 deviceItem->setPixmap( 1, m_onPix ); 625 deviceItem->setPixmap( 1, m_onPix );
626 } 626 }
627 else 627 else
628 { 628 {
629 deviceItem->setPixmap( 1, m_offPix ); 629 deviceItem->setPixmap( 1, m_offPix );
630 } 630 }
631 m_deviceList.remove( it ); 631 m_deviceList.remove( it );
632} 632}
633 633
634 634
635/** 635/**
636 * Open the "scan for devices" dialog 636 * Open the "scan for devices" dialog
637 */ 637 */
638void BlueBase::startScan() 638void BlueBase::startScan()
639{ 639{
640 ScanDialog *scan = new ScanDialog( this, "ScanDialog", 640 ScanDialog *scan = new ScanDialog( this, "ScanDialog",
641 true, WDestructiveClose ); 641 true, WDestructiveClose );
642 QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ), 642 QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ),
643 this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) ); 643 this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) );
644 644
645 QPEApplication::showDialog( scan ); 645 QPEApplication::showDialog( scan );
646} 646}
647 647
648 648
649/** 649/**
650 * Set the informations about the local device in information Tab 650 * Set the informations about the local device in information Tab
651 */ 651 */
652void BlueBase::setInfo() 652void BlueBase::setInfo()
653{ 653{
654 StatusLabel->setText( status() ); 654 StatusLabel->setText( status() );
655} 655}
656 656
657 657
658/** 658/**
659 * Decontructor 659 * Decontructor
660 */ 660 */
661BlueBase::~BlueBase() 661BlueBase::~BlueBase()
662{ 662{
663 writeSavedDevices(); 663 writeSavedDevices();
664 delete m_iconLoader; 664 delete m_iconLoader;
665} 665}
666 666
667 667
668/** 668/**
669 * find searches the ListView for a BTDeviceItem containig 669 * find searches the ListView for a BTDeviceItem containig
670 * the same Device if found return true else false 670 * the same Device if found return true else false
671 * @param dev RemoteDevice to find 671 * @param dev RemoteDevice to find
672 * @return returns true if found 672 * @return returns true if found
673 */ 673 */
674bool BlueBase::find( const RemoteDevice& rem ) 674bool BlueBase::find( const RemoteDevice& rem )
675{ 675{
676 QListViewItemIterator it( ListView2 ); 676 QListViewItemIterator it( devicesView );
677 BTListItem* item; 677 BTListItem* item;
678 BTDeviceItem* device; 678 BTDeviceItem* device;
679 for (; it.current(); ++it ) 679 for (; it.current(); ++it )
680 { 680 {
681 item = (BTListItem*) it.current(); 681 item = (BTListItem*) it.current();
682 if ( item->typeId() != BTListItem::Device ) 682 if ( item->typeId() != BTListItem::Device )
683 continue; 683 continue;
684 684
685 device = (BTDeviceItem*)item; 685 device = (BTDeviceItem*)item;
686 if ( rem.equals( device->remoteDevice() ) ) 686 if ( rem.equals( device->remoteDevice() ) )
687 return true; 687 return true;
688 } 688 }
689 return false; // not found 689 return false; // not found
690} 690}
diff --git a/noncore/net/opietooth/manager/bluetoothbase.ui b/noncore/net/opietooth/manager/bluetoothbase.ui
index 2d14b8f..cbde3c6 100644
--- a/noncore/net/opietooth/manager/bluetoothbase.ui
+++ b/noncore/net/opietooth/manager/bluetoothbase.ui
@@ -1,236 +1,236 @@
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>297</width> 14 <width>293</width>
15 <height>382</height> 15 <height>382</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 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <grid> 28 <grid>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>4</number> 31 <number>4</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>2</number> 35 <number>2</number>
36 </property> 36 </property>
37 <widget row="0" column="0" > 37 <widget row="0" column="0" >
38 <class>QTabWidget</class> 38 <class>QTabWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>Status</cstring> 41 <cstring>Status</cstring>
42 </property> 42 </property>
43 <property> 43 <property>
44 <name>layoutMargin</name> 44 <name>layoutMargin</name>
45 </property> 45 </property>
46 <property> 46 <property>
47 <name>layoutSpacing</name> 47 <name>layoutSpacing</name>
48 </property> 48 </property>
49 <widget> 49 <widget>
50 <class>QWidget</class> 50 <class>QWidget</class>
51 <property stdset="1"> 51 <property stdset="1">
52 <name>name</name> 52 <name>name</name>
53 <cstring>tab</cstring> 53 <cstring>tab</cstring>
54 </property> 54 </property>
55 <attribute> 55 <attribute>
56 <name>title</name> 56 <name>title</name>
57 <string>Devices</string> 57 <string>Devices</string>
58 </attribute> 58 </attribute>
59 <vbox> 59 <vbox>
60 <property stdset="1"> 60 <property stdset="1">
61 <name>margin</name> 61 <name>margin</name>
62 <number>4</number> 62 <number>4</number>
63 </property> 63 </property>
64 <property stdset="1"> 64 <property stdset="1">
65 <name>spacing</name> 65 <name>spacing</name>
66 <number>2</number> 66 <number>2</number>
67 </property> 67 </property>
68 <widget> 68 <widget>
69 <class>QListView</class> 69 <class>QListView</class>
70 <column> 70 <column>
71 <property> 71 <property>
72 <name>text</name> 72 <name>text</name>
73 <string>Device Name</string> 73 <string>Device Name</string>
74 </property> 74 </property>
75 <property> 75 <property>
76 <name>clickable</name> 76 <name>clickable</name>
77 <bool>true</bool> 77 <bool>true</bool>
78 </property> 78 </property>
79 <property> 79 <property>
80 <name>resizeable</name> 80 <name>resizeable</name>
81 <bool>true</bool> 81 <bool>true</bool>
82 </property> 82 </property>
83 </column> 83 </column>
84 <column> 84 <column>
85 <property> 85 <property>
86 <name>text</name> 86 <name>text</name>
87 <string>Online</string> 87 <string>Online</string>
88 </property> 88 </property>
89 <property> 89 <property>
90 <name>clickable</name> 90 <name>clickable</name>
91 <bool>true</bool> 91 <bool>true</bool>
92 </property> 92 </property>
93 <property> 93 <property>
94 <name>resizeable</name> 94 <name>resizeable</name>
95 <bool>true</bool> 95 <bool>true</bool>
96 </property> 96 </property>
97 </column> 97 </column>
98 <property stdset="1"> 98 <property stdset="1">
99 <name>name</name> 99 <name>name</name>
100 <cstring>ListView2</cstring> 100 <cstring>devicesView</cstring>
101 </property> 101 </property>
102 </widget> 102 </widget>
103 <widget> 103 <widget>
104 <class>QPushButton</class> 104 <class>QPushButton</class>
105 <property stdset="1"> 105 <property stdset="1">
106 <name>name</name> 106 <name>name</name>
107 <cstring>PushButton2</cstring> 107 <cstring>PushButton2</cstring>
108 </property> 108 </property>
109 <property stdset="1"> 109 <property stdset="1">
110 <name>sizePolicy</name> 110 <name>sizePolicy</name>
111 <sizepolicy> 111 <sizepolicy>
112 <hsizetype>0</hsizetype> 112 <hsizetype>0</hsizetype>
113 <vsizetype>0</vsizetype> 113 <vsizetype>0</vsizetype>
114 </sizepolicy> 114 </sizepolicy>
115 </property> 115 </property>
116 <property stdset="1"> 116 <property stdset="1">
117 <name>text</name> 117 <name>text</name>
118 <string>&amp;Rescan Devices</string> 118 <string>&amp;Rescan Devices</string>
119 </property> 119 </property>
120 </widget> 120 </widget>
121 </vbox> 121 </vbox>
122 </widget> 122 </widget>
123 <widget> 123 <widget>
124 <class>QWidget</class> 124 <class>QWidget</class>
125 <property stdset="1"> 125 <property stdset="1">
126 <name>name</name> 126 <name>name</name>
127 <cstring>tab</cstring> 127 <cstring>tab</cstring>
128 </property> 128 </property>
129 <attribute> 129 <attribute>
130 <name>title</name> 130 <name>title</name>
131 <string>Connections</string> 131 <string>Connections</string>
132 </attribute> 132 </attribute>
133 <vbox> 133 <vbox>
134 <property stdset="1"> 134 <property stdset="1">
135 <name>margin</name> 135 <name>margin</name>
136 <number>4</number> 136 <number>4</number>
137 </property> 137 </property>
138 <property stdset="1"> 138 <property stdset="1">
139 <name>spacing</name> 139 <name>spacing</name>
140 <number>2</number> 140 <number>2</number>
141 </property> 141 </property>
142 <widget> 142 <widget>
143 <class>QListView</class> 143 <class>QListView</class>
144 <column> 144 <column>
145 <property> 145 <property>
146 <name>text</name> 146 <name>text</name>
147 <string>Device Name</string> 147 <string>Device Name</string>
148 </property> 148 </property>
149 <property> 149 <property>
150 <name>clickable</name> 150 <name>clickable</name>
151 <bool>true</bool> 151 <bool>true</bool>
152 </property> 152 </property>
153 <property> 153 <property>
154 <name>resizeable</name> 154 <name>resizeable</name>
155 <bool>true</bool> 155 <bool>true</bool>
156 </property> 156 </property>
157 </column> 157 </column>
158 <column> 158 <column>
159 <property> 159 <property>
160 <name>text</name> 160 <name>text</name>
161 <string>Connection type</string> 161 <string>Connection type</string>
162 </property> 162 </property>
163 <property> 163 <property>
164 <name>clickable</name> 164 <name>clickable</name>
165 <bool>true</bool> 165 <bool>true</bool>
166 </property> 166 </property>
167 <property> 167 <property>
168 <name>resizeable</name> 168 <name>resizeable</name>
169 <bool>true</bool> 169 <bool>true</bool>
170 </property> 170 </property>
171 </column> 171 </column>
172 <column> 172 <column>
173 <property> 173 <property>
174 <name>text</name> 174 <name>text</name>
175 <string>Signal</string> 175 <string>Signal</string>
176 </property> 176 </property>
177 <property> 177 <property>
178 <name>clickable</name> 178 <name>clickable</name>
179 <bool>true</bool> 179 <bool>true</bool>
180 </property> 180 </property>
181 <property> 181 <property>
182 <name>resizeable</name> 182 <name>resizeable</name>
183 <bool>true</bool> 183 <bool>true</bool>
184 </property> 184 </property>
185 </column> 185 </column>
186 <property stdset="1"> 186 <property stdset="1">
187 <name>name</name> 187 <name>name</name>
188 <cstring>ListView4</cstring> 188 <cstring>connectionsView</cstring>
189 </property> 189 </property>
190 </widget> 190 </widget>
191 </vbox> 191 </vbox>
192 </widget> 192 </widget>
193 <widget> 193 <widget>
194 <class>QWidget</class> 194 <class>QWidget</class>
195 <property stdset="1"> 195 <property stdset="1">
196 <name>name</name> 196 <name>name</name>
197 <cstring>tab</cstring> 197 <cstring>tab</cstring>
198 </property> 198 </property>
199 <attribute> 199 <attribute>
200 <name>title</name> 200 <name>title</name>
201 <string>Config</string> 201 <string>Config</string>
202 </attribute> 202 </attribute>
203 <grid> 203 <grid>
204 <property stdset="1"> 204 <property stdset="1">
205 <name>margin</name> 205 <name>margin</name>
206 <number>4</number> 206 <number>4</number>
207 </property> 207 </property>
208 <property stdset="1"> 208 <property stdset="1">
209 <name>spacing</name> 209 <name>spacing</name>
210 <number>2</number> 210 <number>2</number>
211 </property> 211 </property>
212 <widget row="1" column="0" > 212 <widget row="1" column="0" >
213 <class>QPushButton</class> 213 <class>QPushButton</class>
214 <property stdset="1"> 214 <property stdset="1">
215 <name>name</name> 215 <name>name</name>
216 <cstring>rfcommBindButton</cstring> 216 <cstring>rfcommBindButton</cstring>
217 </property> 217 </property>
218 <property stdset="1"> 218 <property stdset="1">
219 <name>text</name> 219 <name>text</name>
220 <string>&amp;Edit RFCOMM Bind Table</string> 220 <string>&amp;Edit RFCOMM Bind Table</string>
221 </property> 221 </property>
222 </widget> 222 </widget>
223 <widget row="0" column="0" > 223 <widget row="0" column="0" >
224 <class>QGroupBox</class> 224 <class>QGroupBox</class>
225 <property stdset="1"> 225 <property stdset="1">
226 <name>name</name> 226 <name>name</name>
227 <cstring>GroupBox1</cstring> 227 <cstring>GroupBox1</cstring>
228 </property> 228 </property>
229 <property stdset="1"> 229 <property stdset="1">
230 <name>title</name> 230 <name>title</name>
231 <string>Bluetooth Basic Config</string> 231 <string>Bluetooth Basic Config</string>
232 </property> 232 </property>
233 <property> 233 <property>
234 <name>layoutMargin</name> 234 <name>layoutMargin</name>
235 </property> 235 </property>
236 <property> 236 <property>
diff --git a/noncore/net/opietooth/manager/devicedialog.ui b/noncore/net/opietooth/manager/devicedialog.ui
index 2ecfd4c..f5cd9ab 100644
--- a/noncore/net/opietooth/manager/devicedialog.ui
+++ b/noncore/net/opietooth/manager/devicedialog.ui
@@ -1,229 +1,229 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>DeviceDialog</class> 2<class>DeviceDialog</class>
3<widget> 3<widget>
4 <class>QDialog</class> 4 <class>QDialog</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>DeviceDialog</cstring> 7 <cstring>DeviceDialog</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>275</width> 14 <width>267</width>
15 <height>323</height> 15 <height>323</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Form2</string> 20 <string>Form2</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <grid> 28 <grid>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>6</number> 31 <number>6</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>3</number> 35 <number>3</number>
36 </property> 36 </property>
37 <widget row="0" column="0" > 37 <widget row="0" column="0" >
38 <class>QTabWidget</class> 38 <class>QTabWidget</class>
39 <property stdset="1"> 39 <property stdset="1">
40 <name>name</name> 40 <name>name</name>
41 <cstring>TabWidget7</cstring> 41 <cstring>TabWidget7</cstring>
42 </property> 42 </property>
43 <property> 43 <property>
44 <name>layoutMargin</name> 44 <name>layoutMargin</name>
45 </property> 45 </property>
46 <property> 46 <property>
47 <name>layoutSpacing</name> 47 <name>layoutSpacing</name>
48 </property> 48 </property>
49 <widget> 49 <widget>
50 <class>QWidget</class> 50 <class>QWidget</class>
51 <property stdset="1"> 51 <property stdset="1">
52 <name>name</name> 52 <name>name</name>
53 <cstring>tab</cstring> 53 <cstring>tab</cstring>
54 </property> 54 </property>
55 <attribute> 55 <attribute>
56 <name>title</name> 56 <name>title</name>
57 <string>Services</string> 57 <string>Services</string>
58 </attribute> 58 </attribute>
59 <grid> 59 <grid>
60 <property stdset="1"> 60 <property stdset="1">
61 <name>margin</name> 61 <name>margin</name>
62 <number>4</number> 62 <number>4</number>
63 </property> 63 </property>
64 <property stdset="1"> 64 <property stdset="1">
65 <name>spacing</name> 65 <name>spacing</name>
66 <number>3</number> 66 <number>3</number>
67 </property> 67 </property>
68 <widget row="1" column="0" > 68 <widget row="1" column="0" >
69 <class>QPushButton</class> 69 <class>QPushButton</class>
70 <property stdset="1"> 70 <property stdset="1">
71 <name>name</name> 71 <name>name</name>
72 <cstring>PushButton5</cstring> 72 <cstring>applyChanges</cstring>
73 </property> 73 </property>
74 <property stdset="1"> 74 <property stdset="1">
75 <name>text</name> 75 <name>text</name>
76 <string>&amp;Apply Changes</string> 76 <string>&amp;Apply Changes</string>
77 </property> 77 </property>
78 </widget> 78 </widget>
79 <widget row="0" column="0" > 79 <widget row="0" column="0" >
80 <class>QListView</class> 80 <class>QListView</class>
81 <column> 81 <column>
82 <property> 82 <property>
83 <name>text</name> 83 <name>text</name>
84 <string>active</string> 84 <string>active</string>
85 </property> 85 </property>
86 <property> 86 <property>
87 <name>clickable</name> 87 <name>clickable</name>
88 <bool>true</bool> 88 <bool>true</bool>
89 </property> 89 </property>
90 <property> 90 <property>
91 <name>resizeable</name> 91 <name>resizeable</name>
92 <bool>true</bool> 92 <bool>true</bool>
93 </property> 93 </property>
94 </column> 94 </column>
95 <column> 95 <column>
96 <property> 96 <property>
97 <name>text</name> 97 <name>text</name>
98 <string>service name</string> 98 <string>service name</string>
99 </property> 99 </property>
100 <property> 100 <property>
101 <name>clickable</name> 101 <name>clickable</name>
102 <bool>true</bool> 102 <bool>true</bool>
103 </property> 103 </property>
104 <property> 104 <property>
105 <name>resizeable</name> 105 <name>resizeable</name>
106 <bool>true</bool> 106 <bool>true</bool>
107 </property> 107 </property>
108 </column> 108 </column>
109 <property stdset="1"> 109 <property stdset="1">
110 <name>name</name> 110 <name>name</name>
111 <cstring>ListView1</cstring> 111 <cstring>serviceView</cstring>
112 </property> 112 </property>
113 </widget> 113 </widget>
114 </grid> 114 </grid>
115 </widget> 115 </widget>
116 <widget> 116 <widget>
117 <class>QWidget</class> 117 <class>QWidget</class>
118 <property stdset="1"> 118 <property stdset="1">
119 <name>name</name> 119 <name>name</name>
120 <cstring>tab</cstring> 120 <cstring>tab</cstring>
121 </property> 121 </property>
122 <attribute> 122 <attribute>
123 <name>title</name> 123 <name>title</name>
124 <string>Settings</string> 124 <string>Settings</string>
125 </attribute> 125 </attribute>
126 <grid> 126 <grid>
127 <property stdset="1"> 127 <property stdset="1">
128 <name>margin</name> 128 <name>margin</name>
129 <number>4</number> 129 <number>4</number>
130 </property> 130 </property>
131 <property stdset="1"> 131 <property stdset="1">
132 <name>spacing</name> 132 <name>spacing</name>
133 <number>3</number> 133 <number>3</number>
134 </property> 134 </property>
135 <widget row="1" column="0" > 135 <widget row="1" column="0" >
136 <class>QLabel</class> 136 <class>QLabel</class>
137 <property stdset="1"> 137 <property stdset="1">
138 <name>name</name> 138 <name>name</name>
139 <cstring>TextLabel8</cstring> 139 <cstring>TextLabel8</cstring>
140 </property> 140 </property>
141 <property stdset="1"> 141 <property stdset="1">
142 <name>text</name> 142 <name>text</name>
143 <string>Default PIN Code</string> 143 <string>Default PIN Code</string>
144 </property> 144 </property>
145 </widget> 145 </widget>
146 <widget row="1" column="1" > 146 <widget row="1" column="1" >
147 <class>QLineEdit</class> 147 <class>QLineEdit</class>
148 <property stdset="1"> 148 <property stdset="1">
149 <name>name</name> 149 <name>name</name>
150 <cstring>LineEdit6</cstring> 150 <cstring>defaultPinCode</cstring>
151 </property> 151 </property>
152 </widget> 152 </widget>
153 <widget row="0" column="1" > 153 <widget row="0" column="1" >
154 <class>QLineEdit</class> 154 <class>QLineEdit</class>
155 <property stdset="1"> 155 <property stdset="1">
156 <name>name</name> 156 <name>name</name>
157 <cstring>LineEdit1</cstring> 157 <cstring>deviceName</cstring>
158 </property> 158 </property>
159 </widget> 159 </widget>
160 <widget row="0" column="0" > 160 <widget row="0" column="0" >
161 <class>QLabel</class> 161 <class>QLabel</class>
162 <property stdset="1"> 162 <property stdset="1">
163 <name>name</name> 163 <name>name</name>
164 <cstring>TextLabel5</cstring> 164 <cstring>TextLabel5</cstring>
165 </property> 165 </property>
166 <property stdset="1"> 166 <property stdset="1">
167 <name>text</name> 167 <name>text</name>
168 <string>Change device name</string> 168 <string>Change device name</string>
169 </property> 169 </property>
170 </widget> 170 </widget>
171 <spacer row="2" column="0" > 171 <spacer row="2" column="0" >
172 <property> 172 <property>
173 <name>name</name> 173 <name>name</name>
174 <cstring>Spacer1</cstring> 174 <cstring>Spacer1</cstring>
175 </property> 175 </property>
176 <property stdset="1"> 176 <property stdset="1">
177 <name>orientation</name> 177 <name>orientation</name>
178 <enum>Vertical</enum> 178 <enum>Vertical</enum>
179 </property> 179 </property>
180 <property stdset="1"> 180 <property stdset="1">
181 <name>sizeType</name> 181 <name>sizeType</name>
182 <enum>Expanding</enum> 182 <enum>Expanding</enum>
183 </property> 183 </property>
184 <property> 184 <property>
185 <name>sizeHint</name> 185 <name>sizeHint</name>
186 <size> 186 <size>
187 <width>20</width> 187 <width>20</width>
188 <height>20</height> 188 <height>20</height>
189 </size> 189 </size>
190 </property> 190 </property>
191 </spacer> 191 </spacer>
192 </grid> 192 </grid>
193 </widget> 193 </widget>
194 <widget> 194 <widget>
195 <class>QWidget</class> 195 <class>QWidget</class>
196 <property stdset="1"> 196 <property stdset="1">
197 <name>name</name> 197 <name>name</name>
198 <cstring>tab</cstring> 198 <cstring>tab</cstring>
199 </property> 199 </property>
200 <attribute> 200 <attribute>
201 <name>title</name> 201 <name>title</name>
202 <string>Information</string> 202 <string>Information</string>
203 </attribute> 203 </attribute>
204 <grid> 204 <grid>
205 <property stdset="1"> 205 <property stdset="1">
206 <name>margin</name> 206 <name>margin</name>
207 <number>4</number> 207 <number>4</number>
208 </property> 208 </property>
209 <property stdset="1"> 209 <property stdset="1">
210 <name>spacing</name> 210 <name>spacing</name>
211 <number>2</number> 211 <number>2</number>
212 </property> 212 </property>
213 <widget row="0" column="0" > 213 <widget row="0" column="0" >
214 <class>QLabel</class> 214 <class>QLabel</class>
215 <property stdset="1"> 215 <property stdset="1">
216 <name>name</name> 216 <name>name</name>
217 <cstring>DeviceInfoLabel</cstring> 217 <cstring>deviceInfoLabel</cstring>
218 </property> 218 </property>
219 <property stdset="1"> 219 <property stdset="1">
220 <name>text</name> 220 <name>text</name>
221 <string>TextLabel9</string> 221 <string>TextLabel9</string>
222 </property> 222 </property>
223 </widget> 223 </widget>
224 </grid> 224 </grid>
225 </widget> 225 </widget>
226 </widget> 226 </widget>
227 </grid> 227 </grid>
228</widget> 228</widget>
229</UI> 229</UI>
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index bccc6c2..160e8dd 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -11,154 +11,154 @@
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 18
19#include "scandialog.h" 19#include "scandialog.h"
20 20
21#include <qheader.h> 21#include <qheader.h>
22#include <qlistview.h> 22#include <qlistview.h>
23#include <qpushbutton.h> 23#include <qpushbutton.h>
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qvariant.h> 25#include <qvariant.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qwhatsthis.h> 27#include <qwhatsthis.h>
28#include <qprogressbar.h> 28#include <qprogressbar.h>
29#include <qlist.h> 29#include <qlist.h>
30 30
31#include <manager.h> 31#include <manager.h>
32#include <device.h> 32#include <device.h>
33 33
34#include <opie2/odebug.h> 34#include <opie2/odebug.h>
35using namespace Opie::Core; 35using namespace Opie::Core;
36 36
37 37
38namespace OpieTooth { 38namespace OpieTooth {
39 39
40#include <remotedevice.h> 40#include <remotedevice.h>
41 41
42/** 42/**
43 */ 43 */
44 ScanDialog::ScanDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 44 ScanDialog::ScanDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
45 : QDialog( parent, name, modal, fl ) { 45 : QDialog( parent, name, modal, fl ) {
46 46
47 setCaption( tr( "Scan for devices" ) ); 47 setCaption( tr( "Scan for devices" ) );
48 48
49 Layout11 = new QVBoxLayout( this ); 49 Layout11 = new QVBoxLayout( this );
50 Layout11->setSpacing( 6 ); 50 Layout11->setSpacing( 6 );
51 Layout11->setMargin( 0 ); 51 Layout11->setMargin( 0 );
52 52
53 progress = new QProgressBar( this, "progbar"); 53 progress = new QProgressBar( this, "progbar");
54 progress->setTotalSteps(20); 54 progress->setTotalSteps(20);
55 55
56 StartStopButton = new QPushButton( this, "StartButton" ); 56 StartStopButton = new QPushButton( this, "StartButton" );
57 StartStopButton->setText( tr( "Start scan" ) ); 57 StartStopButton->setText( tr( "Start scan" ) );
58 58
59 ListView1 = new QListView( this, "ListView1" ); 59 serviceView = new QListView( this, "serviceView" );
60 60
61 //ListView1->addColumn( tr( "Add" ) ); 61 //serviceView->addColumn( tr( "Add" ) );
62 ListView1->addColumn( tr( "Add Device" ) ); 62 serviceView->addColumn( tr( "Add Device" ) );
63 //ListView1->addColumn( tr( "Type" ) ); 63 //serviceView->addColumn( tr( "Type" ) );
64 64
65 Layout11->addWidget( ListView1 ); 65 Layout11->addWidget( serviceView );
66 Layout11->addWidget( progress ); 66 Layout11->addWidget( progress );
67 Layout11->addWidget( StartStopButton ); 67 Layout11->addWidget( StartStopButton );
68 68
69 localDevice = new Manager( "hci0" ); 69 localDevice = new Manager( "hci0" );
70 70
71 connect( StartStopButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) ); 71 connect( StartStopButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) );
72 connect( localDevice, SIGNAL( foundDevices(const QString&,RemoteDevice::ValueList) ), 72 connect( localDevice, SIGNAL( foundDevices(const QString&,RemoteDevice::ValueList) ),
73 this, SLOT( fillList(const QString&,RemoteDevice::ValueList) ) ) ; 73 this, SLOT( fillList(const QString&,RemoteDevice::ValueList) ) ) ;
74 74
75 progressStat = 0; 75 progressStat = 0;
76 m_search = false; 76 m_search = false;
77 } 77 }
78 78
79// hack, make cleaner later 79// hack, make cleaner later
80 void ScanDialog::progressTimer() { 80 void ScanDialog::progressTimer() {
81 81
82 progressStat++; 82 progressStat++;
83 if ( progressStat++ < 20 && m_search ) { 83 if ( progressStat++ < 20 && m_search ) {
84 QTimer::singleShot( 2000, this, SLOT( progressTimer() ) ); 84 QTimer::singleShot( 2000, this, SLOT( progressTimer() ) );
85 progress->setProgress( progressStat++ ); 85 progress->setProgress( progressStat++ );
86 } 86 }
87 } 87 }
88 88
89 void ScanDialog::accept() { 89 void ScanDialog::accept() {
90 emitToManager(); 90 emitToManager();
91 QDialog::accept(); 91 QDialog::accept();
92 } 92 }
93 93
94 94
95 void ScanDialog::startSearch() { 95 void ScanDialog::startSearch() {
96 if ( m_search ) { 96 if ( m_search ) {
97 stopSearch(); 97 stopSearch();
98 return; 98 return;
99 } 99 }
100 m_search = true; 100 m_search = true;
101 progress->setProgress(0); 101 progress->setProgress(0);
102 progressStat = 0; 102 progressStat = 0;
103 103
104 // empty list before a new scan 104 // empty list before a new scan
105 ListView1->clear(); 105 serviceView->clear();
106 106
107 progressTimer(); 107 progressTimer();
108 // when finished, it emmite foundDevices() 108 // when finished, it emmite foundDevices()
109 // checken ob initialisiert , qcop ans applet. 109 // checken ob initialisiert , qcop ans applet.
110 StartStopButton->setText( tr( "Stop scan" ) ); 110 StartStopButton->setText( tr( "Stop scan" ) );
111 111
112 localDevice->searchDevices(); 112 localDevice->searchDevices();
113 113
114 } 114 }
115 115
116 void ScanDialog::stopSearch() { 116 void ScanDialog::stopSearch() {
117 m_search = true; 117 m_search = true;
118 } 118 }
119 119
120 void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) { 120 void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) {
121 progress->setProgress(0); 121 progress->setProgress(0);
122 progressStat = 0; 122 progressStat = 0;
123 QCheckListItem * deviceItem; 123 QCheckListItem * deviceItem;
124 124
125 RemoteDevice::ValueList::Iterator it; 125 RemoteDevice::ValueList::Iterator it;
126 for( it = deviceList.begin(); it != deviceList.end(); ++it ) { 126 for( it = deviceList.begin(); it != deviceList.end(); ++it ) {
127 127
128 deviceItem = new QCheckListItem( ListView1, (*it).name(), QCheckListItem::CheckBox ); 128 deviceItem = new QCheckListItem( serviceView, (*it).name(), QCheckListItem::CheckBox );
129 deviceItem->setText( 1, (*it).mac() ); 129 deviceItem->setText( 1, (*it).mac() );
130 } 130 }
131 m_search = false; 131 m_search = false;
132 StartStopButton->setText( tr( "Start scan" ) ); 132 StartStopButton->setText( tr( "Start scan" ) );
133 } 133 }
134 134
135/** 135/**
136 * Iterates trough the items, and collects the checked items. 136 * Iterates trough the items, and collects the checked items.
137 * Then it emits it, so the manager can connect to the signal to fill the listing. 137 * Then it emits it, so the manager can connect to the signal to fill the listing.
138 */ 138 */
139 void ScanDialog::emitToManager() { 139 void ScanDialog::emitToManager() {
140 140
141 if (!ListView1) { 141 if (!serviceView) {
142 return; 142 return;
143 } 143 }
144 144
145 QValueList<RemoteDevice> deviceList; 145 QValueList<RemoteDevice> deviceList;
146 146
147 QListViewItemIterator it( ListView1 ); 147 QListViewItemIterator it( serviceView );
148 for ( ; it.current(); ++it ) { 148 for ( ; it.current(); ++it ) {
149 if ( ( (QCheckListItem*)it.current() )->isOn() ) { 149 if ( ( (QCheckListItem*)it.current() )->isOn() ) {
150 RemoteDevice device( it.current()->text(1), it.current()->text(0) ); 150 RemoteDevice device( it.current()->text(1), it.current()->text(0) );
151 deviceList.append( device ); 151 deviceList.append( device );
152 } 152 }
153 } 153 }
154 emit selectedDevices( deviceList ); 154 emit selectedDevices( deviceList );
155 } 155 }
156 156
157/** 157/**
158 * Cleanup 158 * Cleanup
159 */ 159 */
160 ScanDialog::~ScanDialog() { 160 ScanDialog::~ScanDialog() {
161 owarn << "delete scan dialog" << oendl; 161 owarn << "delete scan dialog" << oendl;
162 delete localDevice; 162 delete localDevice;
163 } 163 }
164} 164}
diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h
index a644e96..2b04964 100644
--- a/noncore/net/opietooth/manager/scandialog.h
+++ b/noncore/net/opietooth/manager/scandialog.h
@@ -1,76 +1,76 @@
1/* main.cpp 1/* main.cpp
2 * 2 *
3 * copyright : (c) 2002 by Maximilian Reiß 3 * copyright : (c) 2002 by Maximilian Reiß
4 * email : max.reiss@gmx.de 4 * email : max.reiss@gmx.de
5 * 5 *
6 */ 6 */
7/*************************************************************************** 7/***************************************************************************
8 * * 8 * *
9 * This program is free software; you can redistribute it and/or modify * 9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by * 10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or * 11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. * 12 * (at your option) any later version. *
13 * * 13 * *
14 ***************************************************************************/ 14 ***************************************************************************/
15 15
16 16
17#ifndef SCANDIALOG_H 17#ifndef SCANDIALOG_H
18#define SCANDIALOG_H 18#define SCANDIALOG_H
19 19
20#include <qvariant.h> 20#include <qvariant.h>
21#include <qdialog.h> 21#include <qdialog.h>
22#include <qlist.h> 22#include <qlist.h>
23 23
24#include <remotedevice.h> 24#include <remotedevice.h>
25class QVBoxLayout; 25class QVBoxLayout;
26class QGridLayout; 26class QGridLayout;
27class QLabel; 27class QLabel;
28class QListView; 28class QListView;
29class QListViewItem; 29class QListViewItem;
30class QPushButton; 30class QPushButton;
31class QProgressBar; 31class QProgressBar;
32 32
33 33
34namespace OpieTooth { 34namespace OpieTooth {
35 35
36class Manager; 36class Manager;
37class Device; 37class Device;
38 38
39 class ScanDialog : public QDialog { 39 class ScanDialog : public QDialog {
40 Q_OBJECT 40 Q_OBJECT
41 41
42 public: 42 public:
43 ScanDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 43 ScanDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
44 ~ScanDialog(); 44 ~ScanDialog();
45 45
46 private: 46 private:
47 QProgressBar* progress; 47 QProgressBar* progress;
48 QPushButton* StartStopButton; 48 QPushButton* StartStopButton;
49 QListView* ListView1; 49 QListView* serviceView;
50 50
51 public slots: 51 public slots:
52 void accept(); 52 void accept();
53 53
54 protected: 54 protected:
55 QVBoxLayout* Layout11; 55 QVBoxLayout* Layout11;
56 56
57 private slots: 57 private slots:
58 void stopSearch(); 58 void stopSearch();
59 void startSearch(); 59 void startSearch();
60 void progressTimer(); 60 void progressTimer();
61 void fillList( const QString& device, RemoteDevice::ValueList list ); 61 void fillList( const QString& device, RemoteDevice::ValueList list );
62 62
63 private: 63 private:
64 bool m_search:1; 64 bool m_search:1;
65 void emitToManager(); 65 void emitToManager();
66 Manager *localDevice; 66 Manager *localDevice;
67 int progressStat; 67 int progressStat;
68 68
69 signals: 69 signals:
70 void selectedDevices( const QValueList<RemoteDevice>& ); 70 void selectedDevices( const QValueList<RemoteDevice>& );
71 }; 71 };
72 72
73 73
74} 74}
75 75
76#endif // SCANDIALOG_H 76#endif // SCANDIALOG_H