author | harlekin <harlekin> | 2002-07-21 21:51:12 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-07-21 21:51:12 (UTC) |
commit | 14ebec617bad2eb46173c09566c335ec6548b334 (patch) (unidiff) | |
tree | bdccba4c5b812580ed484ed407a4b9cd2c57ca75 /noncore/net | |
parent | 9d54b1e1904a65decd54b6f1b5962bdb9ec26717 (diff) | |
download | opie-14ebec617bad2eb46173c09566c335ec6548b334.zip opie-14ebec617bad2eb46173c09566c335ec6548b334.tar.gz opie-14ebec617bad2eb46173c09566c335ec6548b334.tar.bz2 |
added obex popup and dialog
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 11 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/manager.pro | 4 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/obexdialog.h | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/popuphelper.cpp | 3 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/stdpopups.cpp | 3 |
5 files changed, 14 insertions, 9 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 433bd3a..1fd0ea2 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -288,28 +288,29 @@ void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { | |||
288 | */ | 288 | */ |
289 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { | 289 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { |
290 | if (!item ) | 290 | if (!item ) |
291 | return; | 291 | return; |
292 | 292 | ||
293 | QPopupMenu *menu = new QPopupMenu(); | 293 | QPopupMenu *menu = new QPopupMenu(); |
294 | int ret=0; | 294 | int ret=0; |
295 | 295 | ||
296 | if ( ((BTListItem*)item)->type() == "device") { | 296 | if ( ((BTListItem*)item)->type() == "device") { |
297 | 297 | ||
298 | QPopupMenu *groups = new QPopupMenu(); | 298 | QPopupMenu *groups = new QPopupMenu(); |
299 | 299 | ||
300 | menu->insertItem( tr("rescan sevices:"), 0); | 300 | menu->insertItem( ((BTDeviceItem*)item)->name(),0 ); |
301 | menu->insertItem( tr("to group"), groups , 1); | 301 | menu->insertSeparator(1); |
302 | // menu->insertItem( tr("bound device"), 2); | 302 | menu->insertItem( tr("rescan sevices"), 2); |
303 | menu->insertItem( tr("delete"), 3); | 303 | menu->insertItem( tr("to group"), groups , 3); |
304 | menu->insertItem( tr("delete"), 4); | ||
304 | 305 | ||
305 | ret = menu->exec( point , 0); | 306 | ret = menu->exec( point , 0); |
306 | 307 | ||
307 | switch(ret) { | 308 | switch(ret) { |
308 | case -1: | 309 | case -1: |
309 | break; | 310 | break; |
310 | case 0: | 311 | case 0: |
311 | addServicesToDevice( (BTDeviceItem*)item ); | 312 | addServicesToDevice( (BTDeviceItem*)item ); |
312 | break; | 313 | break; |
313 | case 1: | 314 | case 1: |
314 | 315 | ||
315 | break; | 316 | break; |
@@ -335,24 +336,26 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
335 | * one if the factory returns 0 | 336 | * one if the factory returns 0 |
336 | * PopupMenu deletion is kind of weird. | 337 | * PopupMenu deletion is kind of weird. |
337 | * If escaped( -1 ) or any of our items were chosen we'll | 338 | * If escaped( -1 ) or any of our items were chosen we'll |
338 | * delete the PopupMenu otherwise it's the responsibility of | 339 | * delete the PopupMenu otherwise it's the responsibility of |
339 | * the PopupMenu to delete itself | 340 | * the PopupMenu to delete itself |
340 | * | 341 | * |
341 | */ | 342 | */ |
342 | else if ( ((BTListItem*)item)->type() == "service") { | 343 | else if ( ((BTListItem*)item)->type() == "service") { |
343 | BTServiceItem* service = (BTServiceItem*)item; | 344 | BTServiceItem* service = (BTServiceItem*)item; |
344 | QMap<int, QString> list = service->services().classIdList(); | 345 | QMap<int, QString> list = service->services().classIdList(); |
345 | QMap<int, QString>::Iterator it = list.begin(); | 346 | QMap<int, QString>::Iterator it = list.begin(); |
346 | QPopupMenu *popup =0l; | 347 | QPopupMenu *popup =0l; |
348 | popup->insertItem( (service->services()).serviceName() ); | ||
349 | popup->insertSeparator(); | ||
347 | if ( it != list.end() ) { | 350 | if ( it != list.end() ) { |
348 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); | 351 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); |
349 | popup = m_popHelper.find( it.key() /*1*/, | 352 | popup = m_popHelper.find( it.key() /*1*/, |
350 | service->services(), | 353 | service->services(), |
351 | (BTDeviceItem*)service->parent() ); | 354 | (BTDeviceItem*)service->parent() ); |
352 | }else { | 355 | }else { |
353 | qWarning("Empty"); | 356 | qWarning("Empty"); |
354 | } | 357 | } |
355 | 358 | ||
356 | if ( popup == 0l ) { | 359 | if ( popup == 0l ) { |
357 | qWarning("factory returned 0l"); | 360 | qWarning("factory returned 0l"); |
358 | popup = new QPopupMenu(); | 361 | popup = new QPopupMenu(); |
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro index 121c069..4684c67 100644 --- a/noncore/net/opietooth/manager/manager.pro +++ b/noncore/net/opietooth/manager/manager.pro | |||
@@ -1,31 +1,31 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on debug | 2 | CONFIG = qt warn_on debug |
3 | #CONFIG = qt warn_on release | 3 | #CONFIG = qt warn_on release |
4 | HEADERS = btconnectionitem.h btdeviceitem.h \ | 4 | HEADERS = btconnectionitem.h btdeviceitem.h \ |
5 | btserviceitem.h stdpopups.h \ | 5 | btserviceitem.h stdpopups.h \ |
6 | popuphelper.h bluebase.h \ | 6 | popuphelper.h bluebase.h \ |
7 | scandialog.h btlistitem.h \ | 7 | scandialog.h btlistitem.h \ |
8 | hciconfwrapper.h bticonloader.h \ | 8 | hciconfwrapper.h bticonloader.h \ |
9 | pppdialog.h obexdialog.h \ | 9 | pppdialog.h obexdialog.h \ |
10 | devicehandler.h rfcpopup.h | 10 | devicehandler.h rfcpopup.h obexpopup.h \ |
11 | 11 | ||
12 | SOURCES = btconnectionitem.cpp btdeviceitem.cpp \ | 12 | SOURCES = btconnectionitem.cpp btdeviceitem.cpp \ |
13 | btserviceitem.cpp stdpopups.cpp \ | 13 | btserviceitem.cpp stdpopups.cpp \ |
14 | popuphelper.cpp main.cpp \ | 14 | popuphelper.cpp main.cpp \ |
15 | bluebase.cpp scandialog.cpp \ | 15 | bluebase.cpp scandialog.cpp \ |
16 | btlistitem.cpp hciconfwrapper.cpp \ | 16 | btlistitem.cpp hciconfwrapper.cpp \ |
17 | bticonloader.cpp pppdialog.cpp \ | 17 | bticonloader.cpp pppdialog.cpp \ |
18 | obexdialog.cpp devicehandler.cpp \ | 18 | obexdialog.cpp devicehandler.cpp \ |
19 | rfcpopup.cpp | 19 | rfcpopup.cpp obexpopup.cpp |
20 | INCLUDEPATH += $(OPIEDIR)/include | 20 | INCLUDEPATH += $(OPIEDIR)/include |
21 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib | 21 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib |
22 | DEPENDPATH += $(OPIEDIR)/include | 22 | DEPENDPATH += $(OPIEDIR)/include |
23 | LIBS += -lqpe -lopietooth -lopie | 23 | LIBS += -lqpe -lopietooth -lopie |
24 | INTERFACES = bluetoothbase.ui devicedialog.ui | 24 | INTERFACES = bluetoothbase.ui devicedialog.ui |
25 | DESTDIR = $(OPIEDIR)/bin | 25 | DESTDIR = $(OPIEDIR)/bin |
26 | TARGET = bluetooth-manager | 26 | TARGET = bluetooth-manager |
27 | 27 | ||
28 | TRANSLATIONS = ../../../../i18n/de/bluetooth-manager.ts \ | 28 | TRANSLATIONS = ../../../../i18n/de/bluetooth-manager.ts \ |
29 | ../../../../i18n/en/bluetooth-manager.ts \ | 29 | ../../../../i18n/en/bluetooth-manager.ts \ |
30 | ../../../../i18n/es/bluetooth-manager.ts \ | 30 | ../../../../i18n/es/bluetooth-manager.ts \ |
31 | ../../../../i18n/fr/bluetooth-manager.ts \ | 31 | ../../../../i18n/fr/bluetooth-manager.ts \ |
diff --git a/noncore/net/opietooth/manager/obexdialog.h b/noncore/net/opietooth/manager/obexdialog.h index 28d2be2..b3d5e6d 100644 --- a/noncore/net/opietooth/manager/obexdialog.h +++ b/noncore/net/opietooth/manager/obexdialog.h | |||
@@ -9,25 +9,25 @@ class QVBoxLayout; | |||
9 | class QPushButton; | 9 | class QPushButton; |
10 | class QMultiLineEdit; | 10 | class QMultiLineEdit; |
11 | class QLineEdit; | 11 | class QLineEdit; |
12 | 12 | ||
13 | 13 | ||
14 | namespace OpieTooth { | 14 | namespace OpieTooth { |
15 | 15 | ||
16 | class ObexDialog : public QDialog { | 16 | class ObexDialog : public QDialog { |
17 | 17 | ||
18 | Q_OBJECT | 18 | Q_OBJECT |
19 | 19 | ||
20 | public: | 20 | public: |
21 | ObexDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0); | 21 | ObexDialog( QWidget* parent = 0, const char* name = 0, bool modal = TRUE, WFlags fl = 0, const QString& device = 0); |
22 | ~ObexDialog(); | 22 | ~ObexDialog(); |
23 | 23 | ||
24 | 24 | ||
25 | private slots: | 25 | private slots: |
26 | void browse(); | 26 | void browse(); |
27 | void sendData(); | 27 | void sendData(); |
28 | 28 | ||
29 | protected: | 29 | protected: |
30 | QVBoxLayout* layout; | 30 | QVBoxLayout* layout; |
31 | QLineEdit* cmdLine; | 31 | QLineEdit* cmdLine; |
32 | QLineEdit* chNameLine; | 32 | QLineEdit* chNameLine; |
33 | QPushButton* sendButton; | 33 | QPushButton* sendButton; |
diff --git a/noncore/net/opietooth/manager/popuphelper.cpp b/noncore/net/opietooth/manager/popuphelper.cpp index 4a4daf2..1571fab 100644 --- a/noncore/net/opietooth/manager/popuphelper.cpp +++ b/noncore/net/opietooth/manager/popuphelper.cpp | |||
@@ -22,14 +22,15 @@ QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) | |||
22 | FactoryMap::Iterator it = m_map.find(id ); | 22 | FactoryMap::Iterator it = m_map.find(id ); |
23 | if ( it != m_map.end() ) { | 23 | if ( it != m_map.end() ) { |
24 | //qWarning("found"); | 24 | //qWarning("found"); |
25 | popupFactory fact = it.data(); | 25 | popupFactory fact = it.data(); |
26 | return (*fact)(ser, item); | 26 | return (*fact)(ser, item); |
27 | } | 27 | } |
28 | return 0l; | 28 | return 0l; |
29 | } | 29 | } |
30 | 30 | ||
31 | void PopupHelper::init() { | 31 | void PopupHelper::init() { |
32 | insert( 4355, newRfcComPopup ); | 32 | insert( 4355, newRfcComPopup ); |
33 | insert( 4353, newRfcComPopup ); | 33 | insert( 4353, newRfcComPopup ); |
34 | insert( 3, newObexPushPopup ); | 34 | insert( 4357, newObexPushPopup ); |
35 | insert( 4358, newObexPushPopup ); | ||
35 | } | 36 | } |
diff --git a/noncore/net/opietooth/manager/stdpopups.cpp b/noncore/net/opietooth/manager/stdpopups.cpp index 750365e..3a52334 100644 --- a/noncore/net/opietooth/manager/stdpopups.cpp +++ b/noncore/net/opietooth/manager/stdpopups.cpp | |||
@@ -1,15 +1,16 @@ | |||
1 | 1 | ||
2 | #include "rfcpopup.h" | 2 | #include "rfcpopup.h" |
3 | #include "obexpopup.h" | ||
3 | 4 | ||
4 | #include "stdpopups.h" | 5 | #include "stdpopups.h" |
5 | 6 | ||
6 | extern "C" { | 7 | extern "C" { |
7 | 8 | ||
8 | QPopupMenu* newRfcComPopup( const OpieTooth::Services& servive, OpieTooth::BTDeviceItem* item ) { | 9 | QPopupMenu* newRfcComPopup( const OpieTooth::Services& servive, OpieTooth::BTDeviceItem* item ) { |
9 | return new OpieTooth::RfcCommPopup(/* servive, item*/ ); // fix spellin RfComm vs. RfcComm and paramaters | 10 | return new OpieTooth::RfcCommPopup(/* servive, item*/ ); // fix spellin RfComm vs. RfcComm and paramaters |
10 | //return 0l; | 11 | //return 0l; |
11 | } | 12 | } |
12 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ) { | 13 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ) { |
13 | return 0l; | 14 | return new OpieTooth::ObexPopup(); |
14 | } | 15 | } |
15 | } | 16 | } |