summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/dunpopup.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/manager/dunpopup.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/dunpopup.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/dunpopup.cpp b/noncore/net/opietooth/manager/dunpopup.cpp
index c304b2d..6844988 100644
--- a/noncore/net/opietooth/manager/dunpopup.cpp
+++ b/noncore/net/opietooth/manager/dunpopup.cpp
@@ -17,64 +17,67 @@ using namespace Opie::Core;
#include "dunpopup.h"
#include "dundialog.h"
using namespace OpieTooth;
/*
* c'tor init the QAction
*/
DunPopup::DunPopup( const Services& service,
BTDeviceItem* item ) : QPopupMenu(), m_service(service) {
owarn << "DunPopup c'tor" << oendl;
m_item = item;
QAction *a, *b, *c;
a = new QAction(); // so it's get deleted
a->setText( tr("connect") );
a->addTo( this );
connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
b = new QAction();
b->setText( tr( "connect+conf" ) );
b->addTo( this );
connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) );
c = new QAction();
c->setText( tr( "disconnect" ) );
c->addTo( this );
connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
};
DunPopup::~DunPopup() {
}
void DunPopup::slotConnect() {
odebug << "connect" << oendl;
DunDialog dundlg(m_item->mac(),
m_service.protocolDescriptorList().last().port());
QPEApplication::execDialog( &dundlg );
}
void DunPopup::slotDisconnect() {
OProcess dunDis;
OProcess pppDis;
+ OProcess dunKill;
dunDis << tr("dund") << tr("--kill") << m_item->mac();
dunDis.start(OProcess::DontCare, OProcess::NoCommunication);
+ dunKill << tr("killall") << tr("-q") << tr("dund");
+ dunKill.start(OProcess::DontCare, OProcess::NoCommunication);
pppDis << tr("killall") << tr("-q") << tr("pppd");
pppDis.start(OProcess::DontCare, OProcess::NoCommunication);
sleep(1);
QMessageBox::information(this, tr("DUN Disconnect"), tr("DUN Disconnected"));
}
void DunPopup::slotConnectAndConfig() {
slotConnect();
// more intelligence here later like passing the device ( bnepX )
QCopEnvelope e( "QPE/System", "execute(QString)" );
e << QString( "networksettings" );
}