summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp15
-rw-r--r--noncore/net/opietooth/manager/btdeviceitem.h4
-rw-r--r--noncore/net/opietooth/manager/manager.pro5
-rw-r--r--noncore/net/opietooth/manager/obexdialog.cpp2
-rw-r--r--noncore/net/opietooth/manager/obexdialog.h39
-rw-r--r--noncore/net/opietooth/manager/popuphelper.cpp2
-rw-r--r--noncore/net/opietooth/manager/popuphelper.h4
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp2
-rw-r--r--noncore/net/opietooth/manager/pppdialog.h35
-rw-r--r--noncore/net/opietooth/manager/stdpopups.cpp11
-rw-r--r--noncore/net/opietooth/manager/stdpopups.h7
11 files changed, 71 insertions, 55 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index c81d4d1..ec05a95 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -282,12 +282,14 @@ void BlueBase::startServiceActionClicked( QListViewItem */*item*/ ) {
/**
* Action that are toggled on hold (mostly QPopups i guess)
*/
void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int /*column*/ ) {
+ if (!item )
+ return;
QPopupMenu *menu = new QPopupMenu();
int ret=0;
if ( ((BTListItem*)item)->type() == "device") {
@@ -339,15 +341,15 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
BTServiceItem* service = (BTServiceItem*)item;
QMap<int, QString> list = service->services().classIdList();
QMap<int, QString>::Iterator it = list.begin();
QPopupMenu *popup =0l;
if ( it != list.end() ) {
qWarning("Searching id %d %s", it.key(), it.data().latin1() );
- popup = m_popHelper.find( it.key(),
+ popup = m_popHelper.find( it.key() /*1*/,
service->services(),
- service->parent() );
+ (BTDeviceItem*)service->parent() );
}else {
qWarning("Empty");
}
if ( popup == 0l ) {
qWarning("factory returned 0l");
@@ -356,23 +358,24 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
int test1 = popup->insertItem( tr("Test1:"), 0);
int con = popup->insertItem( tr("connect"), 1);
int del = popup->insertItem( tr("delete"), 2);
ret = popup->exec( point );
-
+ qWarning("returned from exec() ");
if ( ret == -1 )
- delete popup;
+ ;
else if ( ret == test1 )
- delete popup;
+ ;
else if ( ret == con )
- delete popup;
+ ;
else if ( ret == del ) {
// take item first? -zecke
delete item;
}
+ delete popup;
}
delete menu;
}
/**
diff --git a/noncore/net/opietooth/manager/btdeviceitem.h b/noncore/net/opietooth/manager/btdeviceitem.h
index ae51483..e4c6ce7 100644
--- a/noncore/net/opietooth/manager/btdeviceitem.h
+++ b/noncore/net/opietooth/manager/btdeviceitem.h
@@ -1,9 +1,9 @@
-#ifndef OPIE_TOOTH_BT_DEVIVE_ITEM
-#define OPIE_TOOTH_BT_DEVIVE_ITEM
+#ifndef OPIE_TOOTH_BT_DEVICE_ITEM
+#define OPIE_TOOTH_BT_DEVICE_ITEM
#include <remotedevice.h>
#include "btlistitem.h"
namespace OpieTooth {
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro
index 762b028..121c069 100644
--- a/noncore/net/opietooth/manager/manager.pro
+++ b/noncore/net/opietooth/manager/manager.pro
@@ -4,21 +4,22 @@ CONFIG = qt warn_on debug
HEADERS = btconnectionitem.h btdeviceitem.h \
btserviceitem.h stdpopups.h \
popuphelper.h bluebase.h \
scandialog.h btlistitem.h \
hciconfwrapper.h bticonloader.h \
pppdialog.h obexdialog.h \
- devicehandler.h
+ devicehandler.h rfcpopup.h
SOURCES = btconnectionitem.cpp btdeviceitem.cpp \
btserviceitem.cpp stdpopups.cpp \
popuphelper.cpp main.cpp \
bluebase.cpp scandialog.cpp \
btlistitem.cpp hciconfwrapper.cpp \
bticonloader.cpp pppdialog.cpp \
- obexdialog.cpp devicehandler.cpp
+ obexdialog.cpp devicehandler.cpp \
+ rfcpopup.cpp
INCLUDEPATH += $(OPIEDIR)/include
INCLUDEPATH += $(OPIEDIR)/noncore/net/opietooth/lib
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe -lopietooth -lopie
INTERFACES = bluetoothbase.ui devicedialog.ui
DESTDIR = $(OPIEDIR)/bin
diff --git a/noncore/net/opietooth/manager/obexdialog.cpp b/noncore/net/opietooth/manager/obexdialog.cpp
index cb142eb..15973d4 100644
--- a/noncore/net/opietooth/manager/obexdialog.cpp
+++ b/noncore/net/opietooth/manager/obexdialog.cpp
@@ -9,12 +9,14 @@
#include <qpe/resource.h>
#include <opie/oprocess.h>
#include <opie/ofiledialog.h>
+using namespace OpieTooth;
+
ObexDialog::ObexDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
: QDialog( parent, name, modal, fl ) {
if ( !name )
setName( "ObexDialog" );
setCaption( tr( "beam files " ) ) ;
diff --git a/noncore/net/opietooth/manager/obexdialog.h b/noncore/net/opietooth/manager/obexdialog.h
index 1a73b57..28d2be2 100644
--- a/noncore/net/opietooth/manager/obexdialog.h
+++ b/noncore/net/opietooth/manager/obexdialog.h
@@ -7,30 +7,33 @@
class QVBoxLayout;
class QPushButton;
class QMultiLineEdit;
class QLineEdit;
-class ObexDialog : public QDialog {
- Q_OBJECT
+namespace OpieTooth {
-public:
- ObexDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0);
- ~ObexDialog();
+ class ObexDialog : public QDialog {
+ Q_OBJECT
+
+ public:
+ ObexDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0);
+ ~ObexDialog();
-private slots:
- void browse();
- void sendData();
-
-protected:
- QVBoxLayout* layout;
- QLineEdit* cmdLine;
- QLineEdit* chNameLine;
- QPushButton* sendButton;
-private:
- // Device that is used
- QString m_device;
-};
+private slots:
+ void browse();
+ void sendData();
+
+ protected:
+ QVBoxLayout* layout;
+ QLineEdit* cmdLine;
+ QLineEdit* chNameLine;
+ QPushButton* sendButton;
+ private:
+ // Device that is used
+ QString m_device;
+ };
+}
#endif
diff --git a/noncore/net/opietooth/manager/popuphelper.cpp b/noncore/net/opietooth/manager/popuphelper.cpp
index ba91e04..4a4daf2 100644
--- a/noncore/net/opietooth/manager/popuphelper.cpp
+++ b/noncore/net/opietooth/manager/popuphelper.cpp
@@ -14,13 +14,13 @@ PopupHelper::~PopupHelper() {
}
void PopupHelper::insert( int id, popupFactory fact ) {
m_map.insert(id, fact );
}
-QPopupMenu* PopupHelper::find( int id, const Services& ser, QListViewItem* item ) {
+QPopupMenu* PopupHelper::find( int id, const Services& ser, BTDeviceItem* item ) {
//qWarning("find");
FactoryMap::Iterator it = m_map.find(id );
if ( it != m_map.end() ) {
//qWarning("found");
popupFactory fact = it.data();
return (*fact)(ser, item);
diff --git a/noncore/net/opietooth/manager/popuphelper.h b/noncore/net/opietooth/manager/popuphelper.h
index 7541ac5..6d4d413 100644
--- a/noncore/net/opietooth/manager/popuphelper.h
+++ b/noncore/net/opietooth/manager/popuphelper.h
@@ -6,20 +6,20 @@
#include <qpopupmenu.h>
#include <qmap.h>
#include <services.h>
namespace OpieTooth {
- typedef QPopupMenu* (*popupFactory)(const Services&, QListViewItem*);
+ typedef QPopupMenu* (*popupFactory)(const Services&, BTDeviceItem*);
typedef QMap<int, popupFactory> FactoryMap;
class PopupHelper {
public:
PopupHelper();
~PopupHelper();
void insert( int id, popupFactory fact );
- QPopupMenu* find( int id, const Services&, QListViewItem* );
+ QPopupMenu* find( int id, const Services&, BTDeviceItem* );
private:
void init();
FactoryMap m_map;
};
};
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp
index 4d926a5..1f347ce 100644
--- a/noncore/net/opietooth/manager/pppdialog.cpp
+++ b/noncore/net/opietooth/manager/pppdialog.cpp
@@ -4,12 +4,14 @@
#include <qmultilineedit.h>
#include <qlineedit.h>
#include <qlayout.h>
#include <qlabel.h>
#include <opie/oprocess.h>
+using namespace OpieTooth;
+
PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
: QDialog( parent, name, modal, fl ) {
if ( !name )
setName( "PPPDialog" );
setCaption( tr( "ppp connection " ) ) ;
diff --git a/noncore/net/opietooth/manager/pppdialog.h b/noncore/net/opietooth/manager/pppdialog.h
index b80b73d..6fdc90a 100644
--- a/noncore/net/opietooth/manager/pppdialog.h
+++ b/noncore/net/opietooth/manager/pppdialog.h
@@ -7,28 +7,31 @@
class QVBoxLayout;
class QPushButton;
class QMultiLineEdit;
class QLineEdit;
-class PPPDialog : public QDialog {
- Q_OBJECT
+namespace OpieTooth {
-public:
- PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0);
- ~PPPDialog();
+ class PPPDialog : public QDialog {
+ Q_OBJECT
-private slots:
- void connectToDevice();
- void fillOutPut( OProcess* pppDial, char* cha, int len );
-protected:
- QVBoxLayout* layout;
- QLineEdit* cmdLine;
- QPushButton* connectButton;
- QMultiLineEdit* outPut;
+ public:
+ PPPDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0, const QString& device = 0);
+ ~PPPDialog();
-private:
- QString m_device;
-};
+ private slots:
+ void connectToDevice();
+ void fillOutPut( OProcess* pppDial, char* cha, int len );
+ protected:
+ QVBoxLayout* layout;
+ QLineEdit* cmdLine;
+ QPushButton* connectButton;
+ QMultiLineEdit* outPut;
+
+ private:
+ QString m_device;
+ };
+}
#endif
diff --git a/noncore/net/opietooth/manager/stdpopups.cpp b/noncore/net/opietooth/manager/stdpopups.cpp
index 2290b9a..750365e 100644
--- a/noncore/net/opietooth/manager/stdpopups.cpp
+++ b/noncore/net/opietooth/manager/stdpopups.cpp
@@ -1,16 +1,15 @@
-//#include "rfccompopup.h"
+#include "rfcpopup.h"
#include "stdpopups.h"
extern "C" {
- QPopupMenu* newRfcComPopup( const OpieTooth::Services& servive, QListViewItem* item ) {
- // return OpieTooth::RfcComPopup( servive, item );
- return 0l;
+ QPopupMenu* newRfcComPopup( const OpieTooth::Services& servive, OpieTooth::BTDeviceItem* item ) {
+ return new OpieTooth::RfcCommPopup(/* servive, item*/ ); // fix spellin RfComm vs. RfcComm and paramaters
+ //return 0l;
}
- QPopupMenu* newObexPushPopup( const OpieTooth::Services&, QListViewItem* ) {
+ QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* ) {
return 0l;
}
-
}
diff --git a/noncore/net/opietooth/manager/stdpopups.h b/noncore/net/opietooth/manager/stdpopups.h
index 185d68d..b57d4de 100644
--- a/noncore/net/opietooth/manager/stdpopups.h
+++ b/noncore/net/opietooth/manager/stdpopups.h
@@ -4,12 +4,15 @@
#include <qlistview.h>
#include <qpopupmenu.h>
#include <services.h>
+#include "btdeviceitem.h"
+
extern "C" {
-QPopupMenu* newRfcComPopup( const OpieTooth::Services&, QListViewItem* );
-QPopupMenu* newObexPushPopup( const OpieTooth::Services&, QListViewItem* );
+
+ QPopupMenu* newRfcComPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* );
+ QPopupMenu* newObexPushPopup( const OpieTooth::Services&, OpieTooth::BTDeviceItem* );
}
#endif