summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/obexftpopup.cpp
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager/obexftpopup.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/obexftpopup.cpp67
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 @@
1/* $Id$ */
2/* OBEX file browser popup */
3/***************************************************************************
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 ***************************************************************************/
11#include "obexdialog.h"
12#include "obexftpopup.h"
13#include "obexftpdialog.h"
14
15/* OPIE */
16#include <qpe/qpeapplication.h>
17#include <opie2/odebug.h>
18using namespace Opie::Core;
19using namespace OpieTooth;
20
21ObexFtpPopup::ObexFtpPopup(const OpieTooth::Services& service,
22 OpieTooth::BTDeviceItem* item)
23 : QPopupMenu(), m_service(service)
24{
25 odebug << "ObexFtpPopup c'tor" << oendl;
26
27 m_item = item;
28 /* connect action */
29 m_push = new QAction( ); // so it's get deleted
30 m_push->setText("Push file");
31 m_push->addTo( this );
32 connect(m_push, SIGNAL(activated()), SLOT(slotPush()));
33
34 /* browse action */
35 m_browse = new QAction(this);
36 m_browse->setText("Browse device");
37 m_browse->addTo(this);
38 connect(m_browse, SIGNAL(activated()), SLOT(slotBrowse()));
39}
40
41
42ObexFtpPopup::~ObexFtpPopup()
43{
44 delete m_push;
45 delete m_browse;
46}
47
48void ObexFtpPopup::slotBrowse()
49{
50 odebug << "browse" <<oendl;
51 ObexFtpDialog ftpDlg(m_item->mac(),
52 m_service.protocolDescriptorList().last().port());
53 QPEApplication::execDialog(&ftpDlg);
54}
55
56void ObexFtpPopup::slotPush()
57{
58 QString device = m_item->mac();
59 int port = m_service.protocolDescriptorList().last().port();
60 device += "@";
61 device += QString::number(port);
62 owarn << "push something to " << device << oendl;
63 ObexDialog obexDialog(device);
64 QPEApplication::execDialog( &obexDialog );
65}
66
67//eof