author | korovkin <korovkin> | 2006-04-03 04:12:19 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-04-03 04:12:19 (UTC) |
commit | 430017b047c885ba4dfd9f4074f4e4ab130d5709 (patch) (side-by-side diff) | |
tree | ed883831f88038163285800ee2d8cc2fbb4faf86 /noncore/net/opietooth/manager/dunpopup.cpp | |
parent | 812083469c80a0a07ad1ba41d6795e05f950710b (diff) | |
download | opie-430017b047c885ba4dfd9f4074f4e4ab130d5709.zip opie-430017b047c885ba4dfd9f4074f4e4ab130d5709.tar.gz opie-430017b047c885ba4dfd9f4074f4e4ab130d5709.tar.bz2 |
Added dialog boxes for PAN and DUN connections.
Added message boxes in order to confirm DUN and PAN disconnections.
Diffstat (limited to 'noncore/net/opietooth/manager/dunpopup.cpp') (more/less context) (ignore 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,36 +1,34 @@ #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; #include "dunpopup.h" +#include "dundialog.h" using namespace OpieTooth; /* * c'tor init the QAction */ -DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { +DunPopup::DunPopup( const Services& service, + BTDeviceItem* item ) : QPopupMenu(), m_service(service) { owarn << "DunPopup c'tor" << oendl; m_item = item; QAction *a, *b, *c; - m_dunconnection = 0l; - /* connect action */ - - 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(); @@ -42,24 +40,31 @@ DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { 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 ); } 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")); } void DunPopup::slotConnectAndConfig() { slotConnect(); // more intelligence here later like passing the device ( bnepX ) QCopEnvelope e( "QPE/System", "execute(QString)" ); e << QString( "networksettings" ); - } |