author | korovkin <korovkin> | 2006-03-19 14:59:21 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-03-19 14:59:21 (UTC) |
commit | 39fedaa847ed64b2c0113a75d0f1de29da5876db (patch) (side-by-side diff) | |
tree | 442fc009975e72a22cb9773b88599ea388af195b /noncore/net/opietooth/manager/obexftpopup.cpp | |
parent | 3de693f244170cb9424d841aef6a6d7175766fa3 (diff) | |
download | opie-39fedaa847ed64b2c0113a75d0f1de29da5876db.zip opie-39fedaa847ed64b2c0113a75d0f1de29da5876db.tar.gz opie-39fedaa847ed64b2c0113a75d0f1de29da5876db.tar.bz2 |
Added device browsing and files downloading using OBEX File transfer
protocol.
Diffstat (limited to 'noncore/net/opietooth/manager/obexftpopup.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/obexftpopup.cpp | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/obexftpopup.cpp b/noncore/net/opietooth/manager/obexftpopup.cpp new file mode 100644 index 0000000..38f3a43 --- a/dev/null +++ b/noncore/net/opietooth/manager/obexftpopup.cpp @@ -0,0 +1,67 @@ +/* $Id$ */ +/* OBEX file browser popup */ +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "obexdialog.h" +#include "obexftpopup.h" +#include "obexftpdialog.h" + +/* OPIE */ +#include <qpe/qpeapplication.h> +#include <opie2/odebug.h> +using namespace Opie::Core; +using namespace OpieTooth; + +ObexFtpPopup::ObexFtpPopup(const OpieTooth::Services& service, + OpieTooth::BTDeviceItem* item) + : QPopupMenu(), m_service(service) +{ + odebug << "ObexFtpPopup c'tor" << oendl; + + m_item = item; + /* connect action */ + m_push = new QAction( ); // so it's get deleted + m_push->setText("Push file"); + m_push->addTo( this ); + connect(m_push, SIGNAL(activated()), SLOT(slotPush())); + + /* browse action */ + m_browse = new QAction(this); + m_browse->setText("Browse device"); + m_browse->addTo(this); + connect(m_browse, SIGNAL(activated()), SLOT(slotBrowse())); +} + + +ObexFtpPopup::~ObexFtpPopup() +{ + delete m_push; + delete m_browse; +} + +void ObexFtpPopup::slotBrowse() +{ + odebug << "browse" <<oendl; + ObexFtpDialog ftpDlg(m_item->mac(), + m_service.protocolDescriptorList().last().port()); + QPEApplication::execDialog(&ftpDlg); +} + +void ObexFtpPopup::slotPush() +{ + QString device = m_item->mac(); + int port = m_service.protocolDescriptorList().last().port(); + device += "@"; + device += QString::number(port); + owarn << "push something to " << device << oendl; + ObexDialog obexDialog(device); + QPEApplication::execDialog( &obexDialog ); +} + +//eof |