author | harlekin <harlekin> | 2002-06-23 16:18:52 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-23 16:18:52 (UTC) |
commit | 5cf97227889d00e366782d466eef5eafe1d73e5c (patch) (unidiff) | |
tree | 3a89e3db99b1ec45f69ec4bf6688fdb45eeab9a7 | |
parent | 6382b7352205a71557bd87b4f43d7f19f7f3330e (diff) | |
download | opie-5cf97227889d00e366782d466eef5eafe1d73e5c.zip opie-5cf97227889d00e366782d466eef5eafe1d73e5c.tar.gz opie-5cf97227889d00e366782d466eef5eafe1d73e5c.tar.bz2 |
little update
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 69 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.h | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.cpp | 3 |
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 | |||
@@ -36,4 +36,5 @@ | |||
36 | #include <qlistview.h> | 36 | #include <qlistview.h> |
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qpopupmenu.h> | ||
38 | 39 | ||
39 | #include <qpe/resource.h> | 40 | #include <qpe/resource.h> |
@@ -53,8 +54,11 @@ namespace OpieTooth { | |||
53 | connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); | 54 | connect( PushButton2, SIGNAL( clicked() ), this, SLOT(startScan() ) ); |
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 ) ), |
60 | this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); | 64 | this, SLOT( addServicesToDevice( const QString& , Services::ValueList ) ) ); |
@@ -63,5 +67,4 @@ namespace OpieTooth { | |||
63 | //Load all icons needed | 67 | //Load all icons needed |
64 | 68 | ||
65 | |||
66 | offPix = Resource::loadPixmap( "editdelete" ); | 69 | offPix = Resource::loadPixmap( "editdelete" ); |
67 | onPix = Resource::loadPixmap( "installed" ); | 70 | onPix = Resource::loadPixmap( "installed" ); |
@@ -85,4 +88,5 @@ namespace OpieTooth { | |||
85 | QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" ); | 88 | QListViewItem *topLV2 = new QListViewItem( ListView2, "Siemens S45" , "no" ); |
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" ); |
88 | (void) new QListViewItem( topLV2, "BlueNiC" ); | 92 | (void) new QListViewItem( topLV2, "BlueNiC" ); |
@@ -252,4 +256,6 @@ namespace OpieTooth { | |||
252 | 256 | ||
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 | ||
255 | // ggf auch hier? | 261 | // ggf auch hier? |
@@ -272,4 +278,36 @@ namespace OpieTooth { | |||
272 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column ) { | 278 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column ) { |
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 | } |
275 | 313 | ||
@@ -281,5 +319,5 @@ namespace OpieTooth { | |||
281 | 319 | ||
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) ); |
285 | 323 | ||
@@ -302,9 +340,9 @@ namespace OpieTooth { | |||
302 | qDebug("fill services list"); | 340 | qDebug("fill services list"); |
303 | 341 | ||
304 | |||
305 | QMap<QString,QListViewItem*>::Iterator it; | 342 | QMap<QString,QListViewItem*>::Iterator it; |
306 | 343 | ||
307 | QListViewItem* deviceItem; | 344 | QListViewItem* deviceItem; |
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 ) { |
310 | if ( it.key() == device ) { | 348 | if ( it.key() == device ) { |
@@ -313,10 +351,27 @@ namespace OpieTooth { | |||
313 | } | 351 | } |
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; |
316 | 364 | ||
317 | QListViewItem * serviceItem; | 365 | QListViewItem * serviceItem; |
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 | } |
322 | } | 377 | } |
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 | |||
@@ -72,5 +72,5 @@ namespace OpieTooth { | |||
72 | void addConnectedDevices(); | 72 | void addConnectedDevices(); |
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(); |
76 | 76 | ||
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 | |||
@@ -118,4 +118,7 @@ namespace OpieTooth { | |||
118 | progressStat = 0; | 118 | progressStat = 0; |
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 ); |
121 | deviceItem2->setText(1, "BLAH" ); | 124 | deviceItem2->setText(1, "BLAH" ); |