summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/panpopup.cpp
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager/panpopup.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/panpopup.cpp46
1 files changed, 19 insertions, 27 deletions
diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp
index d3d1347..61e632b 100644
--- a/noncore/net/opietooth/manager/panpopup.cpp
+++ b/noncore/net/opietooth/manager/panpopup.cpp
@@ -16,8 +16,10 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
16 m_item = item; 16 m_item = item;
17 m_panconnect = 0l; 17 QAction *a, *b, *c;
18 QAction *a, *b;
19 18
19 m_panconnection = 0l;
20 /* connect action */ 20 /* connect action */
21 a = new QAction( ); // so it's get deleted 21
22 a->setText( "connect" ); 22
23 a = new QAction(); // so it's get deleted
24 a->setText( tr("connect") );
23 a->addTo( this ); 25 a->addTo( this );
@@ -25,6 +27,13 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
25 27
28
26 b = new QAction(); 29 b = new QAction();
27 b->setText( "connect+conf" ); 30 b->setText( tr( "connect+conf" ) );
28 b->addTo( this ); 31 b->addTo( this );
29 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) ); 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
30}; 39};
@@ -32,3 +41,3 @@ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
32PanPopup::~PanPopup() { 41PanPopup::~PanPopup() {
33 delete m_panconnect; 42
34} 43}
@@ -36,27 +45,10 @@ PanPopup::~PanPopup() {
36void PanPopup::slotConnect() { 45void PanPopup::slotConnect() {
37 46 m_panconnection = new StartPanConnection( m_item->mac() );
38 47 m_panconnection->start();
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} 48}
54 49
55void PanPopup::slotExited( OProcess* proc ) { 50void PanPopup::slotDisconnect() {
56 delete m_panconnect; 51 m_panconnection->stop();
57} 52}
58 53
59void PanPopup::slotStdOut(OProcess* proc, char* chars, int len)
60{}
61
62 54