Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 114 |
1 files changed, 109 insertions, 5 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index c993c7c..d45fbe0 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -41,7 +41,7 @@ | |||
41 | 41 | ||
42 | #include <remotedevice.h> | ||
42 | 43 | ||
43 | namespace OpieTooth { | ||
44 | 44 | ||
45 | namespace OpieTooth { | ||
45 | 46 | ||
46 | #include <remotedevice.h> | ||
47 | 47 | ||
@@ -53,6 +53,16 @@ namespace OpieTooth { | |||
53 | QObject::connect((QObject*)configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges())); | 53 | QObject::connect((QObject*)configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges())); |
54 | QObject::connect( (QObject*)ListView2, SIGNAL( expanded( QListViewItem * item ) ), | ||
55 | this, SLOT( addServicesToDevice( QListViewItem * item ) ) ); | ||
56 | QObject::connect( (QObject*)ListView2, SIGNAL( clicked( QListViewItem * )), | ||
57 | this, SLOT( startServiceActionClicked( QListViewItem * item ) ) ); | ||
54 | 58 | ||
59 | // | ||
60 | // QObject::connect( (QObject*) Manager, SIGNAL (foundServices( const QString& device, Services::ValueList ), this () ) ); | ||
55 | 61 | ||
62 | //Load all icons needed | ||
56 | 63 | ||
57 | 64 | ||
65 | QPixmap offPix = Resource::loadPixmap( "editdelete" ); | ||
66 | QPixmap onPix = Resource::loadPixmap( "installed" ); | ||
67 | |||
58 | QPalette pal = this->palette(); | 68 | QPalette pal = this->palette(); |
@@ -69,4 +79,21 @@ namespace OpieTooth { | |||
69 | initGui(); | 79 | initGui(); |
80 | |||
81 | |||
82 | //TESTING | ||
83 | |||
84 | ListView2->setRootIsDecorated(true); | ||
85 | |||
86 | QListViewItem *topLV = new QListViewItem( ListView2, "Harlekins Dongle" , "yes"); | ||
87 | topLV->setPixmap(0, offPix); | ||
88 | (void) new QListViewItem( topLV, "on" ); | ||
89 | (void) new QListViewItem( topLV, "off" ); | ||
90 | |||
91 | QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" ); | ||
92 | topLV2->setPixmap(0, onPix); | ||
93 | (void) new QListViewItem( topLV2, "on" ); | ||
94 | (void) new QListViewItem( topLV2, "off" ); | ||
95 | |||
70 | } | 96 | } |
71 | 97 | ||
98 | |||
72 | /** | 99 | /** |
@@ -98,3 +125,2 @@ namespace OpieTooth { | |||
98 | 125 | ||
99 | |||
100 | cfg.writeEntry("name", deviceName); | 126 | cfg.writeEntry("name", deviceName); |
@@ -108,2 +134,20 @@ namespace OpieTooth { | |||
108 | 134 | ||
135 | /* | ||
136 | * Read the list of allready known devices | ||
137 | * | ||
138 | */ | ||
139 | void BlueBase::readSavedDevices() { | ||
140 | |||
141 | } | ||
142 | |||
143 | /* | ||
144 | * Read the list of allready known devices | ||
145 | * | ||
146 | */ | ||
147 | void BlueBase::writeSavedDevices() { | ||
148 | |||
149 | |||
150 | } | ||
151 | |||
152 | |||
109 | /** | 153 | /** |
@@ -121,2 +165,4 @@ namespace OpieTooth { | |||
121 | passkeyLine->setText(defaultPasskey); | 165 | passkeyLine->setText(defaultPasskey); |
166 | // set info tab | ||
167 | setInfo(); | ||
122 | } | 168 | } |
@@ -130,3 +176,7 @@ namespace OpieTooth { | |||
130 | 176 | ||
131 | return ("manger.h need also a status method"); | 177 | QString infoString = tr("<b>Device name : </b> Ipaq" ); |
178 | infoString += QString("<br><b>" + tr("MAC adress: ") +"</b> No idea"); | ||
179 | infoString += QString("<br><b>" + tr("Class") + "</b> PDA"); | ||
180 | |||
181 | return (infoString); | ||
132 | 182 | ||
@@ -157,2 +207,6 @@ namespace OpieTooth { | |||
157 | 207 | ||
208 | /* | ||
209 | * Add fresh found devices from scan dialog to the listing | ||
210 | * | ||
211 | */ | ||
158 | void BlueBase::addSearchedDevices( QList<RemoteDevice> &newDevices ) { | 212 | void BlueBase::addSearchedDevices( QList<RemoteDevice> &newDevices ) { |
@@ -167,3 +221,10 @@ namespace OpieTooth { | |||
167 | RemoteDevice *dev = it.current(); | 221 | RemoteDevice *dev = it.current(); |
168 | deviceItem = new QListViewItem( ListView4, dev->name() ); | 222 | deviceItem = new QListViewItem( ListView2, dev->name() ); |
223 | |||
224 | if (deviceActive( dev ) ) { | ||
225 | deviceItem->setPixmap(0, onPix); | ||
226 | } else { | ||
227 | deviceItem->setPixmap(0, offPix); | ||
228 | } | ||
229 | |||
169 | deviceItem->setText(1, dev->mac() ); | 230 | deviceItem->setText(1, dev->mac() ); |
@@ -173,2 +234,39 @@ namespace OpieTooth { | |||
173 | 234 | ||
235 | /* | ||
236 | * Action that is toggled on entrys on click | ||
237 | */ | ||
238 | void BlueBase::startServiceActionClicked( QListViewItem * item ) { | ||
239 | |||
240 | |||
241 | } | ||
242 | |||
243 | /* | ||
244 | * Action that are toggled on hold (mostly QPopups i guess) | ||
245 | */ | ||
246 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column) { | ||
247 | |||
248 | |||
249 | } | ||
250 | |||
251 | /* | ||
252 | * Search and display avail. services for a device (on expand from device listing) | ||
253 | * | ||
254 | */ | ||
255 | void BlueBase::addServicesToDevice( QListViewItem * item ) { | ||
256 | // row of mac adress | ||
257 | RemoteDevice *device = new RemoteDevice(item->text(1), item->text(0)); | ||
258 | //dann nen manager und darauf dann searchServises, das liefert nen signal, das wieder connected | ||
259 | // werden muss. | ||
260 | |||
261 | // delete | ||
262 | } | ||
263 | |||
264 | /* | ||
265 | * Find out if a device can currently be reached | ||
266 | */ | ||
267 | bool BlueBase::deviceActive( RemoteDevice *device ) { | ||
268 | |||
269 | return true; | ||
270 | } | ||
271 | |||
174 | /** | 272 | /** |
@@ -177,2 +275,3 @@ namespace OpieTooth { | |||
177 | void BlueBase::startScan() { | 275 | void BlueBase::startScan() { |
276 | |||
178 | ScanDialog *scan = new ScanDialog( this, "", true); | 277 | ScanDialog *scan = new ScanDialog( this, "", true); |
@@ -184,2 +283,7 @@ namespace OpieTooth { | |||
184 | 283 | ||
284 | |||
285 | void BlueBase::setInfo() { | ||
286 | StatusLabel->setText(getStatus()); | ||
287 | } | ||
288 | |||
185 | /** | 289 | /** |