summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/obexpopup.cpp34
-rw-r--r--noncore/net/opietooth/manager/obexpopup.h12
2 files changed, 25 insertions, 21 deletions
diff --git a/noncore/net/opietooth/manager/obexpopup.cpp b/noncore/net/opietooth/manager/obexpopup.cpp
index 010f7de..d1d1b4a 100644
--- a/noncore/net/opietooth/manager/obexpopup.cpp
+++ b/noncore/net/opietooth/manager/obexpopup.cpp
@@ -12,36 +12,38 @@ using namespace Opie::Core;
12 12
13using namespace OpieTooth; 13using namespace OpieTooth;
14 14
15/* 15/*
16 * c'tor init the QAction 16 * c'tor init the QAction
17 */ 17 */
18ObexPopup::ObexPopup() 18ObexPopup::ObexPopup(const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item)
19 : QPopupMenu() 19 : QPopupMenu(), m_service(service)
20{ 20{
21 owarn << "RfcCommPopup c'tor" << oendl; 21 owarn << "ObexPopup c'tor" << oendl;
22
23 QAction* a;
24 22
23 m_item = item;
25 /* connect action */ 24 /* connect action */
26 a = new QAction( ); // so it's get deleted 25 m_push = new QAction( ); // so it's get deleted
27 a->setText("Push file"); 26 m_push->setText("Push file");
28 a->addTo( this ); 27 m_push->addTo( this );
29 connect( a, SIGNAL( activated() ), 28 connect(m_push, SIGNAL(activated()), SLOT(slotPush()));
30 this, SLOT( slotPush() ) ); 29}
31};
32 30
33 31
34ObexPopup::~ObexPopup() 32ObexPopup::~ObexPopup()
35{} 33{
34 delete m_push;
35}
36 36
37 37
38void ObexPopup::slotPush() 38void ObexPopup::slotPush()
39{ 39{
40 40 QString device = m_item->mac();
41 owarn << "push something" << oendl; 41 int port = m_service.protocolDescriptorList().last().port();
42 42 device += "@";
43 ObexDialog obexDialog; 43 device += QString::number(port);
44 owarn << "push something to " << device << oendl;
45 ObexDialog obexDialog(device);
44 QPEApplication::execDialog( &obexDialog ); 46 QPEApplication::execDialog( &obexDialog );
45} 47}
46 48
47 49
diff --git a/noncore/net/opietooth/manager/obexpopup.h b/noncore/net/opietooth/manager/obexpopup.h
index ba95e27..25af0d9 100644
--- a/noncore/net/opietooth/manager/obexpopup.h
+++ b/noncore/net/opietooth/manager/obexpopup.h
@@ -1,23 +1,25 @@
1#ifndef OBEXPOPUP_H 1#ifndef OBEXPOPUP_H
2#define OBEXPOPUP_H 2#define OBEXPOPUP_H
3 3
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qaction.h> 5#include <qaction.h>
6#include <services.h>
7#include "btdeviceitem.h"
6 8
7namespace OpieTooth { 9namespace OpieTooth {
8 10
9 class ObexPopup : public QPopupMenu { 11 class ObexPopup : public QPopupMenu {
10 Q_OBJECT 12 Q_OBJECT
11 public: 13 public:
12 ObexPopup(); 14 ObexPopup(const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item);
13 ~ObexPopup(); 15 ~ObexPopup();
14 16 protected:
15
16 private:
17 QAction* m_push; 17 QAction* m_push;
18 private slots: 18 OpieTooth::BTDeviceItem *m_item;
19 Services m_service;
20 protected slots:
19 void slotPush(); 21 void slotPush();
20 }; 22 };
21}; 23};
22 24
23#endif 25#endif