summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/obexftpopup.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/manager/obexftpopup.cpp') (more/less context) (ignore 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 @@
+/* $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