summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-06-16 20:44:48 (UTC)
committer harlekin <harlekin>2002-06-16 20:44:48 (UTC)
commit56788c49b68bae137a51b089b911f7ec4977c33f (patch) (unidiff)
treecea3983dbb842348d1881d7f7d8ef2679d571d14
parent5c098847f0fd716c4fe697e5eb314111a4ae5df1 (diff)
downloadopie-56788c49b68bae137a51b089b911f7ec4977c33f.zip
opie-56788c49b68bae137a51b089b911f7ec4977c33f.tar.gz
opie-56788c49b68bae137a51b089b911f7ec4977c33f.tar.bz2
remoteDevice part II
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp19
-rw-r--r--noncore/net/opietooth/manager/bluebase.h2
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp8
-rw-r--r--noncore/net/opietooth/manager/scandialog.h4
4 files changed, 22 insertions, 11 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 71da82e..c993c7c 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -31,20 +31,22 @@
31#include <qscrollview.h> 31#include <qscrollview.h>
32#include <qvbox.h> 32#include <qvbox.h>
33#include <qmessagebox.h> 33#include <qmessagebox.h>
34#include <qapplication.h> 34#include <qapplication.h>
35#include <qcheckbox.h> 35#include <qcheckbox.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qlistview.h>
37 38
38#include <qpe/resource.h> 39#include <qpe/resource.h>
39#include <qpe/config.h> 40#include <qpe/config.h>
40 41
41 42
42namespace OpieTooth { 43namespace OpieTooth {
43 44
44 class RemoteDevices; 45
46 #include <remotedevice.h>
45 47
46 BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) 48 BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
47 : BluetoothBase( parent, name, fl ) { 49 : BluetoothBase( parent, name, fl ) {
48 50
49 51
50 QObject::connect( (QObject*) PushButton2, SIGNAL( clicked() ), this, SLOT(startScan())); 52 QObject::connect( (QObject*) PushButton2, SIGNAL( clicked() ), this, SLOT(startScan()));
@@ -150,26 +152,35 @@ namespace OpieTooth {
150 box->show(); 152 box->show();
151 153
152 // falls nötig hcid killhupen - die funktionalität adden 154 // falls nötig hcid killhupen - die funktionalität adden
153} 155}
154 156
155 157
156 void BlueBase::addSearchedDevices( QList<RemoteDevices> &newDevices ) { 158 void BlueBase::addSearchedDevices( QList<RemoteDevice> &newDevices ) {
159
160 QListViewItem * deviceItem;
157 161
162 QListIterator<RemoteDevice> it(newDevices);
158 163
164 for( ; it.current(); ++it ) {
159 165
166
167 RemoteDevice *dev = it.current();
168 deviceItem = new QListViewItem( ListView4, dev->name() );
169 deviceItem->setText(1, dev->mac() );
170 }
160 } 171 }
161 172
162 173
163/** 174/**
164 * Open the "scan for devices" dialog 175 * Open the "scan for devices" dialog
165 */ 176 */
166 void BlueBase::startScan() { 177 void BlueBase::startScan() {
167 ScanDialog *scan = new ScanDialog( this, "", true); 178 ScanDialog *scan = new ScanDialog( this, "", true);
168 QObject::connect((QObject*)scan, SIGNAL( selectedDevices(QList<RemoteDevices>&) ), 179 QObject::connect((QObject*)scan, SIGNAL( selectedDevices(QList<RemoteDevice>&) ),
169 this, SLOT( addSearchedDevices(QList<RemoteDevices>& ) )); 180 this, SLOT( addSearchedDevices(QList<RemoteDevice>& ) ));
170 181
171 scan->showMaximized(); 182 scan->showMaximized();
172 } 183 }
173 184
174/** 185/**
175 * Decontructor 186 * Decontructor
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 5364e51..c8ceed2 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -50,13 +50,13 @@ namespace OpieTooth {
50 int useEncryption; 50 int useEncryption;
51 int enableAuthentification; 51 int enableAuthentification;
52 int enablePagescan; 52 int enablePagescan;
53 int enableInquiryscan; 53 int enableInquiryscan;
54 54
55 private slots: 55 private slots:
56 void addSearchedDevices( QList<RemoteDevices> &newDevices ); 56 void addSearchedDevices( QList<RemoteDevice> &newDevices );
57 void applyConfigChanges(); 57 void applyConfigChanges();
58 58
59 }; 59 };
60 60
61} 61}
62 62
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index 8a7ea01..bd7d23c 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -121,17 +121,17 @@ namespace OpieTooth {
121 } 121 }
122 122
123 void ScanDialog::stopSearch() { 123 void ScanDialog::stopSearch() {
124 124
125 } 125 }
126 126
127 void ScanDialog::fillList(const QString& device, RemoteDevices::ValueList deviceList) { 127 void ScanDialog::fillList(const QString& device, RemoteDevice::ValueList deviceList) {
128 128
129 QCheckListItem * deviceItem; 129 QCheckListItem * deviceItem;
130 130
131 RemoteDevices::ValueList::Iterator it; 131 RemoteDevice::ValueList::Iterator it;
132 for( it = deviceList.begin(); it != deviceList.end(); ++it ) { 132 for( it = deviceList.begin(); it != deviceList.end(); ++it ) {
133 133
134 deviceItem = new QCheckListItem( ListView1, (*it).name() ); 134 deviceItem = new QCheckListItem( ListView1, (*it).name() );
135 deviceItem->setText(1, (*it).mac() ); 135 deviceItem->setText(1, (*it).mac() );
136 } 136 }
137 } 137 }
@@ -143,18 +143,18 @@ namespace OpieTooth {
143 void ScanDialog::emitToManager() { 143 void ScanDialog::emitToManager() {
144 144
145 if (!ListView1) { 145 if (!ListView1) {
146 return; 146 return;
147 } 147 }
148 148
149 QList<RemoteDevices> *deviceList = new QList<RemoteDevices>; 149 QList<RemoteDevice> *deviceList = new QList<RemoteDevice>;
150 150
151 QListViewItemIterator it( ListView1 ); 151 QListViewItemIterator it( ListView1 );
152 for ( ; it.current(); ++it ) { 152 for ( ; it.current(); ++it ) {
153 if ( ((QCheckListItem*)it.current())->isOn() ) { 153 if ( ((QCheckListItem*)it.current())->isOn() ) {
154 RemoteDevices* device = new RemoteDevices( it.current()->text(1), it.current()->text(0)); 154 RemoteDevice * device = new RemoteDevice( it.current()->text(1), it.current()->text(0));
155 deviceList->append( device ); 155 deviceList->append( device );
156 } 156 }
157 } 157 }
158 emit selectedDevices( *deviceList ); 158 emit selectedDevices( *deviceList );
159 } 159 }
160 160
diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h
index 0ca302a..adc960c 100644
--- a/noncore/net/opietooth/manager/scandialog.h
+++ b/noncore/net/opietooth/manager/scandialog.h
@@ -57,21 +57,21 @@ class Device;
57 QVBoxLayout* Layout11; 57 QVBoxLayout* Layout11;
58 58
59 private slots: 59 private slots:
60 void stopSearch(); 60 void stopSearch();
61 void startSearch(); 61 void startSearch();
62 void progressTimer(); 62 void progressTimer();
63 void fillList(const QString& device, RemoteDevices::ValueList list); 63 void fillList(const QString& device, RemoteDevice::ValueList list);
64 64
65 private: 65 private:
66 void emitToManager(); 66 void emitToManager();
67 Manager *localDevice; 67 Manager *localDevice;
68 int progressStat; 68 int progressStat;
69 69
70 signals: 70 signals:
71 void selectedDevices(QList<RemoteDevices>&); 71 void selectedDevices(QList<RemoteDevice>&);
72 }; 72 };
73 73
74 74
75} 75}
76 76
77#endif // SCANDIALOG_H 77#endif // SCANDIALOG_H