summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/dunpopup.cpp63
-rw-r--r--noncore/net/opietooth/manager/dunpopup.h33
2 files changed, 96 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/dunpopup.cpp b/noncore/net/opietooth/manager/dunpopup.cpp
new file mode 100644
index 0000000..3043f71
--- a/dev/null
+++ b/noncore/net/opietooth/manager/dunpopup.cpp
@@ -0,0 +1,63 @@
1#include <qpe/qcopenvelope_qws.h>
2
3#include <qtimer.h>
4
5#include "dunpopup.h"
6
7using namespace OpieTooth;
8
9/*
10 * c'tor init the QAction
11 */
12DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
13
14 qWarning("DunPopup c'tor");
15
16 m_item = item;
17 QAction *a, *b, *c;
18
19 m_dunconnection = 0l;
20 /* connect action */
21
22
23 a = new QAction(); // so it's get deleted
24 a->setText( tr("connect") );
25 a->addTo( this );
26 connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
27
28
29 b = new QAction();
30 b->setText( tr( "connect+conf" ) );
31 b->addTo( this );
32 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) );
33
34 c = new QAction();
35 c->setText( tr( "disconnect" ) );
36 c->addTo( this );
37 connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
38
39};
40
41DunPopup::~DunPopup() {
42
43}
44
45void DunPopup::slotConnect() {
46
47 m_dunconnection = new StartDunConnection( m_item->mac() );
48 m_dunconnection->start();
49}
50
51void DunPopup::slotDisconnect() {
52 m_dunconnection->stop();
53}
54
55
56void DunPopup::slotConnectAndConfig() {
57 slotConnect();
58
59 // more intelligence here later like passing the device ( bnepX )
60 QCopEnvelope e( "QPE/System", "execute(QString)" );
61 e << QString( "networksettings" );
62
63}
diff --git a/noncore/net/opietooth/manager/dunpopup.h b/noncore/net/opietooth/manager/dunpopup.h
new file mode 100644
index 0000000..c070c56
--- a/dev/null
+++ b/noncore/net/opietooth/manager/dunpopup.h
@@ -0,0 +1,33 @@
1#ifndef DUNPOPUP_H
2#define DUNPOPUP_H
3
4#include <qpopupmenu.h>
5#include <qaction.h>
6
7#include <startdunconnection.h>
8
9#include "btdeviceitem.h"
10
11
12namespace OpieTooth {
13
14 class DunPopup : public QPopupMenu {
15
16 Q_OBJECT
17
18 public:
19 DunPopup( OpieTooth::BTDeviceItem* );
20 ~DunPopup();
21
22 private:
23 QAction* m_push;
24 OpieTooth::StartDunConnection* m_dunconnection;
25 OpieTooth::BTDeviceItem *m_item;
26 private slots:
27 void slotConnect();
28 void slotDisconnect();
29 void slotConnectAndConfig();
30 };
31};
32
33#endif