author | harlekin <harlekin> | 2003-02-15 22:21:14 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-02-15 22:21:14 (UTC) |
commit | f8bb789cd1d85da9b4a830b5b8a67a6a4ceeee3f (patch) (unidiff) | |
tree | ab71630af2332c9ca9e9a537711b6e0d09614f9b /noncore/net/opietooth | |
parent | 10b6cb1e9262b174ec0d8dc095d9f668f2d3e094 (diff) | |
download | opie-f8bb789cd1d85da9b4a830b5b8a67a6a4ceeee3f.zip opie-f8bb789cd1d85da9b4a830b5b8a67a6a4ceeee3f.tar.gz opie-f8bb789cd1d85da9b4a830b5b8a67a6a4ceeee3f.tar.bz2 |
hacked together pan support, just for my own convenience, the core func should be moved into libopietooth later
-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 | |||
@@ -28,2 +28,3 @@ namespace OpieTooth { | |||
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 |
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 | |||
@@ -10,3 +10,3 @@ HEADERS = btconnectionitem.h btdeviceitem.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 | ||
@@ -20,3 +20,3 @@ SOURCES = btconnectionitem.cpp btdeviceitem.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 |
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 | |||
@@ -2,3 +2,2 @@ | |||
2 | #include "stdpopups.h" | 2 | #include "stdpopups.h" |
3 | |||
4 | #include "popuphelper.h" | 3 | #include "popuphelper.h" |
@@ -12,3 +11,2 @@ PopupHelper::PopupHelper() { | |||
12 | PopupHelper::~PopupHelper() { | 11 | PopupHelper::~PopupHelper() { |
13 | |||
14 | } | 12 | } |
@@ -35,2 +33,3 @@ void PopupHelper::init() { | |||
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 | |||
@@ -3,2 +3,3 @@ | |||
3 | #include "obexpopup.h" | 3 | #include "obexpopup.h" |
4 | #include "panpopup.h" | ||
4 | 5 | ||
@@ -8,3 +9,3 @@ 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 |
@@ -15,2 +16,6 @@ extern "C" { | |||
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 | |||
@@ -15,2 +15,3 @@ extern "C" { | |||
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 | } |