author | harlekin <harlekin> | 2002-07-21 20:02:13 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-07-21 20:02:13 (UTC) |
commit | 086b00610edfb25fb25cf54a0f8da8a16b55246a (patch) (unidiff) | |
tree | e16de393854040440ebc5ceeb6cbd48b27aff605 /noncore/net | |
parent | 8abe7e0604c930cbb46308febeec67d5bf70d255 (diff) | |
download | opie-086b00610edfb25fb25cf54a0f8da8a16b55246a.zip opie-086b00610edfb25fb25cf54a0f8da8a16b55246a.tar.gz opie-086b00610edfb25fb25cf54a0f8da8a16b55246a.tar.bz2 |
connection to popups on services
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 15 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/btdeviceitem.h | 4 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/manager.pro | 5 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/obexdialog.cpp | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/obexdialog.h | 5 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/popuphelper.cpp | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/popuphelper.h | 4 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/pppdialog.cpp | 2 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/pppdialog.h | 5 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/stdpopups.cpp | 11 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/stdpopups.h | 7 |
11 files changed, 39 insertions, 23 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index c81d4d1..ec05a95 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp | |||
@@ -282,12 +282,14 @@ void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) { | |||
282 | 282 | ||
283 | 283 | ||
284 | /** | 284 | /** |
285 | * Action that are toggled on hold (mostly QPopups i guess) | 285 | * Action that are toggled on hold (mostly QPopups i guess) |
286 | */ | 286 | */ |
287 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { | 287 | void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) { |
288 | if (!item ) | ||
289 | return; | ||
288 | 290 | ||
289 | QPopupMenu *menu = new QPopupMenu(); | 291 | QPopupMenu *menu = new QPopupMenu(); |
290 | int ret=0; | 292 | int ret=0; |
291 | 293 | ||
292 | if ( ((BTListItem*)item)->type() == "device") { | 294 | if ( ((BTListItem*)item)->type() == "device") { |
293 | 295 | ||
@@ -339,15 +341,15 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
339 | BTServiceItem* service = (BTServiceItem*)item; | 341 | BTServiceItem* service = (BTServiceItem*)item; |
340 | QMap<int, QString> list = service->services().classIdList(); | 342 | QMap<int, QString> list = service->services().classIdList(); |
341 | QMap<int, QString>::Iterator it = list.begin(); | 343 | QMap<int, QString>::Iterator it = list.begin(); |
342 | QPopupMenu *popup =0l; | 344 | QPopupMenu *popup =0l; |
343 | if ( it != list.end() ) { | 345 | if ( it != list.end() ) { |
344 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); | 346 | qWarning("Searching id %d %s", it.key(), it.data().latin1() ); |
345 | popup = m_popHelper.find( it.key(), | 347 | popup = m_popHelper.find( it.key() /*1*/, |
346 | service->services(), | 348 | service->services(), |
347 | service->parent() ); | 349 | (BTDeviceItem*)service->parent() ); |
348 | }else { | 350 | }else { |
349 | qWarning("Empty"); | 351 | qWarning("Empty"); |
350 | } | 352 | } |
351 | 353 | ||
352 | if ( popup == 0l ) { | 354 | if ( popup == 0l ) { |
353 | qWarning("factory returned 0l"); | 355 | qWarning("factory returned 0l"); |
@@ -356,23 +358,24 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin | |||
356 | 358 | ||
357 | int test1 = popup->insertItem( tr("Test1:"), 0); | 359 | int test1 = popup->insertItem( tr("Test1:"), 0); |
358 | int con = popup->insertItem( tr("connect"), 1); | 360 | int con = popup->insertItem( tr("connect"), 1); |
359 | int del = popup->insertItem( tr("delete"), 2); | 361 | int del = popup->insertItem( tr("delete"), 2); |
360 | 362 | ||
361 | ret = popup->exec( point ); | 363 | ret = popup->exec( point ); |
362 | 364 | qWarning("returned from exec() "); | |
363 | if ( ret == -1 ) | 365 | if ( ret == -1 ) |
364 | delete popup; | 366 | ; |
365 | else if ( ret == test1 ) | 367 | else if ( ret == test1 ) |
366 | delete popup; | 368 | ; |
367 | else if ( ret == con ) | 369 | else if ( ret == con ) |
368 | delete popup; | 370 | ; |
369 | else if ( ret == del ) { | 371 | else if ( ret == del ) { |
370 | // take item first? -zecke | 372 | // take item first? -zecke |
371 | delete item; | 373 | delete item; |
372 | } | 374 | } |
375 | delete popup; | ||
373 | } | 376 | } |
374 | delete menu; | 377 | delete menu; |
375 | } | 378 | } |
376 | 379 | ||
377 | 380 | ||
378 | /** | 381 | /** |
diff --git a/noncore/net/opietooth/manager/btdeviceitem.h b/noncore/net/opietooth/manager/btdeviceitem.h index ae51483..e4c6ce7 100644 --- a/noncore/net/opietooth/manager/btdeviceitem.h +++ b/noncore/net/opietooth/manager/btdeviceitem.h | |||
@@ -1,9 +1,9 @@ | |||
1 | 1 | ||
2 | #ifndef OPIE_TOOTH_BT_DEVIVE_ITEM | 2 | #ifndef OPIE_TOOTH_BT_DEVICE_ITEM |
3 | #define OPIE_TOOTH_BT_DEVIVE_ITEM | 3 | #define OPIE_TOOTH_BT_DEVICE_ITEM |
4 | 4 | ||
5 | 5 | ||
6 | #include <remotedevice.h> | 6 | #include <remotedevice.h> |
7 | #include "btlistitem.h" | 7 | #include "btlistitem.h" |
8 | 8 | ||
9 | namespace OpieTooth { | 9 | namespace OpieTooth { |
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro index 762b028..121c069 100644 --- a/noncore/net/opietooth/manager/manager.pro +++ b/noncore/net/opietooth/manager/manager.pro | |||
@@ -4,21 +4,22 @@ CONFIG = qt warn_on debug | |||
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 | 10 | devicehandler.h rfcpopup.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 | INCLUDEPATH += $(OPIEDIR)/include | 20 | INCLUDEPATH += $(OPIEDIR)/include |
20 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib | 21 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib |
21 | DEPENDPATH += $(OPIEDIR)/include | 22 | DEPENDPATH += $(OPIEDIR)/include |
22 | LIBS += -lqpe -lopietooth -lopie | 23 | LIBS += -lqpe -lopietooth -lopie |
23 | INTERFACES = bluetoothbase.ui devicedialog.ui | 24 | INTERFACES = bluetoothbase.ui devicedialog.ui |
24 | DESTDIR = $(OPIEDIR)/bin | 25 | DESTDIR = $(OPIEDIR)/bin |
diff --git a/noncore/net/opietooth/manager/obexdialog.cpp b/noncore/net/opietooth/manager/obexdialog.cpp index cb142eb..15973d4 100644 --- a/noncore/net/opietooth/manager/obexdialog.cpp +++ b/noncore/net/opietooth/manager/obexdialog.cpp | |||
@@ -9,12 +9,14 @@ | |||
9 | 9 | ||
10 | #include <qpe/resource.h> | 10 | #include <qpe/resource.h> |
11 | 11 | ||
12 | #include <opie/oprocess.h> | 12 | #include <opie/oprocess.h> |
13 | #include <opie/ofiledialog.h> | 13 | #include <opie/ofiledialog.h> |
14 | 14 | ||
15 | using namespace OpieTooth; | ||
16 | |||
15 | ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) | 17 | ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) |
16 | : QDialog( parent, name, modal, fl ) { | 18 | : QDialog( parent, name, modal, fl ) { |
17 | 19 | ||
18 | if ( !name ) | 20 | if ( !name ) |
19 | setName( "ObexDialog" ); | 21 | setName( "ObexDialog" ); |
20 | setCaption( tr( "beam files " ) ) ; | 22 | setCaption( tr( "beam files " ) ) ; |
diff --git a/noncore/net/opietooth/manager/obexdialog.h b/noncore/net/opietooth/manager/obexdialog.h index 1a73b57..28d2be2 100644 --- a/noncore/net/opietooth/manager/obexdialog.h +++ b/noncore/net/opietooth/manager/obexdialog.h | |||
@@ -7,12 +7,15 @@ | |||
7 | 7 | ||
8 | class QVBoxLayout; | 8 | class QVBoxLayout; |
9 | class QPushButton; | 9 | class QPushButton; |
10 | class QMultiLineEdit; | 10 | class QMultiLineEdit; |
11 | class QLineEdit; | 11 | class QLineEdit; |
12 | 12 | ||
13 | |||
14 | namespace OpieTooth { | ||
15 | |||
13 | class ObexDialog : public QDialog { | 16 | class ObexDialog : public QDialog { |
14 | 17 | ||
15 | Q_OBJECT | 18 | Q_OBJECT |
16 | 19 | ||
17 | public: | 20 | public: |
18 | 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 = FALSE, WFlags fl = 0, const QString& device = 0); |
@@ -29,8 +32,8 @@ protected: | |||
29 | QLineEdit* chNameLine; | 32 | QLineEdit* chNameLine; |
30 | QPushButton* sendButton; | 33 | QPushButton* sendButton; |
31 | private: | 34 | private: |
32 | // Device that is used | 35 | // Device that is used |
33 | QString m_device; | 36 | QString m_device; |
34 | }; | 37 | }; |
35 | 38 | } | |
36 | #endif | 39 | #endif |
diff --git a/noncore/net/opietooth/manager/popuphelper.cpp b/noncore/net/opietooth/manager/popuphelper.cpp index ba91e04..4a4daf2 100644 --- a/noncore/net/opietooth/manager/popuphelper.cpp +++ b/noncore/net/opietooth/manager/popuphelper.cpp | |||
@@ -14,13 +14,13 @@ PopupHelper::~PopupHelper() { | |||
14 | } | 14 | } |
15 | 15 | ||
16 | void PopupHelper::insert( int id, popupFactory fact ) { | 16 | void PopupHelper::insert( int id, popupFactory fact ) { |
17 | m_map.insert(id, fact ); | 17 | m_map.insert(id, fact ); |
18 | } | 18 | } |
19 | 19 | ||
20 | QPopupMenu* PopupHelper::find( int id, const Services& ser, QListViewItem* item ) { | 20 | QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) { |
21 | //qWarning("find"); | 21 | //qWarning("find"); |
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); |
diff --git a/noncore/net/opietooth/manager/popuphelper.h b/noncore/net/opietooth/manager/popuphelper.h index 7541ac5..6d4d413 100644 --- a/noncore/net/opietooth/manager/popuphelper.h +++ b/noncore/net/opietooth/manager/popuphelper.h | |||
@@ -6,20 +6,20 @@ | |||
6 | #include <qpopupmenu.h> | 6 | #include <qpopupmenu.h> |
7 | #include <qmap.h> | 7 | #include <qmap.h> |
8 | 8 | ||
9 | #include <services.h> | 9 | #include <services.h> |
10 | 10 | ||
11 | namespace OpieTooth { | 11 | namespace OpieTooth { |
12 | typedef QPopupMenu* (*popupFactory)(const Services&, QListViewItem*); | 12 | typedef QPopupMenu* (*popupFactory)(const Services&, BTDeviceItem*); |
13 | typedef QMap<int, popupFactory> FactoryMap; | 13 | typedef QMap<int, popupFactory> FactoryMap; |
14 | class PopupHelper { | 14 | class PopupHelper { |
15 | public: | 15 | public: |
16 | PopupHelper(); | 16 | PopupHelper(); |
17 | ~PopupHelper(); | 17 | ~PopupHelper(); |
18 | void insert( int id, popupFactory fact ); | 18 | void insert( int id, popupFactory fact ); |
19 | QPopupMenu* find( int id, const Services&, QListViewItem* ); | 19 | QPopupMenu* find( int id, const Services&, BTDeviceItem* ); |
20 | private: | 20 | private: |
21 | void init(); | 21 | void init(); |
22 | FactoryMap m_map; | 22 | FactoryMap m_map; |
23 | 23 | ||
24 | }; | 24 | }; |
25 | }; | 25 | }; |
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp index 4d926a5..1f347ce 100644 --- a/noncore/net/opietooth/manager/pppdialog.cpp +++ b/noncore/net/opietooth/manager/pppdialog.cpp | |||
@@ -4,12 +4,14 @@ | |||
4 | #include <qmultilineedit.h> | 4 | #include <qmultilineedit.h> |
5 | #include <qlineedit.h> | 5 | #include <qlineedit.h> |
6 | #include <qlayout.h> | 6 | #include <qlayout.h> |
7 | #include <qlabel.h> | 7 | #include <qlabel.h> |
8 | #include <opie/oprocess.h> | 8 | #include <opie/oprocess.h> |
9 | 9 | ||
10 | using namespace OpieTooth; | ||
11 | |||
10 | PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) | 12 | PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) |
11 | : QDialog( parent, name, modal, fl ) { | 13 | : QDialog( parent, name, modal, fl ) { |
12 | 14 | ||
13 | if ( !name ) | 15 | if ( !name ) |
14 | setName( "PPPDialog" ); | 16 | setName( "PPPDialog" ); |
15 | setCaption( tr( "ppp connection " ) ) ; | 17 | setCaption( tr( "ppp connection " ) ) ; |
diff --git a/noncore/net/opietooth/manager/pppdialog.h b/noncore/net/opietooth/manager/pppdialog.h index b80b73d..6fdc90a 100644 --- a/noncore/net/opietooth/manager/pppdialog.h +++ b/noncore/net/opietooth/manager/pppdialog.h | |||
@@ -7,28 +7,31 @@ | |||
7 | 7 | ||
8 | class QVBoxLayout; | 8 | class QVBoxLayout; |
9 | class QPushButton; | 9 | class QPushButton; |
10 | class QMultiLineEdit; | 10 | class QMultiLineEdit; |
11 | class QLineEdit; | 11 | class QLineEdit; |
12 | 12 | ||
13 | |||
14 | namespace OpieTooth { | ||
15 | |||
13 | class PPPDialog : public QDialog { | 16 | class PPPDialog : public QDialog { |
14 | 17 | ||
15 | Q_OBJECT | 18 | Q_OBJECT |
16 | 19 | ||
17 | public: | 20 | public: |
18 | PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0); | 21 | PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0); |
19 | ~PPPDialog(); | 22 | ~PPPDialog(); |
20 | 23 | ||
21 | |||
22 | private slots: | 24 | private slots: |
23 | void connectToDevice(); | 25 | void connectToDevice(); |
24 | void fillOutPut( OProcess* pppDial, char* cha, int len ); | 26 | void fillOutPut( OProcess* pppDial, char* cha, int len ); |
25 | protected: | 27 | protected: |
26 | QVBoxLayout* layout; | 28 | QVBoxLayout* layout; |
27 | QLineEdit* cmdLine; | 29 | QLineEdit* cmdLine; |
28 | QPushButton* connectButton; | 30 | QPushButton* connectButton; |
29 | QMultiLineEdit* outPut; | 31 | QMultiLineEdit* outPut; |
30 | 32 | ||
31 | private: | 33 | private: |
32 | QString m_device; | 34 | QString m_device; |
33 | }; | 35 | }; |
36 | } | ||
34 | #endif | 37 | #endif |
diff --git a/noncore/net/opietooth/manager/stdpopups.cpp b/noncore/net/opietooth/manager/stdpopups.cpp index 2290b9a..750365e 100644 --- a/noncore/net/opietooth/manager/stdpopups.cpp +++ b/noncore/net/opietooth/manager/stdpopups.cpp | |||
@@ -1,16 +1,15 @@ | |||
1 | 1 | ||
2 | //#include "rfccompopup.h" | 2 | #include "rfcpopup.h" |
3 | 3 | ||
4 | #include "stdpopups.h" | 4 | #include "stdpopups.h" |
5 | 5 | ||
6 | extern "C" { | 6 | extern "C" { |
7 | 7 | ||
8 | QPopupMenu* newRfcComPopup( const OpieTooth::Services& servive, QListViewItem* item ) { | 8 | QPopupMenu* newRfcComPopup( const OpieTooth::Services& servive, OpieTooth::BTDeviceItem* item ) { |
9 | // return OpieTooth::RfcComPopup( servive, item ); | 9 | return new OpieTooth::RfcCommPopup(/* servive, item*/ ); // fix spellin RfComm vs. RfcComm and paramaters |
10 | return 0l; | 10 | //return 0l; |
11 | } | 11 | } |
12 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, QListViewItem* ) { | 12 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ) { |
13 | return 0l; | 13 | return 0l; |
14 | } | 14 | } |
15 | |||
16 | } | 15 | } |
diff --git a/noncore/net/opietooth/manager/stdpopups.h b/noncore/net/opietooth/manager/stdpopups.h index 185d68d..b57d4de 100644 --- a/noncore/net/opietooth/manager/stdpopups.h +++ b/noncore/net/opietooth/manager/stdpopups.h | |||
@@ -4,12 +4,15 @@ | |||
4 | 4 | ||
5 | #include <qlistview.h> | 5 | #include <qlistview.h> |
6 | #include <qpopupmenu.h> | 6 | #include <qpopupmenu.h> |
7 | 7 | ||
8 | #include <services.h> | 8 | #include <services.h> |
9 | 9 | ||
10 | #include "btdeviceitem.h" | ||
11 | |||
10 | extern "C" { | 12 | extern "C" { |
11 | QPopupMenu* newRfcComPopup( const OpieTooth::Services&, QListViewItem* ); | 13 | |
12 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, QListViewItem* ); | 14 | QPopupMenu* newRfcComPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ); |
15 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ); | ||
13 | } | 16 | } |
14 | 17 | ||
15 | #endif | 18 | #endif |