summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth
Unidiff
Diffstat (limited to 'noncore/net/opietooth') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/startdunconnection.cpp8
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.cpp16
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp32
-rw-r--r--noncore/net/opietooth/manager/obexdialog.cpp2
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp6
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp4
6 files changed, 34 insertions, 34 deletions
diff --git a/noncore/net/opietooth/lib/startdunconnection.cpp b/noncore/net/opietooth/lib/startdunconnection.cpp
index 6b6d247..c3850eb 100644
--- a/noncore/net/opietooth/lib/startdunconnection.cpp
+++ b/noncore/net/opietooth/lib/startdunconnection.cpp
@@ -1,67 +1,67 @@
1 1
2#include "startdunconnection.h" 2#include "startdunconnection.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6 6
7StartDunConnection::StartDunConnection() { 7StartDunConnection::StartDunConnection() {
8 m_dunConnect = 0l; 8 m_dunConnect = 0l;
9 setConnectionType(); 9 setConnectionType();
10} 10}
11 11
12StartDunConnection::~StartDunConnection() { 12StartDunConnection::~StartDunConnection() {
13 delete m_dunConnect; 13 delete m_dunConnect;
14} 14}
15 15
16StartDunConnection::StartDunConnection( QString mac ) { 16StartDunConnection::StartDunConnection( QString mac ) {
17 m_dunConnect = 0l; 17 m_dunConnect = 0l;
18 m_mac = mac; 18 m_mac = mac;
19 setConnectionType(); 19 setConnectionType();
20} 20}
21 21
22void StartDunConnection::setName( QString name ) { 22void StartDunConnection::setName( QString name ) {
23 m_name = name; 23 m_name = name;
24} 24}
25 25
26QString StartDunConnection::name() { 26QString StartDunConnection::name() {
27 return m_name; 27 return m_name;
28} 28}
29 29
30void StartDunConnection::setConnectionType() { 30void StartDunConnection::setConnectionType() {
31 m_connectionType = Pan; 31 m_connectionType = Pan;
32} 32}
33 33
34StartConnection::ConnectionType StartDunConnection::type() { 34StartConnection::ConnectionType StartDunConnection::type() {
35 return m_connectionType; 35 return m_connectionType;
36} 36}
37 37
38void StartDunConnection::start() { 38void StartDunConnection::start() {
39 m_dunConnect = new OProcess(); 39 m_dunConnect = new OProcess();
40 *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac; 40 *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac;
41 41
42 connect( m_dunConnect, SIGNAL( processExited( OProcess* ) ) , 42 connect( m_dunConnect, SIGNAL( processExited(OProcess*) ) ,
43 this, SLOT( slotExited( OProcess* ) ) ); 43 this, SLOT( slotExited(OProcess*) ) );
44 connect( m_dunConnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ), 44 connect( m_dunConnect, SIGNAL( receivedStdout(OProcess*,char*,int) ),
45 this, SLOT( slotStdOut( OProcess*, char*, int ) ) ); 45 this, SLOT( slotStdOut(OProcess*,char*,int) ) );
46 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 46 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
47 qWarning( "could not start" ); 47 qWarning( "could not start" );
48 delete m_dunConnect; 48 delete m_dunConnect;
49 } 49 }
50} 50}
51 51
52 52
53void StartDunConnection::slotExited( OProcess* proc ) { 53void StartDunConnection::slotExited( OProcess* proc ) {
54 delete m_dunConnect; 54 delete m_dunConnect;
55} 55}
56 56
57void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len) 57void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len)
58{} 58{}
59 59
60 60
61void StartDunConnection::stop() { 61void StartDunConnection::stop() {
62 if ( m_dunConnect ) { 62 if ( m_dunConnect ) {
63 delete m_dunConnect; 63 delete m_dunConnect;
64 m_dunConnect = 0l; 64 m_dunConnect = 0l;
65 } 65 }
66} 66}
67 67
diff --git a/noncore/net/opietooth/lib/startpanconnection.cpp b/noncore/net/opietooth/lib/startpanconnection.cpp
index 6e0ab7e..a42b407 100644
--- a/noncore/net/opietooth/lib/startpanconnection.cpp
+++ b/noncore/net/opietooth/lib/startpanconnection.cpp
@@ -1,82 +1,82 @@
1 1
2#include "startpanconnection.h" 2#include "startpanconnection.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6 6
7StartPanConnection::StartPanConnection() { 7StartPanConnection::StartPanConnection() {
8 m_panConnect = 0l; 8 m_panConnect = 0l;
9 setConnectionType(); 9 setConnectionType();
10} 10}
11 11
12StartPanConnection::~StartPanConnection() { 12StartPanConnection::~StartPanConnection() {
13 delete m_panConnect; 13 delete m_panConnect;
14} 14}
15 15
16StartPanConnection::StartPanConnection( QString mac ) { 16StartPanConnection::StartPanConnection( QString mac ) {
17 m_panConnect = 0l; 17 m_panConnect = 0l;
18 m_mac = mac; 18 m_mac = mac;
19 setConnectionType(); 19 setConnectionType();
20} 20}
21 21
22void StartPanConnection::setName( QString name ) { 22void StartPanConnection::setName( QString name ) {
23 m_name = name; 23 m_name = name;
24} 24}
25 25
26QString StartPanConnection::name() { 26QString StartPanConnection::name() {
27 return m_name; 27 return m_name;
28} 28}
29 29
30void StartPanConnection::setConnectionType() { 30void StartPanConnection::setConnectionType() {
31 m_connectionType = Pan; 31 m_connectionType = Pan;
32} 32}
33 33
34StartConnection::ConnectionType StartPanConnection::type() { 34StartConnection::ConnectionType StartPanConnection::type() {
35 return m_connectionType; 35 return m_connectionType;
36} 36}
37 37
38void StartPanConnection::start() { 38void StartPanConnection::start() {
39 m_panConnect = new OProcess(); 39 m_panConnect = new OProcess();
40 qDebug( "IM START " + m_mac ); 40 qDebug( "IM START " + m_mac );
41 *m_panConnect << "pand" << "--connect" << m_mac; 41 *m_panConnect << "pand" << "--connect" << m_mac;
42 42
43 connect( m_panConnect, SIGNAL( processExited( OProcess* ) ) , 43 connect( m_panConnect, SIGNAL( processExited(OProcess*) ) ,
44 this, SLOT( slotExited( OProcess* ) ) ); 44 this, SLOT( slotExited(OProcess*) ) );
45 connect( m_panConnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ), 45 connect( m_panConnect, SIGNAL( receivedStdout(OProcess*,char*,int) ),
46 this, SLOT( slotStdOut( OProcess*, char*, int ) ) ); 46 this, SLOT( slotStdOut(OProcess*,char*,int) ) );
47 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 47 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
48 qWarning( "could not start" ); 48 qWarning( "could not start" );
49 delete m_panConnect; 49 delete m_panConnect;
50 } 50 }
51} 51}
52 52
53 53
54void StartPanConnection::slotExited( OProcess* proc ) { 54void StartPanConnection::slotExited( OProcess* proc ) {
55 delete m_panConnect; 55 delete m_panConnect;
56 m_panConnect = 0l; 56 m_panConnect = 0l;
57} 57}
58 58
59void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len) 59void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len)
60{} 60{}
61 61
62 62
63void StartPanConnection::stop() { 63void StartPanConnection::stop() {
64 if ( m_panConnect ) { 64 if ( m_panConnect ) {
65 delete m_panConnect; 65 delete m_panConnect;
66 m_panConnect = 0l; 66 m_panConnect = 0l;
67 } 67 }
68 m_panConnect = new OProcess(); 68 m_panConnect = new OProcess();
69 qDebug("IM STOP " + m_mac); 69 qDebug("IM STOP " + m_mac);
70 70
71 *m_panConnect << "pand" << "--kill" << m_mac; 71 *m_panConnect << "pand" << "--kill" << m_mac;
72 72
73 connect( m_panConnect, SIGNAL( processExited( OProcess* ) ) , 73 connect( m_panConnect, SIGNAL( processExited(OProcess*) ) ,
74 this, SLOT( slotExited( OProcess* ) ) ); 74 this, SLOT( slotExited(OProcess*) ) );
75 connect( m_panConnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ), 75 connect( m_panConnect, SIGNAL( receivedStdout(OProcess*,char*,int) ),
76 this, SLOT( slotStdOut( OProcess*, char*, int ) ) ); 76 this, SLOT( slotStdOut(OProcess*,char*,int) ) );
77 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 77 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
78 qWarning( "could not stop" ); 78 qWarning( "could not stop" );
79 delete m_panConnect; 79 delete m_panConnect;
80 } 80 }
81} 81}
82 82
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 0ea45d2..29030ab 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -1,177 +1,177 @@
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 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 29
30/* QT */ 30/* QT */
31#include <qframe.h> 31#include <qframe.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qpushbutton.h> 33#include <qpushbutton.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qvariant.h> 35#include <qvariant.h>
36#include <qimage.h> 36#include <qimage.h>
37#include <qpixmap.h> 37#include <qpixmap.h>
38#include <qtabwidget.h> 38#include <qtabwidget.h>
39#include <qscrollview.h> 39#include <qscrollview.h>
40#include <qvbox.h> 40#include <qvbox.h>
41#include <qmessagebox.h> 41#include <qmessagebox.h>
42#include <qcheckbox.h> 42#include <qcheckbox.h>
43#include <qlineedit.h> 43#include <qlineedit.h>
44#include <qlistview.h> 44#include <qlistview.h>
45#include <qdir.h> 45#include <qdir.h>
46#include <qpopupmenu.h> 46#include <qpopupmenu.h>
47#include <qtimer.h> 47#include <qtimer.h>
48#include <qlist.h> 48#include <qlist.h>
49 49
50/* STD */ 50/* STD */
51#include <remotedevice.h> 51#include <remotedevice.h>
52#include <services.h> 52#include <services.h>
53#include <stdlib.h> 53#include <stdlib.h>
54 54
55using namespace OpieTooth; 55using namespace OpieTooth;
56 56
57BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 57BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
58 : BluetoothBase( parent, name, fl ) 58 : BluetoothBase( parent, name, fl )
59{ 59{
60 60
61 m_localDevice = new Manager( "hci0" ); 61 m_localDevice = new Manager( "hci0" );
62 62
63 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); 63 connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) );
64 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); 64 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) );
65 65
66 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) ); 66 connect( rfcommBindButton, SIGNAL( clicked() ), this, SLOT( rfcommDialog() ) );
67 // not good since lib is async 67 // not good since lib is async
68 // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), 68 // connect( ListView2, SIGNAL( expanded(QListViewItem*) ),
69 // this, SLOT( addServicesToDevice( QListViewItem * ) ) ); 69 // this, SLOT( addServicesToDevice(QListViewItem*) ) );
70 connect( ListView2, SIGNAL( clicked( QListViewItem* )), 70 connect( ListView2, SIGNAL( clicked(QListViewItem*)),
71 this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); 71 this, SLOT( startServiceActionClicked(QListViewItem*) ) );
72 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), 72 connect( ListView2, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ),
73 this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) ); 73 this, SLOT(startServiceActionHold(QListViewItem*,const QPoint&,int) ) );
74 connect( m_localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), 74 connect( m_localDevice , SIGNAL( foundServices(const QString&,Services::ValueList) ),
75 this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); 75 this, SLOT( addServicesToDevice(const QString&,Services::ValueList) ) );
76 connect( m_localDevice, SIGNAL( available( const QString&, bool ) ), 76 connect( m_localDevice, SIGNAL( available(const QString&,bool) ),
77 this, SLOT( deviceActive( const QString& , bool ) ) ); 77 this, SLOT( deviceActive(const QString&,bool) ) );
78 connect( m_localDevice, SIGNAL( connections( ConnectionState::ValueList ) ), 78 connect( m_localDevice, SIGNAL( connections(ConnectionState::ValueList) ),
79 this, SLOT( addConnectedDevices( ConnectionState::ValueList ) ) ); 79 this, SLOT( addConnectedDevices(ConnectionState::ValueList) ) );
80 connect( m_localDevice, SIGNAL( signalStrength( const QString&, const QString& ) ), 80 connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ),
81 this, SLOT( addSignalStrength( const QString&, const QString& ) ) ); 81 this, SLOT( addSignalStrength(const QString&,const QString&) ) );
82 82
83 83
84 // let hold be rightButtonClicked() 84 // let hold be rightButtonClicked()
85 QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold); 85 QPEApplication::setStylusOperation( ListView2->viewport(), QPEApplication::RightOnHold);
86 QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold); 86 QPEApplication::setStylusOperation( ListView4->viewport(), QPEApplication::RightOnHold);
87 87
88 //Load all icons needed 88 //Load all icons needed
89 m_offPix = Resource::loadPixmap( "opietooth/notconnected" ); 89 m_offPix = Resource::loadPixmap( "opietooth/notconnected" );
90 m_onPix = Resource::loadPixmap( "opietooth/connected" ); 90 m_onPix = Resource::loadPixmap( "opietooth/connected" );
91 m_findPix = Resource::loadPixmap( "opietooth/find" ); 91 m_findPix = Resource::loadPixmap( "opietooth/find" );
92 92
93 QPalette pal = this->palette(); 93 QPalette pal = this->palette();
94 QColor col = pal.color( QPalette::Active, QColorGroup::Background ); 94 QColor col = pal.color( QPalette::Active, QColorGroup::Background );
95 pal.setColor( QPalette::Active, QColorGroup::Button, col ); 95 pal.setColor( QPalette::Active, QColorGroup::Button, col );
96 pal.setColor( QPalette::Inactive, QColorGroup::Button, col ); 96 pal.setColor( QPalette::Inactive, QColorGroup::Button, col );
97 pal.setColor( QPalette::Normal, QColorGroup::Button, col ); 97 pal.setColor( QPalette::Normal, QColorGroup::Button, col );
98 pal.setColor( QPalette::Disabled, QColorGroup::Button, col ); 98 pal.setColor( QPalette::Disabled, QColorGroup::Button, col );
99 this->setPalette( pal ); 99 this->setPalette( pal );
100 100
101 setCaption( tr( "Bluetooth Manager" ) ); 101 setCaption( tr( "Bluetooth Manager" ) );
102 102
103 readConfig(); 103 readConfig();
104 initGui(); 104 initGui();
105 105
106 ListView2->setRootIsDecorated(true); 106 ListView2->setRootIsDecorated(true);
107 107
108 108
109 writeToHciConfig(); 109 writeToHciConfig();
110 // search conncetions 110 // search conncetions
111 addConnectedDevices(); 111 addConnectedDevices();
112 addSignalStrength(); 112 addSignalStrength();
113 m_iconLoader = new BTIconLoader(); 113 m_iconLoader = new BTIconLoader();
114 readSavedDevices(); 114 readSavedDevices();
115} 115}
116 116
117/** 117/**
118 * Reads all options from the config file 118 * Reads all options from the config file
119 */ 119 */
120void BlueBase::readConfig() 120void BlueBase::readConfig()
121{ 121{
122 122
123 Config cfg( "bluetoothmanager" ); 123 Config cfg( "bluetoothmanager" );
124 cfg.setGroup( "bluezsettings" ); 124 cfg.setGroup( "bluezsettings" );
125 125
126 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with 126 m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with
127 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak 127 m_defaultPasskey = cfg.readEntryCrypt( "passkey" , "" ); // <- hmm, look up how good the trolls did that, maybe too weak
128 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE ); 128 m_useEncryption = cfg.readBoolEntry( "useEncryption" , TRUE );
129 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE ); 129 m_enableAuthentification = cfg.readBoolEntry( "enableAuthentification" , TRUE );
130 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE ); 130 m_enablePagescan = cfg.readBoolEntry( "enablePagescan" , TRUE );
131 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE ); 131 m_enableInquiryscan = cfg.readBoolEntry( "enableInquiryscan" , TRUE );
132} 132}
133 133
134/** 134/**
135 * Writes all options to the config file 135 * Writes all options to the config file
136 */ 136 */
137void BlueBase::writeConfig() 137void BlueBase::writeConfig()
138{ 138{
139 139
140 Config cfg( "bluetoothmanager" ); 140 Config cfg( "bluetoothmanager" );
141 cfg.setGroup( "bluezsettings" ); 141 cfg.setGroup( "bluezsettings" );
142 142
143 cfg.writeEntry( "name" , m_deviceName ); 143 cfg.writeEntry( "name" , m_deviceName );
144 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey ); 144 cfg.writeEntryCrypt( "passkey" , m_defaultPasskey );
145 cfg.writeEntry( "useEncryption" , m_useEncryption ); 145 cfg.writeEntry( "useEncryption" , m_useEncryption );
146 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification ); 146 cfg.writeEntry( "enableAuthentification" , m_enableAuthentification );
147 cfg.writeEntry( "enablePagescan" , m_enablePagescan ); 147 cfg.writeEntry( "enablePagescan" , m_enablePagescan );
148 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan ); 148 cfg.writeEntry( "enableInquiryscan" , m_enableInquiryscan );
149 149
150 writeToHciConfig(); 150 writeToHciConfig();
151} 151}
152 152
153/** 153/**
154 * Modify the hcid.conf file to our needs 154 * Modify the hcid.conf file to our needs
155 */ 155 */
156void BlueBase::writeToHciConfig() 156void BlueBase::writeToHciConfig()
157{ 157{
158 qWarning("writeToHciConfig"); 158 qWarning("writeToHciConfig");
159 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 159 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
160 hciconf.load(); 160 hciconf.load();
161 hciconf.setPinHelper( "/opt/QtPalmtop/bin/bluepin" ); 161 hciconf.setPinHelper( "/opt/QtPalmtop/bin/bluepin" );
162 hciconf.setName( m_deviceName ); 162 hciconf.setName( m_deviceName );
163 hciconf.setEncrypt( m_useEncryption ); 163 hciconf.setEncrypt( m_useEncryption );
164 hciconf.setAuth( m_enableAuthentification ); 164 hciconf.setAuth( m_enableAuthentification );
165 hciconf.setPscan( m_enablePagescan ); 165 hciconf.setPscan( m_enablePagescan );
166 hciconf.setIscan( m_enableInquiryscan ); 166 hciconf.setIscan( m_enableInquiryscan );
167 hciconf.save(); 167 hciconf.save();
168} 168}
169 169
170 170
171/** 171/**
172 * Read the list of allready known devices 172 * Read the list of allready known devices
173 */ 173 */
174void BlueBase::readSavedDevices() 174void BlueBase::readSavedDevices()
175{ 175{
176 176
177 QValueList<RemoteDevice> loadedDevices; 177 QValueList<RemoteDevice> loadedDevices;
@@ -544,145 +544,145 @@ void BlueBase::addConnectedDevices( ConnectionState::ValueList connectionList )
544 544
545 if ( found == false ) 545 if ( found == false )
546 { 546 {
547 connectionItem = new BTConnectionItem( ListView4, (*it) ); 547 connectionItem = new BTConnectionItem( ListView4, (*it) );
548 548
549 if( m_deviceList.find((*it).mac()).data() ) 549 if( m_deviceList.find((*it).mac()).data() )
550 { 550 {
551 connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() ); 551 connectionItem->setName( m_deviceList.find( (*it).mac()).data()->name() );
552 } 552 }
553 } 553 }
554 554
555 } 555 }
556 556
557 QListViewItemIterator it2( ListView4 ); 557 QListViewItemIterator it2( ListView4 );
558 for ( ; it2.current(); ++it2 ) 558 for ( ; it2.current(); ++it2 )
559 { 559 {
560 bool found = false; 560 bool found = false;
561 for (it = connectionList.begin(); it != connectionList.end(); ++it) 561 for (it = connectionList.begin(); it != connectionList.end(); ++it)
562 { 562 {
563 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() ) 563 if( ( ((BTConnectionItem*)it2.current())->connection().mac() ) == (*it).mac() )
564 { 564 {
565 found = true; 565 found = true;
566 } 566 }
567 } 567 }
568 568
569 if ( !found ) 569 if ( !found )
570 { 570 {
571 delete it2.current(); 571 delete it2.current();
572 } 572 }
573 573
574 } 574 }
575 575
576 576
577 } 577 }
578 else 578 else
579 { 579 {
580 ListView4->clear(); 580 ListView4->clear();
581 ConnectionState con; 581 ConnectionState con;
582 con.setMac( tr("No connections found") ); 582 con.setMac( tr("No connections found") );
583 connectionItem = new BTConnectionItem( ListView4 , con ); 583 connectionItem = new BTConnectionItem( ListView4 , con );
584 } 584 }
585 585
586 // recall connection search after some time 586 // recall connection search after some time
587 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) ); 587 QTimer::singleShot( 15000, this, SLOT( addConnectedDevices() ) );
588} 588}
589 589
590 590
591/** 591/**
592 * Find out if a device can currently be reached 592 * Find out if a device can currently be reached
593 * @param device 593 * @param device
594 */ 594 */
595void BlueBase::deviceActive( const RemoteDevice &device ) 595void BlueBase::deviceActive( const RemoteDevice &device )
596{ 596{
597 // search by mac, async, gets a signal back 597 // search by mac, async, gets a signal back
598 // We should have a BTDeviceItem there or where does it get added to the map -zecke 598 // We should have a BTDeviceItem there or where does it get added to the map -zecke
599 m_localDevice->isAvailable( device.mac() ); 599 m_localDevice->isAvailable( device.mac() );
600} 600}
601 601
602 602
603/** 603/**
604 * The signal catcher. Set the avail. status on device. 604 * The signal catcher. Set the avail. status on device.
605 * @param device - the mac address 605 * @param device - the mac address
606 * @param connected - if it is avail. or not 606 * @param connected - if it is avail. or not
607 */ 607 */
608void BlueBase::deviceActive( const QString& device, bool connected ) 608void BlueBase::deviceActive( const QString& device, bool connected )
609{ 609{
610 qDebug("deviceActive slot"); 610 qDebug("deviceActive slot");
611 611
612 QMap<QString,BTDeviceItem*>::Iterator it; 612 QMap<QString,BTDeviceItem*>::Iterator it;
613 613
614 it = m_deviceList.find( device ); 614 it = m_deviceList.find( device );
615 if( it == m_deviceList.end() ) 615 if( it == m_deviceList.end() )
616 return; 616 return;
617 617
618 BTDeviceItem* deviceItem = it.data(); 618 BTDeviceItem* deviceItem = it.data();
619 619
620 620
621 if ( connected ) 621 if ( connected )
622 { 622 {
623 deviceItem->setPixmap( 1, m_onPix ); 623 deviceItem->setPixmap( 1, m_onPix );
624 } 624 }
625 else 625 else
626 { 626 {
627 deviceItem->setPixmap( 1, m_offPix ); 627 deviceItem->setPixmap( 1, m_offPix );
628 } 628 }
629 m_deviceList.remove( it ); 629 m_deviceList.remove( it );
630} 630}
631 631
632 632
633/** 633/**
634 * Open the "scan for devices" dialog 634 * Open the "scan for devices" dialog
635 */ 635 */
636void BlueBase::startScan() 636void BlueBase::startScan()
637{ 637{
638 ScanDialog *scan = new ScanDialog( this, "ScanDialog", 638 ScanDialog *scan = new ScanDialog( this, "ScanDialog",
639 true, WDestructiveClose ); 639 true, WDestructiveClose );
640 QObject::connect( scan, SIGNAL( selectedDevices( const QValueList<RemoteDevice>& ) ), 640 QObject::connect( scan, SIGNAL( selectedDevices(const QValueList<RemoteDevice>&) ),
641 this, SLOT( addSearchedDevices( const QValueList<RemoteDevice>& ) ) ); 641 this, SLOT( addSearchedDevices(const QValueList<RemoteDevice>&) ) );
642 642
643 QPEApplication::showDialog( scan ); 643 QPEApplication::showDialog( scan );
644} 644}
645 645
646 646
647/** 647/**
648 * Set the informations about the local device in information Tab 648 * Set the informations about the local device in information Tab
649 */ 649 */
650void BlueBase::setInfo() 650void BlueBase::setInfo()
651{ 651{
652 StatusLabel->setText( status() ); 652 StatusLabel->setText( status() );
653} 653}
654 654
655 655
656/** 656/**
657 * Decontructor 657 * Decontructor
658 */ 658 */
659BlueBase::~BlueBase() 659BlueBase::~BlueBase()
660{ 660{
661 writeSavedDevices(); 661 writeSavedDevices();
662 delete m_iconLoader; 662 delete m_iconLoader;
663} 663}
664 664
665 665
666/** 666/**
667 * find searches the ListView for a BTDeviceItem containig 667 * find searches the ListView for a BTDeviceItem containig
668 * the same Device if found return true else false 668 * the same Device if found return true else false
669 * @param dev RemoteDevice to find 669 * @param dev RemoteDevice to find
670 * @return returns true if found 670 * @return returns true if found
671 */ 671 */
672bool BlueBase::find( const RemoteDevice& rem ) 672bool BlueBase::find( const RemoteDevice& rem )
673{ 673{
674 QListViewItemIterator it( ListView2 ); 674 QListViewItemIterator it( ListView2 );
675 BTListItem* item; 675 BTListItem* item;
676 BTDeviceItem* device; 676 BTDeviceItem* device;
677 for (; it.current(); ++it ) 677 for (; it.current(); ++it )
678 { 678 {
679 item = (BTListItem*) it.current(); 679 item = (BTListItem*) it.current();
680 if ( item->typeId() != BTListItem::Device ) 680 if ( item->typeId() != BTListItem::Device )
681 continue; 681 continue;
682 682
683 device = (BTDeviceItem*)item; 683 device = (BTDeviceItem*)item;
684 if ( rem.equals( device->remoteDevice() ) ) 684 if ( rem.equals( device->remoteDevice() ) )
685 return true; 685 return true;
686 } 686 }
687 return false; // not found 687 return false; // not found
688} 688}
diff --git a/noncore/net/opietooth/manager/obexdialog.cpp b/noncore/net/opietooth/manager/obexdialog.cpp
index 15973d4..46a0e3d 100644
--- a/noncore/net/opietooth/manager/obexdialog.cpp
+++ b/noncore/net/opietooth/manager/obexdialog.cpp
@@ -1,86 +1,86 @@
1 1
2#include "obexdialog.h" 2#include "obexdialog.h"
3#include <qpushbutton.h> 3#include <qpushbutton.h>
4#include <qmultilineedit.h> 4#include <qmultilineedit.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qlayout.h> 6#include <qlayout.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <qfileinfo.h> 8#include <qfileinfo.h>
9 9
10#include <qpe/resource.h> 10#include <qpe/resource.h>
11 11
12#include <opie/oprocess.h> 12#include <opie/oprocess.h>
13#include <opie/ofiledialog.h> 13#include <opie/ofiledialog.h>
14 14
15using namespace OpieTooth; 15using namespace OpieTooth;
16 16
17ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) 17ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
18 : QDialog( parent, name, modal, fl ) { 18 : QDialog( parent, name, modal, fl ) {
19 19
20 if ( !name ) 20 if ( !name )
21 setName( "ObexDialog" ); 21 setName( "ObexDialog" );
22 setCaption( tr( "beam files " ) ) ; 22 setCaption( tr( "beam files " ) ) ;
23 23
24 m_device = device; 24 m_device = device;
25 25
26 layout = new QVBoxLayout( this ); 26 layout = new QVBoxLayout( this );
27 27
28 QLabel* info = new QLabel( this ); 28 QLabel* info = new QLabel( this );
29 info->setText( tr("Which file should be beamed?") ); 29 info->setText( tr("Which file should be beamed?") );
30 30
31 cmdLine = new QLineEdit( this ); 31 cmdLine = new QLineEdit( this );
32 32
33 QPushButton *browserButton; 33 QPushButton *browserButton;
34 browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); 34 browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton");
35 connect( browserButton, SIGNAL(released() ), this , SLOT(browse() ) ); 35 connect( browserButton, SIGNAL(released() ), this , SLOT(browse() ) );
36 36
37 chNameLine = new QLineEdit( this ); 37 chNameLine = new QLineEdit( this );
38 38
39 sendButton = new QPushButton( this ); 39 sendButton = new QPushButton( this );
40 sendButton->setText( tr( "Send" ) ); 40 sendButton->setText( tr( "Send" ) );
41 41
42 layout->addWidget(info); 42 layout->addWidget(info);
43 layout->addWidget(cmdLine); 43 layout->addWidget(cmdLine);
44 layout->addWidget(browserButton); 44 layout->addWidget(browserButton);
45 layout->addWidget(chNameLine); 45 layout->addWidget(chNameLine);
46 layout->addWidget(sendButton); 46 layout->addWidget(sendButton);
47 47
48 connect( sendButton, SIGNAL( clicked() ), this, SLOT( sendData() ) ); 48 connect( sendButton, SIGNAL( clicked() ), this, SLOT( sendData() ) );
49 49
50} 50}
51 51
52ObexDialog::~ObexDialog() { 52ObexDialog::~ObexDialog() {
53} 53}
54 54
55void ObexDialog::browse() { 55void ObexDialog::browse() {
56 56
57 MimeTypes types; 57 MimeTypes types;
58 QStringList all; 58 QStringList all;
59 all << "*/*"; 59 all << "*/*";
60 types.insert("All Files", all ); 60 types.insert("All Files", all );
61 61
62 QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 ); 62 QString str = OFileDialog::getOpenFileName( 1,"/","", types, 0 );
63 cmdLine->setText( str ); 63 cmdLine->setText( str );
64 64
65} 65}
66 66
67void ObexDialog::sendData() { 67void ObexDialog::sendData() {
68 QString fileURL = cmdLine->text(); 68 QString fileURL = cmdLine->text();
69 QString file = QFileInfo( fileURL ).fileName(); 69 QString file = QFileInfo( fileURL ).fileName();
70 QString modifiedName = chNameLine->text(); 70 QString modifiedName = chNameLine->text();
71 71
72 // vom popupmenu beziehen 72 // vom popupmenu beziehen
73 OProcess* obexSend = new OProcess(); 73 OProcess* obexSend = new OProcess();
74 if ( !modifiedName.isEmpty() ) { 74 if ( !modifiedName.isEmpty() ) {
75 *obexSend << "ussp-push" << m_device << fileURL << modifiedName; 75 *obexSend << "ussp-push" << m_device << fileURL << modifiedName;
76 } else { 76 } else {
77 *obexSend << "ussp-push" << m_device << fileURL << file; 77 *obexSend << "ussp-push" << m_device << fileURL << file;
78 } 78 }
79 if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) { 79 if (!obexSend->start(OProcess::DontCare, OProcess::AllOutput) ) {
80 qWarning("could not start"); 80 qWarning("could not start");
81 delete obexSend; 81 delete obexSend;
82 } 82 }
83 83
84 84
85 85
86} 86}
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp
index 1f347ce..4e58552 100644
--- a/noncore/net/opietooth/manager/pppdialog.cpp
+++ b/noncore/net/opietooth/manager/pppdialog.cpp
@@ -1,68 +1,68 @@
1 1
2#include "pppdialog.h" 2#include "pppdialog.h"
3#include <qpushbutton.h> 3#include <qpushbutton.h>
4#include <qmultilineedit.h> 4#include <qmultilineedit.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qlayout.h> 6#include <qlayout.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <opie/oprocess.h> 8#include <opie/oprocess.h>
9 9
10using namespace OpieTooth; 10using namespace OpieTooth;
11 11
12PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) 12PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
13 : QDialog( parent, name, modal, fl ) { 13 : QDialog( parent, name, modal, fl ) {
14 14
15 if ( !name ) 15 if ( !name )
16 setName( "PPPDialog" ); 16 setName( "PPPDialog" );
17 setCaption( tr( "ppp connection " ) ) ; 17 setCaption( tr( "ppp connection " ) ) ;
18 18
19 m_device = device; 19 m_device = device;
20 20
21 layout = new QVBoxLayout( this ); 21 layout = new QVBoxLayout( this );
22 22
23 QLabel* info = new QLabel( this ); 23 QLabel* info = new QLabel( this );
24 info->setText( tr("Enter an ppp script name:") ); 24 info->setText( tr("Enter an ppp script name:") );
25 25
26 cmdLine = new QLineEdit( this ); 26 cmdLine = new QLineEdit( this );
27 27
28 outPut = new QMultiLineEdit( this ); 28 outPut = new QMultiLineEdit( this );
29 QFont outPut_font( outPut->font() ); 29 QFont outPut_font( outPut->font() );
30 outPut_font.setPointSize( 8 ); 30 outPut_font.setPointSize( 8 );
31 outPut->setFont( outPut_font ); 31 outPut->setFont( outPut_font );
32 outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); 32 outPut->setWordWrap( QMultiLineEdit::WidgetWidth );
33 33
34 connectButton = new QPushButton( this ); 34 connectButton = new QPushButton( this );
35 connectButton->setText( tr( "Connect" ) ); 35 connectButton->setText( tr( "Connect" ) );
36 36
37 layout->addWidget(info); 37 layout->addWidget(info);
38 layout->addWidget(cmdLine); 38 layout->addWidget(cmdLine);
39 layout->addWidget(outPut); 39 layout->addWidget(outPut);
40 layout->addWidget(connectButton); 40 layout->addWidget(connectButton);
41 41
42 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); 42 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) );
43 43
44} 44}
45 45
46PPPDialog::~PPPDialog() { 46PPPDialog::~PPPDialog() {
47} 47}
48 48
49void PPPDialog::connectToDevice() { 49void PPPDialog::connectToDevice() {
50 outPut->clear(); 50 outPut->clear();
51 // vom popupmenu beziehen 51 // vom popupmenu beziehen
52 QString connectScript = "/etc/ppp/peers/" + cmdLine->text(); 52 QString connectScript = "/etc/ppp/peers/" + cmdLine->text();
53 OProcess* pppDial = new OProcess(); 53 OProcess* pppDial = new OProcess();
54 *pppDial << "pppd" << m_device << "call" << connectScript; 54 *pppDial << "pppd" << m_device << "call" << connectScript;
55 connect( pppDial, SIGNAL(receivedStdout(OProcess*, char*, int ) ), 55 connect( pppDial, SIGNAL(receivedStdout(OProcess*,char*,int) ),
56 this, SLOT(fillOutPut(OProcess*, char*, int ) ) ); 56 this, SLOT(fillOutPut(OProcess*,char*,int) ) );
57 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) { 57 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) {
58 qWarning("could not start"); 58 qWarning("could not start");
59 delete pppDial; 59 delete pppDial;
60 } 60 }
61} 61}
62 62
63void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) { 63void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) {
64 QCString str(cha, len ); 64 QCString str(cha, len );
65 outPut->insertLine( str ); 65 outPut->insertLine( str );
66 delete pppDial; 66 delete pppDial;
67} 67}
68 68
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index de4f742..c8ea3e3 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -1,161 +1,161 @@
1/* main.cpp 1/* main.cpp
2 * 2 *
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 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 34
35namespace OpieTooth { 35namespace OpieTooth {
36 36
37#include <remotedevice.h> 37#include <remotedevice.h>
38 38
39/** 39/**
40 */ 40 */
41 ScanDialog::ScanDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 41 ScanDialog::ScanDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
42 : QDialog( parent, name, modal, fl ) { 42 : QDialog( parent, name, modal, fl ) {
43 43
44 setCaption( tr( "Scan for devices" ) ); 44 setCaption( tr( "Scan for devices" ) );
45 45
46 Layout11 = new QVBoxLayout( this ); 46 Layout11 = new QVBoxLayout( this );
47 Layout11->setSpacing( 6 ); 47 Layout11->setSpacing( 6 );
48 Layout11->setMargin( 0 ); 48 Layout11->setMargin( 0 );
49 49
50 progress = new QProgressBar( this, "progbar"); 50 progress = new QProgressBar( this, "progbar");
51 progress->setTotalSteps(20); 51 progress->setTotalSteps(20);
52 52
53 StartStopButton = new QPushButton( this, "StartButton" ); 53 StartStopButton = new QPushButton( this, "StartButton" );
54 StartStopButton->setText( tr( "Start scan" ) ); 54 StartStopButton->setText( tr( "Start scan" ) );
55 55
56 ListView1 = new QListView( this, "ListView1" ); 56 ListView1 = new QListView( this, "ListView1" );
57 57
58 //ListView1->addColumn( tr( "Add" ) ); 58 //ListView1->addColumn( tr( "Add" ) );
59 ListView1->addColumn( tr( "Add Device" ) ); 59 ListView1->addColumn( tr( "Add Device" ) );
60 //ListView1->addColumn( tr( "Type" ) ); 60 //ListView1->addColumn( tr( "Type" ) );
61 61
62 Layout11->addWidget( ListView1 ); 62 Layout11->addWidget( ListView1 );
63 Layout11->addWidget( progress ); 63 Layout11->addWidget( progress );
64 Layout11->addWidget( StartStopButton ); 64 Layout11->addWidget( StartStopButton );
65 65
66 localDevice = new Manager( "hci0" ); 66 localDevice = new Manager( "hci0" );
67 67
68 connect( StartStopButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) ); 68 connect( StartStopButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) );
69 connect( localDevice, SIGNAL( foundDevices( const QString& , RemoteDevice::ValueList ) ), 69 connect( localDevice, SIGNAL( foundDevices(const QString&,RemoteDevice::ValueList) ),
70 this, SLOT( fillList( const QString& , RemoteDevice::ValueList ) ) ) ; 70 this, SLOT( fillList(const QString&,RemoteDevice::ValueList) ) ) ;
71 71
72 progressStat = 0; 72 progressStat = 0;
73 m_search = false; 73 m_search = false;
74 } 74 }
75 75
76// hack, make cleaner later 76// hack, make cleaner later
77 void ScanDialog::progressTimer() { 77 void ScanDialog::progressTimer() {
78 78
79 progressStat++; 79 progressStat++;
80 if ( progressStat++ < 20 && m_search ) { 80 if ( progressStat++ < 20 && m_search ) {
81 QTimer::singleShot( 2000, this, SLOT( progressTimer() ) ); 81 QTimer::singleShot( 2000, this, SLOT( progressTimer() ) );
82 progress->setProgress( progressStat++ ); 82 progress->setProgress( progressStat++ );
83 } 83 }
84 } 84 }
85 85
86 void ScanDialog::accept() { 86 void ScanDialog::accept() {
87 emitToManager(); 87 emitToManager();
88 QDialog::accept(); 88 QDialog::accept();
89 } 89 }
90 90
91 91
92 void ScanDialog::startSearch() { 92 void ScanDialog::startSearch() {
93 if ( m_search ) { 93 if ( m_search ) {
94 stopSearch(); 94 stopSearch();
95 return; 95 return;
96 } 96 }
97 m_search = true; 97 m_search = true;
98 progress->setProgress(0); 98 progress->setProgress(0);
99 progressStat = 0; 99 progressStat = 0;
100 100
101 // empty list before a new scan 101 // empty list before a new scan
102 ListView1->clear(); 102 ListView1->clear();
103 103
104 progressTimer(); 104 progressTimer();
105 // when finished, it emmite foundDevices() 105 // when finished, it emmite foundDevices()
106 // checken ob initialisiert , qcop ans applet. 106 // checken ob initialisiert , qcop ans applet.
107 StartStopButton->setText( tr( "Stop scan" ) ); 107 StartStopButton->setText( tr( "Stop scan" ) );
108 108
109 localDevice->searchDevices(); 109 localDevice->searchDevices();
110 110
111 } 111 }
112 112
113 void ScanDialog::stopSearch() { 113 void ScanDialog::stopSearch() {
114 m_search = true; 114 m_search = true;
115 } 115 }
116 116
117 void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) { 117 void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) {
118 progress->setProgress(0); 118 progress->setProgress(0);
119 progressStat = 0; 119 progressStat = 0;
120 QCheckListItem * deviceItem; 120 QCheckListItem * deviceItem;
121 121
122 RemoteDevice::ValueList::Iterator it; 122 RemoteDevice::ValueList::Iterator it;
123 for( it = deviceList.begin(); it != deviceList.end(); ++it ) { 123 for( it = deviceList.begin(); it != deviceList.end(); ++it ) {
124 124
125 deviceItem = new QCheckListItem( ListView1, (*it).name(), QCheckListItem::CheckBox ); 125 deviceItem = new QCheckListItem( ListView1, (*it).name(), QCheckListItem::CheckBox );
126 deviceItem->setText( 1, (*it).mac() ); 126 deviceItem->setText( 1, (*it).mac() );
127 } 127 }
128 m_search = false; 128 m_search = false;
129 StartStopButton->setText( tr( "Start scan" ) ); 129 StartStopButton->setText( tr( "Start scan" ) );
130 } 130 }
131 131
132/** 132/**
133 * Iterates trough the items, and collects the checked items. 133 * Iterates trough the items, and collects the checked items.
134 * Then it emits it, so the manager can connect to the signal to fill the listing. 134 * Then it emits it, so the manager can connect to the signal to fill the listing.
135 */ 135 */
136 void ScanDialog::emitToManager() { 136 void ScanDialog::emitToManager() {
137 137
138 if (!ListView1) { 138 if (!ListView1) {
139 return; 139 return;
140 } 140 }
141 141
142 QValueList<RemoteDevice> deviceList; 142 QValueList<RemoteDevice> deviceList;
143 143
144 QListViewItemIterator it( ListView1 ); 144 QListViewItemIterator it( ListView1 );
145 for ( ; it.current(); ++it ) { 145 for ( ; it.current(); ++it ) {
146 if ( ( (QCheckListItem*)it.current() )->isOn() ) { 146 if ( ( (QCheckListItem*)it.current() )->isOn() ) {
147 RemoteDevice device( it.current()->text(1), it.current()->text(0) ); 147 RemoteDevice device( it.current()->text(1), it.current()->text(0) );
148 deviceList.append( device ); 148 deviceList.append( device );
149 } 149 }
150 } 150 }
151 emit selectedDevices( deviceList ); 151 emit selectedDevices( deviceList );
152 } 152 }
153 153
154/** 154/**
155 * Cleanup 155 * Cleanup
156 */ 156 */
157 ScanDialog::~ScanDialog() { 157 ScanDialog::~ScanDialog() {
158 qWarning("delete scan dialog"); 158 qWarning("delete scan dialog");
159 delete localDevice; 159 delete localDevice;
160 } 160 }
161} 161}