summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-03-25 00:13:33 (UTC)
committer harlekin <harlekin>2003-03-25 00:13:33 (UTC)
commita70a56b2ec4a806e00a26c8768b9f3df7033e987 (patch) (side-by-side diff)
treec0b811851694f4253c4cf323369f8034792ecf71
parentc80099645138ab1ab8ad542cbfce401bcc6d095c (diff)
downloadopie-a70a56b2ec4a806e00a26c8768b9f3df7033e987.zip
opie-a70a56b2ec4a806e00a26c8768b9f3df7033e987.tar.gz
opie-a70a56b2ec4a806e00a26c8768b9f3df7033e987.tar.bz2
give me other popups then obex again .-|
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp2
-rw-r--r--noncore/net/opietooth/manager/panpopup.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 04fa117..935c11a 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -288,97 +288,97 @@ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & poin
int ret=0;
if ( ((BTListItem*)item)->type() == "device") {
QPopupMenu *groups = new QPopupMenu();
menu->insertItem( ((BTDeviceItem*)item)->name(),0 );
menu->insertSeparator(1);
menu->insertItem( tr("rescan sevices"), 2);
menu->insertItem( tr("to group"), groups , 3);
menu->insertItem( tr("delete"), 4);
ret = menu->exec( point , 0);
switch(ret) {
case -1:
break;
case 2:
addServicesToDevice( (BTDeviceItem*)item );
break;
case 4:
// deletes childs too
delete item;
break;
}
delete groups;
}
/*
* We got service sensitive PopupMenus in our factory
* We will create one through the factory and will insert
* our Separator + ShowInfo into the menu or create a new
* one if the factory returns 0
* PopupMenu deletion is kind of weird.
* If escaped( -1 ) or any of our items were chosen we'll
* delete the PopupMenu otherwise it's the responsibility of
* the PopupMenu to delete itself
*
*/
else if ( ((BTListItem*)item)->type() == "service") {
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( 4358,
+ popup = m_popHelper.find( it.key(),
service->services(),
(BTDeviceItem*)service->parent() );
}else {
qWarning("Empty");
}
if ( popup == 0l ) {
qWarning("factory returned 0l");
popup = new QPopupMenu();
}
int test1 = popup->insertItem( tr("Test1:"), 2);
ret = popup->exec( point );
qWarning("returned from exec() ");
if ( ret == -1 ) {
;
} else if ( ret == test1 ) {
;
}
delete popup;
}
delete menu;
}
/**
* Search and display avail. services for a device (on expand from device listing)
* @param item the service item returned
*/
void BlueBase::addServicesToDevice( BTDeviceItem * item ) {
qDebug("addServicesToDevice");
// row of mac adress text(3)
RemoteDevice device = item->remoteDevice();
m_deviceList.insert( item->mac() , item );
// and some time later I get a signal foundServices( const QString& device, Services::ValueList ); back
m_localDevice->searchServices( device );
}
/**
* Overloaded. This one it the one that is
ted to the foundServices signal
* @param device the mac address of the remote device
* @param servicesList the list with the service the device has.
*/
void BlueBase::addServicesToDevice( const QString& device, Services::ValueList servicesList ) {
qDebug("fill services list");
diff --git a/noncore/net/opietooth/manager/panpopup.cpp b/noncore/net/opietooth/manager/panpopup.cpp
index 61e632b..7a0ee55 100644
--- a/noncore/net/opietooth/manager/panpopup.cpp
+++ b/noncore/net/opietooth/manager/panpopup.cpp
@@ -1,62 +1,63 @@
#include <qpe/qcopenvelope_qws.h>
#include <qtimer.h>
#include "panpopup.h"
using namespace OpieTooth;
/*
* c'tor init the QAction
*/
PanPopup::PanPopup( OpieTooth::BTDeviceItem* item ) : QPopupMenu() {
qWarning("PanPopup c'tor");
m_item = item;
QAction *a, *b, *c;
m_panconnection = 0l;
/* connect action */
a = new QAction(); // so it's get deleted
a->setText( tr("connect") );
a->addTo( this );
connect( a, SIGNAL( activated() ), this, SLOT( slotConnect() ) );
b = new QAction();
b->setText( tr( "connect+conf" ) );
b->addTo( this );
connect( b, SIGNAL( activated() ), this, SLOT( slotConnectAndConfig() ) );
c = new QAction();
c->setText( tr( "disconnect" ) );
c->addTo( this );
connect( c, SIGNAL( activated() ), this, SLOT( slotDisconnect() ) );
};
PanPopup::~PanPopup() {
}
void PanPopup::slotConnect() {
+
m_panconnection = new StartPanConnection( m_item->mac() );
m_panconnection->start();
}
void PanPopup::slotDisconnect() {
m_panconnection->stop();
}
void PanPopup::slotConnectAndConfig() {
slotConnect();
// more intelligence here later like passing the device ( bnepX )
QCopEnvelope e( "QPE/System", "execute(QString)" );
e << QString( "networksetup" );
}