00001 #include <qpe/qcopenvelope_qws.h>
00002 #include <opie2/odebug.h>
00003 using namespace Opie::Core;
00004
00005 #include <qtimer.h>
00006
00007 #include "panpopup.h"
00008
00009 using namespace OpieTooth;
00010
00011
00012
00013
00014 PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
00015
00016 owarn << "PanPopup c'tor" << oendl;
00017
00018 m_item = item;
00019 QAction *a, *b, *c;
00020
00021 m_panconnection = 0l;
00022
00023
00024
00025 a = new QAction();
00026 a->setText( tr("connect") );
00027 a->addTo( this );
00028 connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
00029
00030
00031 b = new QAction();
00032 b->setText( tr( "connect+conf" ) );
00033 b->addTo( this );
00034 connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) );
00035
00036 c = new QAction();
00037 c->setText( tr( "disconnect" ) );
00038 c->addTo( this );
00039 connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
00040
00041 };
00042
00043 PanPopup::~PanPopup() {
00044
00045 }
00046
00047 void PanPopup::slotConnect() {
00048
00049 m_panconnection = new StartPanConnection( m_item->mac() );
00050 m_panconnection->start();
00051 }
00052
00053 void PanPopup::slotDisconnect() {
00054 if (!m_panconnection) m_panconnection = new StartPanConnection( m_item->mac() );
00055 m_panconnection->stop();
00056 }
00057
00058
00059 void PanPopup::slotConnectAndConfig() {
00060 slotConnect();
00061
00062
00063 QCopEnvelope e( "QPE/System", "execute(QString)" );
00064 e << QString( "networksettings" );
00065
00066 }