-rw-r--r-- | noncore/net/opietooth/manager/bticonloader.cpp | 1 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/manager.pro | 4 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/panpopup.cpp | 70 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/panpopup.h | 32 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/popuphelper.cpp | 3 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/stdpopups.cpp | 7 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/stdpopups.h | 1 |
7 files changed, 113 insertions, 5 deletions
diff --git a/noncore/net/opietooth/manager/bticonloader.cpp b/noncore/net/opietooth/manager/bticonloader.cpp index a26af54..e5d8092 100644 --- a/noncore/net/opietooth/manager/bticonloader.cpp +++ b/noncore/net/opietooth/manager/bticonloader.cpp | |||
@@ -21,16 +21,17 @@ namespace OpieTooth { | |||
21 | serviceIcons.insert( 4369 , "print_16" ); //Fax | 21 | serviceIcons.insert( 4369 , "print_16" ); //Fax |
22 | serviceIcons.insert( 4353 , "serial_16" ); //SerialPort | 22 | serviceIcons.insert( 4353 , "serial_16" ); //SerialPort |
23 | serviceIcons.insert( 4356 , "sync_16" ); //IrMCSync | 23 | serviceIcons.insert( 4356 , "sync_16" ); //IrMCSync |
24 | serviceIcons.insert( 4359 , "sync_16" ); //IrMCSyncCommand | 24 | serviceIcons.insert( 4359 , "sync_16" ); //IrMCSyncCommand |
25 | serviceIcons.insert( 4354 , "network_16" ); //LANAccessUsingPPP | 25 | serviceIcons.insert( 4354 , "network_16" ); //LANAccessUsingPPP |
26 | serviceIcons.insert( 4355 , "network_16"); //DialupNetworking | 26 | serviceIcons.insert( 4355 , "network_16"); //DialupNetworking |
27 | serviceIcons.insert( 4360 , "phone_16"); // Headset | 27 | serviceIcons.insert( 4360 , "phone_16"); // Headset |
28 | serviceIcons.insert( 4370 , "audio_16"); //HeadsetAudioGateway | 28 | serviceIcons.insert( 4370 , "audio_16"); //HeadsetAudioGateway |
29 | serviceIcons.insert( 4374 , "network_16"); // Network Access Point | ||
29 | serviceIcons.insert( 4361 , "phone_16"); // CordlessTelephony | 30 | serviceIcons.insert( 4361 , "phone_16"); // CordlessTelephony |
30 | serviceIcons.insert( 4362 , "audio_16"); // AudioSource | 31 | serviceIcons.insert( 4362 , "audio_16"); // AudioSource |
31 | serviceIcons.insert( 4363 , "audio_16"); // AudioSink | 32 | serviceIcons.insert( 4363 , "audio_16"); // AudioSink |
32 | serviceIcons.insert( 4390 , "print_16" ); //HCR_Print | 33 | serviceIcons.insert( 4390 , "print_16" ); //HCR_Print |
33 | serviceIcons.insert( 4392 , "phone_16" ); //Common_ISDN_Access | 34 | serviceIcons.insert( 4392 , "phone_16" ); //Common_ISDN_Access |
34 | 35 | ||
35 | serviceIcons.insert( 4609 , "network_16" ); //GenericNetworking | 36 | serviceIcons.insert( 4609 , "network_16" ); //GenericNetworking |
36 | serviceIcons.insert( 4610 , "folder_16" ); //GenericFileTransfer | 37 | serviceIcons.insert( 4610 , "folder_16" ); //GenericFileTransfer |
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro index 9249d8d..f813e65 100644 --- a/noncore/net/opietooth/manager/manager.pro +++ b/noncore/net/opietooth/manager/manager.pro | |||
@@ -3,27 +3,27 @@ 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 obexpopup.h \ | 10 | devicehandler.h rfcpopup.h obexpopup.h \ |
11 | rfcommhelper.h | 11 | rfcommhelper.h panpopup.h |
12 | 12 | ||
13 | SOURCES = btconnectionitem.cpp btdeviceitem.cpp \ | 13 | SOURCES = btconnectionitem.cpp btdeviceitem.cpp \ |
14 | btserviceitem.cpp stdpopups.cpp \ | 14 | btserviceitem.cpp stdpopups.cpp \ |
15 | popuphelper.cpp main.cpp \ | 15 | popuphelper.cpp main.cpp \ |
16 | bluebase.cpp scandialog.cpp \ | 16 | bluebase.cpp scandialog.cpp \ |
17 | btlistitem.cpp hciconfwrapper.cpp \ | 17 | btlistitem.cpp hciconfwrapper.cpp \ |
18 | bticonloader.cpp pppdialog.cpp \ | 18 | bticonloader.cpp pppdialog.cpp \ |
19 | obexdialog.cpp devicehandler.cpp \ | 19 | obexdialog.cpp devicehandler.cpp \ |
20 | rfcpopup.cpp obexpopup.cpp \ | 20 | rfcpopup.cpp obexpopup.cpp \ |
21 | rfcommhelper.cpp | 21 | rfcommhelper.cpp panpopup.cpp |
22 | INCLUDEPATH += $(OPIEDIR)/include | 22 | INCLUDEPATH += $(OPIEDIR)/include |
23 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib | 23 | INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib |
24 | DEPENDPATH += $(OPIEDIR)/include | 24 | DEPENDPATH += $(OPIEDIR)/include |
25 | LIBS += -lqpe -lopietooth -lopie | 25 | LIBS += -lqpe -lopietooth -lopie |
26 | INTERFACES = bluetoothbase.ui devicedialog.ui | 26 | INTERFACES = bluetoothbase.ui devicedialog.ui |
27 | DESTDIR = $(OPIEDIR)/bin | 27 | DESTDIR = $(OPIEDIR)/bin |
28 | TARGET = bluetooth-manager | 28 | TARGET = bluetooth-manager |
29 | 29 | ||
diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp new file mode 100644 index 0000000..d3d1347 --- a/dev/null +++ b/noncore/net/opietooth/manager/panpopup.cpp | |||
@@ -0,0 +1,70 @@ | |||
1 | #include <qpe/qcopenvelope_qws.h> | ||
2 | |||
3 | #include <qtimer.h> | ||
4 | |||
5 | #include "panpopup.h" | ||
6 | |||
7 | using namespace OpieTooth; | ||
8 | |||
9 | /* | ||
10 | * c'tor init the QAction | ||
11 | */ | ||
12 | PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { | ||
13 | |||
14 | qWarning("PanPopup c'tor"); | ||
15 | |||
16 | m_item = item; | ||
17 | m_panconnect = 0l; | ||
18 | QAction *a, *b; | ||
19 | |||
20 | /* connect action */ | ||
21 | a = new QAction( ); // so it's get deleted | ||
22 | a->setText( "connect" ); | ||
23 | a->addTo( this ); | ||
24 | connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) ); | ||
25 | |||
26 | b = new QAction(); | ||
27 | b->setText( "connect+conf" ); | ||
28 | b->addTo( this ); | ||
29 | connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) ); | ||
30 | }; | ||
31 | |||
32 | PanPopup::~PanPopup() { | ||
33 | delete m_panconnect; | ||
34 | } | ||
35 | |||
36 | void PanPopup::slotConnect() { | ||
37 | |||
38 | |||
39 | // SHOULD move to lib | ||
40 | // before pand must be in "pand --listen --role panu" mode ( client ) | ||
41 | |||
42 | m_panconnect = new OProcess(); | ||
43 | *m_panconnect << "pand" << "--connect" << m_item->mac(); | ||
44 | |||
45 | connect( m_panconnect, SIGNAL( processExited( OProcess* ) ) , | ||
46 | this, SLOT( slotConnectExited( OProcess* ) ) ); | ||
47 | connect( m_panconnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ), | ||
48 | this, SLOT( slotConnectOut( OProcess*, char*, int ) ) ); | ||
49 | if (!m_panconnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { | ||
50 | qWarning( "could not start" ); | ||
51 | delete m_panconnect; | ||
52 | } | ||
53 | } | ||
54 | |||
55 | void PanPopup::slotExited( OProcess* proc ) { | ||
56 | delete m_panconnect; | ||
57 | } | ||
58 | |||
59 | void PanPopup::slotStdOut(OProcess* proc, char* chars, int len) | ||
60 | {} | ||
61 | |||
62 | |||
63 | void PanPopup::slotConnectAndConfig() { | ||
64 | slotConnect(); | ||
65 | |||
66 | // more intelligence here later like passing the device ( bnepX ) | ||
67 | QCopEnvelope e( "QPE/System", "execute(QString)" ); | ||
68 | e << QString( "networksetup" ); | ||
69 | |||
70 | } | ||
diff --git a/noncore/net/opietooth/manager/panpopup.h b/noncore/net/opietooth/manager/panpopup.h new file mode 100644 index 0000000..9d99f5e --- a/dev/null +++ b/noncore/net/opietooth/manager/panpopup.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef PANPOPUP_H | ||
2 | #define PANPOPUP_H | ||
3 | |||
4 | #include <qpopupmenu.h> | ||
5 | #include <qaction.h> | ||
6 | #include <opie/oprocess.h> | ||
7 | |||
8 | #include "btdeviceitem.h" | ||
9 | |||
10 | namespace OpieTooth { | ||
11 | |||
12 | class PanPopup : public QPopupMenu { | ||
13 | |||
14 | Q_OBJECT | ||
15 | |||
16 | public: | ||
17 | PanPopup( OpieTooth::BTDeviceItem* ); | ||
18 | ~PanPopup(); | ||
19 | |||
20 | private: | ||
21 | QAction* m_push; | ||
22 | OProcess* m_panconnect; | ||
23 | OpieTooth::BTDeviceItem *m_item; | ||
24 | private slots: | ||
25 | void slotConnect(); | ||
26 | void slotConnectAndConfig(); | ||
27 | void slotExited( OProcess* proc ); | ||
28 | void slotStdOut( OProcess* proc, char* chars, int len ); | ||
29 | }; | ||
30 | }; | ||
31 | |||
32 | #endif | ||
diff --git a/noncore/net/opietooth/manager/popuphelper.cpp b/noncore/net/opietooth/manager/popuphelper.cpp index 1571fab..7da7002 100644 --- a/noncore/net/opietooth/manager/popuphelper.cpp +++ b/noncore/net/opietooth/manager/popuphelper.cpp | |||
@@ -1,21 +1,19 @@ | |||
1 | 1 | ||
2 | #include "stdpopups.h" | 2 | #include "stdpopups.h" |
3 | |||
4 | #include "popuphelper.h" | 3 | #include "popuphelper.h" |
5 | 4 | ||
6 | using namespace OpieTooth; | 5 | using namespace OpieTooth; |
7 | 6 | ||
8 | PopupHelper::PopupHelper() { | 7 | PopupHelper::PopupHelper() { |
9 | init(); | 8 | init(); |
10 | } | 9 | } |
11 | 10 | ||
12 | PopupHelper::~PopupHelper() { | 11 | PopupHelper::~PopupHelper() { |
13 | |||
14 | } | 12 | } |
15 | 13 | ||
16 | void PopupHelper::insert( int id, popupFactory fact ) { | 14 | void PopupHelper::insert( int id, popupFactory fact ) { |
17 | m_map.insert(id, fact ); | 15 | m_map.insert(id, fact ); |
18 | } | 16 | } |
19 | 17 | ||
20 | QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) { | 18 | QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) { |
21 | //qWarning("find"); | 19 | //qWarning("find"); |
@@ -28,9 +26,10 @@ QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) | |||
28 | return 0l; | 26 | return 0l; |
29 | } | 27 | } |
30 | 28 | ||
31 | void PopupHelper::init() { | 29 | void PopupHelper::init() { |
32 | insert( 4355, newRfcComPopup ); | 30 | insert( 4355, newRfcComPopup ); |
33 | insert( 4353, newRfcComPopup ); | 31 | insert( 4353, newRfcComPopup ); |
34 | insert( 4357, newObexPushPopup ); | 32 | insert( 4357, newObexPushPopup ); |
35 | insert( 4358, newObexPushPopup ); | 33 | insert( 4358, newObexPushPopup ); |
34 | insert( 4374, newPanPopup ); | ||
36 | } | 35 | } |
diff --git a/noncore/net/opietooth/manager/stdpopups.cpp b/noncore/net/opietooth/manager/stdpopups.cpp index 3a52334..934e58b 100644 --- a/noncore/net/opietooth/manager/stdpopups.cpp +++ b/noncore/net/opietooth/manager/stdpopups.cpp | |||
@@ -1,16 +1,21 @@ | |||
1 | 1 | ||
2 | #include "rfcpopup.h" | 2 | #include "rfcpopup.h" |
3 | #include "obexpopup.h" | 3 | #include "obexpopup.h" |
4 | #include "panpopup.h" | ||
4 | 5 | ||
5 | #include "stdpopups.h" | 6 | #include "stdpopups.h" |
6 | 7 | ||
7 | extern "C" { | 8 | extern "C" { |
8 | 9 | ||
9 | QPopupMenu* newRfcComPopup( const OpieTooth::Services& servive, OpieTooth::BTDeviceItem* item ) { | 10 | QPopupMenu* newRfcComPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item ) { |
10 | return new OpieTooth::RfcCommPopup(/* servive, item*/ ); // fix spellin RfComm vs. RfcComm and paramaters | 11 | return new OpieTooth::RfcCommPopup(/* servive, item*/ ); // fix spellin RfComm vs. RfcComm and paramaters |
11 | //return 0l; | 12 | //return 0l; |
12 | } | 13 | } |
13 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ) { | 14 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ) { |
14 | return new OpieTooth::ObexPopup(); | 15 | return new OpieTooth::ObexPopup(); |
15 | } | 16 | } |
17 | QPopupMenu* newPanPopup( const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item ) { | ||
18 | return new OpieTooth::PanPopup( item ); | ||
19 | } | ||
16 | } | 20 | } |
21 | |||
diff --git a/noncore/net/opietooth/manager/stdpopups.h b/noncore/net/opietooth/manager/stdpopups.h index b57d4de..7f2f6b3 100644 --- a/noncore/net/opietooth/manager/stdpopups.h +++ b/noncore/net/opietooth/manager/stdpopups.h | |||
@@ -8,11 +8,12 @@ | |||
8 | #include <services.h> | 8 | #include <services.h> |
9 | 9 | ||
10 | #include "btdeviceitem.h" | 10 | #include "btdeviceitem.h" |
11 | 11 | ||
12 | extern "C" { | 12 | extern "C" { |
13 | 13 | ||
14 | QPopupMenu* newRfcComPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ); | 14 | QPopupMenu* newRfcComPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ); |
15 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ); | 15 | QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ); |
16 | QPopupMenu* newPanPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ); | ||
16 | } | 17 | } |
17 | 18 | ||
18 | #endif | 19 | #endif |