From a57325de7183c21df6b5ff06eff8cf7e3c328ef4 Mon Sep 17 00:00:00 2001 From: harlekin Date: Wed, 26 Mar 2003 22:30:46 +0000 Subject: ups --- (limited to 'noncore/net/opietooth/manager') diff --git a/noncore/net/opietooth/manager/dunpopup.cpp b/noncore/net/opietooth/manager/dunpopup.cpp new file mode 100644 index 0000000..3043f71 --- a/dev/null +++ b/noncore/net/opietooth/manager/dunpopup.cpp @@ -0,0 +1,63 @@ +#include + +#include + +#include "dunpopup.h" + +using namespace OpieTooth; + +/* + * c'tor init the QAction + */ +DunPopup::DunPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { + + qWarning("DunPopup c'tor"); + + 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(); + c->setText( tr( "disconnect" ) ); + c->addTo( this ); + connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) ); + +}; + +DunPopup::~DunPopup() { + +} + +void DunPopup::slotConnect() { + + m_dunconnection = new StartDunConnection( m_item->mac() ); + m_dunconnection->start(); +} + +void DunPopup::slotDisconnect() { + m_dunconnection->stop(); +} + + +void DunPopup::slotConnectAndConfig() { + slotConnect(); + + // more intelligence here later like passing the device ( bnepX ) + QCopEnvelope e( "QPE/System", "execute(QString)" ); + e << QString( "networksettings" ); + +} diff --git a/noncore/net/opietooth/manager/dunpopup.h b/noncore/net/opietooth/manager/dunpopup.h new file mode 100644 index 0000000..c070c56 --- a/dev/null +++ b/noncore/net/opietooth/manager/dunpopup.h @@ -0,0 +1,33 @@ +#ifndef DUNPOPUP_H +#define DUNPOPUP_H + +#include +#include + +#include + +#include "btdeviceitem.h" + + +namespace OpieTooth { + + class DunPopup : public QPopupMenu { + + Q_OBJECT + + public: + DunPopup( OpieTooth::BTDeviceItem* ); + ~DunPopup(); + + private: + QAction* m_push; + OpieTooth::StartDunConnection* m_dunconnection; + OpieTooth::BTDeviceItem *m_item; + private slots: + void slotConnect(); + void slotDisconnect(); + void slotConnectAndConfig(); + }; +}; + +#endif -- cgit v0.9.0.2