summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/dunpopup.cpp
Unidiff
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
@@ -41,40 +41,43 @@ DunPopup::DunPopup( const Services& service,
41 b->addTo( this ); 41 b->addTo( this );
42 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) ); 42 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) );
43 43
44 c = new QAction(); 44 c = new QAction();
45 c->setText( tr( "disconnect" ) ); 45 c->setText( tr( "disconnect" ) );
46 c->addTo( this ); 46 c->addTo( this );
47 connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) ); 47 connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
48 48
49}; 49};
50 50
51DunPopup::~DunPopup() { 51DunPopup::~DunPopup() {
52 52
53} 53}
54 54
55void DunPopup::slotConnect() { 55void DunPopup::slotConnect() {
56 odebug << "connect" << oendl; 56 odebug << "connect" << oendl;
57 DunDialog dundlg(m_item->mac(), 57 DunDialog dundlg(m_item->mac(),
58 m_service.protocolDescriptorList().last().port()); 58 m_service.protocolDescriptorList().last().port());
59 QPEApplication::execDialog( &dundlg ); 59 QPEApplication::execDialog( &dundlg );
60} 60}
61 61
62void DunPopup::slotDisconnect() { 62void DunPopup::slotDisconnect() {
63 OProcess dunDis; 63 OProcess dunDis;
64 OProcess pppDis; 64 OProcess pppDis;
65 OProcess dunKill;
65 dunDis << tr("dund") << tr("--kill") << m_item->mac(); 66 dunDis << tr("dund") << tr("--kill") << m_item->mac();
66 dunDis.start(OProcess::DontCare, OProcess::NoCommunication); 67 dunDis.start(OProcess::DontCare, OProcess::NoCommunication);
68 dunKill << tr("killall") << tr("-q") << tr("dund");
69 dunKill.start(OProcess::DontCare, OProcess::NoCommunication);
67 pppDis << tr("killall") << tr("-q") << tr("pppd"); 70 pppDis << tr("killall") << tr("-q") << tr("pppd");
68 pppDis.start(OProcess::DontCare, OProcess::NoCommunication); 71 pppDis.start(OProcess::DontCare, OProcess::NoCommunication);
69 sleep(1); 72 sleep(1);
70 QMessageBox::information(this, tr("DUN Disconnect"), tr("DUN Disconnected")); 73 QMessageBox::information(this, tr("DUN Disconnect"), tr("DUN Disconnected"));
71} 74}
72 75
73 76
74void DunPopup::slotConnectAndConfig() { 77void DunPopup::slotConnectAndConfig() {
75 slotConnect(); 78 slotConnect();
76 79
77 // more intelligence here later like passing the device ( bnepX ) 80 // more intelligence here later like passing the device ( bnepX )
78 QCopEnvelope e( "QPE/System", "execute(QString)" ); 81 QCopEnvelope e( "QPE/System", "execute(QString)" );
79 e << QString( "networksettings" ); 82 e << QString( "networksettings" );
80} 83}