author | harlekin <harlekin> | 2003-03-21 15:56:58 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-03-21 15:56:58 (UTC) |
commit | d3f71dadbd2dafcf42480afeffe75e7e36ec7d9c (patch) (side-by-side diff) | |
tree | 922b36110df58bdc00a3e2508313609c0f00c45f /noncore/net/opietooth/manager/panpopup.cpp | |
parent | 69086f42072e7fc1ea5256cb9275a27bf5b41f87 (diff) | |
download | opie-d3f71dadbd2dafcf42480afeffe75e7e36ec7d9c.zip opie-d3f71dadbd2dafcf42480afeffe75e7e36ec7d9c.tar.gz opie-d3f71dadbd2dafcf42480afeffe75e7e36ec7d9c.tar.bz2 |
move connection work to the lib
Diffstat (limited to 'noncore/net/opietooth/manager/panpopup.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/panpopup.cpp | 46 |
1 files changed, 19 insertions, 27 deletions
diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp index d3d1347..61e632b 100644 --- a/noncore/net/opietooth/manager/panpopup.cpp +++ b/noncore/net/opietooth/manager/panpopup.cpp @@ -11,57 +11,49 @@ using namespace OpieTooth; */ PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() { qWarning("PanPopup c'tor"); m_item = item; - m_panconnect = 0l; - QAction *a, *b; + QAction *a, *b, *c; + m_panconnection = 0l; /* connect action */ - a = new QAction( ); // so it's get deleted - a->setText( "connect" ); + + + 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( "connect+conf" ); + 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() ) ); + }; PanPopup::~PanPopup() { - delete m_panconnect; + } void PanPopup::slotConnect() { - - - // SHOULD move to lib - // before pand must be in "pand --listen --role panu" mode ( client ) - - m_panconnect = new OProcess(); - *m_panconnect << "pand" << "--connect" << m_item->mac(); - - connect( m_panconnect, SIGNAL( processExited( OProcess* ) ) , - this, SLOT( slotConnectExited( OProcess* ) ) ); - connect( m_panconnect, SIGNAL( receivedStdout( OProcess*, char*, int ) ), - this, SLOT( slotConnectOut( OProcess*, char*, int ) ) ); - if (!m_panconnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { - qWarning( "could not start" ); - delete m_panconnect; - } + m_panconnection = new StartPanConnection( m_item->mac() ); + m_panconnection->start(); } -void PanPopup::slotExited( OProcess* proc ) { - delete m_panconnect; +void PanPopup::slotDisconnect() { + m_panconnection->stop(); } -void PanPopup::slotStdOut(OProcess* proc, char* chars, int len) -{} - void PanPopup::slotConnectAndConfig() { slotConnect(); // more intelligence here later like passing the device ( bnepX ) QCopEnvelope e( "QPE/System", "execute(QString)" ); |