Diffstat (limited to 'noncore/net/opietooth/manager/dunpopup.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/dunpopup.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/noncore/net/opietooth/manager/dunpopup.cpp b/noncore/net/opietooth/manager/dunpopup.cpp index 10505a9..3017d63 100644 --- a/noncore/net/opietooth/manager/dunpopup.cpp +++ b/noncore/net/opietooth/manager/dunpopup.cpp @@ -1,5 +1,6 @@ #include <qpe/qcopenvelope_qws.h> - -#include <qtimer.h> +#include <qmessagebox.h> #include <opie2/odebug.h> +#include <opie2/oprocess.h> +#include <qpe/qpeapplication.h> using namespace Opie::Core; @@ -7,2 +8,3 @@ using namespace Opie::Core; #include "dunpopup.h" +#include "dundialog.h" @@ -13,3 +15,4 @@ using namespace OpieTooth; */ -DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { +DunPopup::DunPopup( const Services& service, + BTDeviceItem* item ) : QPopupMenu(), m_service(service) { @@ -20,6 +23,2 @@ DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { - m_dunconnection = 0l; - /* connect action */ - - a = new QAction(); // so it's get deleted @@ -29,3 +28,2 @@ DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { - b = new QAction(); @@ -47,5 +45,6 @@ DunPopup::~DunPopup() { void DunPopup::slotConnect() { - - m_dunconnection = new StartDunConnection( m_item->mac() ); - m_dunconnection->start(); + odebug << "connect" << oendl; + DunDialog dundlg(m_item->mac(), + m_service.protocolDescriptorList().last().port()); + QPEApplication::execDialog( &dundlg ); } @@ -53,3 +52,10 @@ void DunPopup::slotConnect() { void DunPopup::slotDisconnect() { - m_dunconnection->stop(); + OProcess dunDis; + OProcess pppDis; + dunDis << tr("dund") << tr("--kill") << m_item->mac(); + dunDis.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")); } @@ -63,3 +69,2 @@ void DunPopup::slotConnectAndConfig() { e << QString( "networksettings" ); - } |