Diffstat (limited to 'noncore/net/opietooth/manager') (more/less context) (ignore whitespace changes)
-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 | |||
@@ -26,6 +26,7 @@ namespace OpieTooth { | |||
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 |
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 | |||
@@ -8,7 +8,7 @@ HEADERS = btconnectionitem.h btdeviceitem.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 \ |
@@ -18,7 +18,7 @@ SOURCES = btconnectionitem.cpp btdeviceitem.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 |
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,6 +1,5 @@ | |||
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; |
@@ -10,7 +9,6 @@ PopupHelper::PopupHelper() { | |||
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 ) { |
@@ -33,4 +31,5 @@ void PopupHelper::init() { | |||
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 | |||
@@ -13,6 +13,7 @@ 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 |