-rw-r--r-- | noncore/net/opietooth/manager/obexpopup.cpp | 34 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/obexpopup.h | 12 |
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 @@ -6,42 +6,44 @@ #include <qpe/qpeapplication.h> #include <opie2/odebug.h> using namespace Opie::Core; /* QT */ #include <qtimer.h> using namespace OpieTooth; /* * c'tor init the QAction */ -ObexPopup::ObexPopup() - : QPopupMenu() +ObexPopup::ObexPopup(const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item) + : QPopupMenu(), m_service(service) { - owarn << "RfcCommPopup c'tor" << oendl; - - QAction* a; + owarn << "ObexPopup c'tor" << oendl; + m_item = item; /* connect action */ - a = new QAction( ); // so it's get deleted - a->setText("Push file"); - a->addTo( this ); - connect( a, SIGNAL( activated() ), - this, SLOT( slotPush() ) ); -}; + 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())); +} ObexPopup::~ObexPopup() -{} +{ + delete m_push; +} void ObexPopup::slotPush() { - - owarn << "push something" << oendl; - - ObexDialog obexDialog; + 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 ); } 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 @@ #ifndef OBEXPOPUP_H #define OBEXPOPUP_H #include <qpopupmenu.h> #include <qaction.h> +#include <services.h> +#include "btdeviceitem.h" namespace OpieTooth { class ObexPopup : public QPopupMenu { Q_OBJECT public: - ObexPopup(); + ObexPopup(const OpieTooth::Services& service, OpieTooth::BTDeviceItem* item); ~ObexPopup(); - - - private: + protected: QAction* m_push; - private slots: + OpieTooth::BTDeviceItem *m_item; + Services m_service; + protected slots: void slotPush(); }; }; #endif |