summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-06-23 16:18:52 (UTC)
committer harlekin <harlekin>2002-06-23 16:18:52 (UTC)
commit5cf97227889d00e366782d466eef5eafe1d73e5c (patch) (unidiff)
tree3a89e3db99b1ec45f69ec4bf6688fdb45eeab9a7
parent6382b7352205a71557bd87b4f43d7f19f7f3330e (diff)
downloadopie-5cf97227889d00e366782d466eef5eafe1d73e5c.zip
opie-5cf97227889d00e366782d466eef5eafe1d73e5c.tar.gz
opie-5cf97227889d00e366782d466eef5eafe1d73e5c.tar.bz2
little update
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp69
-rw-r--r--noncore/net/opietooth/manager/bluebase.h2
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp3
3 files changed, 66 insertions, 8 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index cc51405..772dbd1 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -37,2 +37,3 @@
37#include <qdir.h> 37#include <qdir.h>
38#include <qpopupmenu.h>
38 39
@@ -54,6 +55,9 @@ namespace OpieTooth {
54 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) ); 55 connect( configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges() ) );
55 connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ), 56 // not good since lib is async
56 this, SLOT( addServicesToDevice( QListViewItem * ) ) ); 57 // connect( ListView2, SIGNAL( expanded ( QListViewItem* ) ),
58 // this, SLOT( addServicesToDevice( QListViewItem * ) ) );
57 connect( ListView2, SIGNAL( clicked( QListViewItem* )), 59 connect( ListView2, SIGNAL( clicked( QListViewItem* )),
58 this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); 60 this, SLOT( startServiceActionClicked( QListViewItem* ) ) );
61 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ),
62 this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) );
59 connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), 63 connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ),
@@ -64,3 +68,2 @@ namespace OpieTooth {
64 68
65
66 offPix = Resource::loadPixmap( "editdelete" ); 69 offPix = Resource::loadPixmap( "editdelete" );
@@ -86,2 +89,3 @@ namespace OpieTooth {
86 topLV2->setPixmap( 1, onPix ); 89 topLV2->setPixmap( 1, onPix );
90 topLV2->setText(4, "device" );
87 (void) new QListViewItem( topLV2, "Serial" ); 91 (void) new QListViewItem( topLV2, "Serial" );
@@ -253,2 +257,4 @@ namespace OpieTooth {
253 deviceItem->setText( 3, dev->mac() ); 257 deviceItem->setText( 3, dev->mac() );
258 // what kind of entry is it.
259 deviceItem->setText( 4, "device");
254 260
@@ -273,2 +279,34 @@ namespace OpieTooth {
273 279
280 QPopupMenu *menu = new QPopupMenu();
281 QPopupMenu *groups = new QPopupMenu();
282 int ret=0;
283
284 //QSize s = menu->sizeHint ( );
285
286 if ( item->text(4) == "device") {
287 menu->insertItem( tr("rescan sevices:"), 0);
288 menu->insertItem( tr("to group"), groups , 1);
289 menu->insertItem( tr("delete"), 2);
290 } else if ( item->text(4) == "service") {
291 menu->insertItem( tr("Test1:"), 0);
292 menu->insertItem( tr("connect"), 1);
293 menu->insertItem( tr("delete"), 2);
294 }
295
296 ret = menu->exec( point , 0);
297
298// noch differenzieren
299 switch(ret) {
300 case 0:
301 break;
302 case 1:
303 break;
304 case 2:
305 // delete childs too
306 delete item;
307 break;
308 }
309
310 delete menu;
311 delete groups;
274 } 312 }
@@ -282,3 +320,3 @@ namespace OpieTooth {
282 qDebug("addServicesToDevice"); 320 qDebug("addServicesToDevice");
283 // row of mac adress 321 // row of mac adress text(3)
284 RemoteDevice *device = new RemoteDevice( item->text(3), item->text(0) ); 322 RemoteDevice *device = new RemoteDevice( item->text(3), item->text(0) );
@@ -303,3 +341,2 @@ namespace OpieTooth {
303 341
304
305 QMap<QString,QListViewItem*>::Iterator it; 342 QMap<QString,QListViewItem*>::Iterator it;
@@ -308,2 +345,3 @@ namespace OpieTooth {
308 345
346 // get the right devices which requested the search
309 for( it = deviceList.begin(); it != deviceList.end(); ++it ) { 347 for( it = deviceList.begin(); it != deviceList.end(); ++it ) {
@@ -314,2 +352,12 @@ namespace OpieTooth {
314 352
353
354 // empty entries
355 // QListViewItem * myChild = deviceItem->firstChild();
356 //QList<QListViewItem*> tmpList;
357 //while( myChild ) {
358 // tmpList.append(myChild);
359 // myChild = myChild->nextSibling();
360 // }
361
362
315 QValueList<OpieTooth::Services>::Iterator it2; 363 QValueList<OpieTooth::Services>::Iterator it2;
@@ -318,4 +366,11 @@ namespace OpieTooth {
318 366
319 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) { 367 if (!servicesList.isEmpty() ) {
320 serviceItem = new QListViewItem( deviceItem , (*it2).serviceName() ); 368 // add services
369 for( it2 = servicesList.begin(); it2 != servicesList.end(); ++it2 ) {
370 serviceItem = new QListViewItem( deviceItem , (*it2).serviceName() );
371 serviceItem->setText(4, "service");
372 }
373 } else {
374 serviceItem = new QListViewItem( deviceItem , tr("no services found") );
375 serviceItem->setText(4, "service");
321 } 376 }
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 99d2fa6..bc48bb3 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -73,3 +73,3 @@ namespace OpieTooth {
73 void startServiceActionClicked( QListViewItem *item ); 73 void startServiceActionClicked( QListViewItem *item );
74 void startServiceActionHold( QListViewItem *item, const QPoint &point, int column); 74 void startServiceActionHold( QListViewItem *, const QPoint &, int );
75 void applyConfigChanges(); 75 void applyConfigChanges();
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index 9520e73..0e6e93b 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -119,2 +119,5 @@ namespace OpieTooth {
119 119
120 // empty list before a new scan
121 ListView1->clear();
122
120 QCheckListItem *deviceItem2 = new QCheckListItem( ListView1, "Test1", QCheckListItem::CheckBox ); 123 QCheckListItem *deviceItem2 = new QCheckListItem( ListView1, "Test1", QCheckListItem::CheckBox );