summaryrefslogtreecommitdiff
authorkorovkin <korovkin>2006-03-25 18:10:13 (UTC)
committer korovkin <korovkin>2006-03-25 18:10:13 (UTC)
commitc4f82599db775f52c7e04cce09c7c45ecc89ccfd (patch) (side-by-side diff)
tree81d48e5363a2135bb6820510ae7f5dee9999e8f2
parentda3c4a6231882bc56266162415a8d1a2a1bf0293 (diff)
downloadopie-c4f82599db775f52c7e04cce09c7c45ecc89ccfd.zip
opie-c4f82599db775f52c7e04cce09c7c45ecc89ccfd.tar.gz
opie-c4f82599db775f52c7e04cce09c7c45ecc89ccfd.tar.bz2
Added RFCOMM binding table functionality.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/TODO.txt5
-rw-r--r--noncore/net/opietooth/manager/btdeviceitem.cpp2
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp115
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogimpl.h40
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogitem.cpp9
-rw-r--r--noncore/net/opietooth/manager/rfcommassigndialogitem.h4
-rw-r--r--noncore/net/opietooth/manager/rfcommconfhandler.cpp98
-rw-r--r--noncore/net/opietooth/manager/rfcommconfhandler.h7
-rw-r--r--noncore/net/opietooth/manager/rfcommdialogitembase.ui298
-rw-r--r--noncore/net/opietooth/manager/rfcpopup.cpp3
10 files changed, 349 insertions, 232 deletions
diff --git a/noncore/net/opietooth/manager/TODO.txt b/noncore/net/opietooth/manager/TODO.txt
index e6bd9b1..76fae68 100644
--- a/noncore/net/opietooth/manager/TODO.txt
+++ b/noncore/net/opietooth/manager/TODO.txt
@@ -1,5 +1,4 @@
-1. Make bind table edit /etc/bluetooth/rfcomm.conf file.
-2. Add an rfcomm port number to the connection dialog.
-3. Collect requirements from others.
+1. Add an rfcomm port number to the connection dialog.
+2. Collect requirements from others.
//eof
diff --git a/noncore/net/opietooth/manager/btdeviceitem.cpp b/noncore/net/opietooth/manager/btdeviceitem.cpp
index fb1b1c1..c112463 100644
--- a/noncore/net/opietooth/manager/btdeviceitem.cpp
+++ b/noncore/net/opietooth/manager/btdeviceitem.cpp
@@ -1,30 +1,30 @@
#include "btdeviceitem.h"
using namespace OpieTooth;
BTDeviceItem::BTDeviceItem( QListView* parent, const RemoteDevice& dev )
: BTListItem( parent ) {
- setText( 0, dev.name() );
+ setText( 0, dev.name().utf8() );
m_device = dev;
};
BTDeviceItem::~BTDeviceItem() {
// nothing I'm aware of
}
RemoteDevice BTDeviceItem::remoteDevice() const {
return m_device;
}
QString BTDeviceItem::mac()const {
return m_device.mac();
}
QString BTDeviceItem::name() const {
return m_device.name();
}
QString BTDeviceItem::type() const {
return QString::fromLatin1("device");
}
int BTDeviceItem::typeId() const {
return Device;
}
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
index be720b8..7943deb 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
+++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.cpp
@@ -1,139 +1,154 @@
+/* $Id$ */
+/* RFCOMM binding table edit dialog */
+/***************************************************************************
+ * *
+ * 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 "rfcommassigndialogimpl.h"
#include "rfcommassigndialogitem.h"
#include "rfcommconfhandler.h"
/* OPIE */
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
#include <opie2/odebug.h>
using namespace Opie::Core;
/* QT */
#include <qlayout.h>
using namespace OpieTooth;
// TODO: write only the file in bluebase?
// muss rfcommd dann neu gestartet werden
// sollte rfcomm bind all nicht eh default config sein ( polled das? - d.h. sobald nen gerät in der nähe ist bindet es?
RfcommAssignDialog::RfcommAssignDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
: RfcommAssignDialogBase( parent, name, modal, fl )
{
-
m_range = 5;
- m_scrollView = new QScrollView( this );
+ m_scrollView = new QScrollView(this);
m_scrollView->setResizePolicy( QScrollView::AutoOneFit );
m_scrollView->setHScrollBarMode( QScrollView::AlwaysOff );
- RfcommAssignDialogBaseLayout->addWidget( m_scrollView );
+ RfcommAssignDialogBaseLayout->addWidget(m_scrollView);
- m_box = new QVBox( m_scrollView->viewport() );
- m_scrollView->addChild( m_box );
+ m_box = new QVBox(m_scrollView->viewport());
+ m_scrollView->addChild(m_box);
confHandler = new RfCommConfHandler( "/etc/bluetooth/rfcomm.conf" );
loadConfig();
}
RfcommAssignDialog::~RfcommAssignDialog()
{
if ( confHandler )
{
delete confHandler;
}
}
-void RfcommAssignDialog::newDevice( const QString & mac )
+void RfcommAssignDialog::newDevice(const QString & mac, int channel)
{
for ( int i = 0 ; i < m_range; i++ )
{
-
QMap<QString, RfCommConfObject*>::Iterator it;
- it = confHandler->foundEntries().find( QString("%1").arg( i ) );
+ it = confHandler->foundEntries().find(QString::number(i));
// make sure that rfcommX is not assigned yet
- if ( it == confHandler->foundEntries().end() )
+ if ( it == confHandler->foundEntries().end() )
{
QDialog dialog( this, "newdevice", true, WStyle_ContextHelp );
dialog.setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7,
(QSizePolicy::SizeType)7, sizePolicy().hasHeightForWidth()));
-
- RfcommDialogItem *newDev = new RfcommDialogItem( &dialog );
- newDev->setIdent( i );
- newDev->setMac( mac );
+ QVBoxLayout layout(&dialog);
+ layout.setSpacing( 0 );
+ layout.setMargin( 0 );
+
+ RfcommDialogItem newDev(&dialog);
+ newDev.setIdent( i );
+ newDev.setMac( mac );
+ newDev.setChannel( channel );
+ layout.addWidget(&newDev);
if ( QPEApplication::execDialog( &dialog ) == QDialog::Accepted )
{
- RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box );
- m_itemList.insert( i , rfcomm );
+ QMap<int, RfcommDialogItem*>::Iterator it;
+ it = m_itemList.find( i );
+ RfcommDialogItem *rfcomm = it.data();
rfcomm->setIdent( i );
rfcomm->setMac( mac );
- rfcomm->setChannel( newDev->channel() );
- rfcomm->setComment( newDev->comment() );
+ rfcomm->setChannel( newDev.channel() );
+ rfcomm->setComment( newDev.comment() );
+ rfcomm->setBind( newDev.isBind() );
odebug << "New device set up" << oendl;
}
+ break;
}
}
}
+/*
+ * Load rfcomm bind configuration
+ */
void RfcommAssignDialog::loadConfig()
{
-
- //Config cfg( "bluetoothmanager-rfcommbind" );
-
for ( int i = 0 ; i < m_range; i++ )
{
- // cfg.setGroup( QString("%1").arg( i ) );
RfcommDialogItem *rfcomm = new RfcommDialogItem( m_box );
- m_itemList.insert( i , rfcomm );
- rfcomm->setIdent( i );
+ m_itemList.insert(i, rfcomm);
+ rfcomm->setIdent(i);
QMap<QString, RfCommConfObject*>::Iterator it;
- it = confHandler->foundEntries().find( QString("%1").arg( i ) );
- if ( it != confHandler->foundEntries().end() )
+ it = confHandler->foundEntries().find(QString::number(i));
+ if (it != confHandler->foundEntries().end())
{
- odebug << "Found key in foundEntries() " << oendl;
- rfcomm->setMac( it.data()->mac() );
- rfcomm->setChannel( it.data()->channel() );
- rfcomm->setComment( it.data()->comment() );
+ rfcomm->setMac(it.data()->mac());
+ rfcomm->setChannel(it.data()->channel());
+ rfcomm->setComment(it.data()->comment());
+ rfcomm->setBind(it.data()->isBind());
}
- /* Use rfcomm.conf directly for now
- * rfcomm->setMac( cfg.readEntry( "mac", "" ) );
- * rfcomm->setChannel( cfg.readNumEntry( "channel", 1 ) );
- * rfcomm->setComment( cfg.readEntry( "comment", "" ) );
- */
}
}
+/*
+ * Save rfcomm bind configuration
+ */
void RfcommAssignDialog::saveConfig()
{
-
- //Config cfg( "bluetoothmanager-rfcommbind" );
-
QMap< int, RfcommDialogItem*>::Iterator it;
-
QMap< QString, RfCommConfObject*> outMap;
for( it = m_itemList.begin(); it != m_itemList.end(); ++it )
{
-
- //cfg.setGroup( QString("%1").arg( it.key() ) );
RfcommDialogItem *rfcomm = it.data();
-
-
- outMap.insert( QString( "%1").arg( it.key() ), new RfCommConfObject( it.key(), rfcomm->mac(), rfcomm->channel(), rfcomm->comment() ) );
-
-
- //cfg.writeEntry( "mac", rfcomm->mac() );
- //cfg.writeEntry( "channel", rfcomm->channel() );
- //cfg.writeEntry( "comment", rfcomm->comment() );
+ if (rfcomm->mac().isEmpty())
+ continue;
+ outMap.insert(QString::number(it.key()),
+ new RfCommConfObject(it.key(),
+ rfcomm->mac(), rfcomm->channel(), rfcomm->comment(),
+ rfcomm->isBind()));
}
+ confHandler->save(outMap);
+}
- confHandler->save( outMap );
-
+/*
+ * Reaction on the OK button
+ */
+void RfcommAssignDialog::accept()
+{
+ odebug << "save configuration" << oendl;
+ saveConfig();
+ RfcommAssignDialogBase::accept();
}
+
+//eof
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogimpl.h b/noncore/net/opietooth/manager/rfcommassigndialogimpl.h
index 9983632..12cde0e 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogimpl.h
+++ b/noncore/net/opietooth/manager/rfcommassigndialogimpl.h
@@ -1,39 +1,49 @@
+/* $Id$ */
+/* RFCOMM binding table edit dialog */
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ ***************************************************************************/
#ifndef RFCOMMASSIGN
#define RFCOMMASSIGN
#include "rfcommassigndialogbase.h"
#include "rfcommassigndialogitem.h"
#include "rfcommconfhandler.h"
#include <qscrollview.h>
#include <qmap.h>
#include <qvbox.h>
namespace OpieTooth {
class RfcommAssignDialog: public RfcommAssignDialogBase {
-
- Q_OBJECT
-
+ Q_OBJECT
public:
+ RfcommAssignDialog(QWidget* parent = 0, const char* name = 0,
+ bool modal = 0, WFlags fl = 0);
+ ~RfcommAssignDialog();
- RfcommAssignDialog( QWidget* parent = 0, const char* name = 0,bool modal = 0, WFlags fl = 0 );
- ~RfcommAssignDialog();
-
- void loadConfig();
- void saveConfig();
+ void loadConfig();
+ void saveConfig();
- void newDevice( const QString & mac );
+ void newDevice( const QString & mac, int channel );
private:
- QScrollView *m_scrollView;
- // how many rfcomm devices are possible
- int m_range;
- QMap< int, RfcommDialogItem* > m_itemList;
- QVBox *m_box;
- RfCommConfHandler *confHandler;
+ QScrollView *m_scrollView;
+ // how many rfcomm devices are possible
+ int m_range;
+ QMap< int, RfcommDialogItem* > m_itemList;
+ QVBox *m_box;
+ RfCommConfHandler *confHandler;
+ protected slots:
+ virtual void accept();
};
}
#endif
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogitem.cpp b/noncore/net/opietooth/manager/rfcommassigndialogitem.cpp
index a41f304..472b86c 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogitem.cpp
+++ b/noncore/net/opietooth/manager/rfcommassigndialogitem.cpp
@@ -1,53 +1,62 @@
#include "rfcommassigndialogitem.h"
#include <qlineedit.h>
#include <qcombobox.h>
#include <qgroupbox.h>
+#include <qcheckbox.h>
using namespace OpieTooth;
RfcommDialogItem::RfcommDialogItem( QWidget* parent, const char* name, WFlags fl )
: RfcommDialogItemBase( parent, name, fl ) {
}
RfcommDialogItem::~RfcommDialogItem() {
}
int RfcommDialogItem::ident() {
return m_ident;
}
QString RfcommDialogItem::mac() {
return m_macAddress->text();
}
int RfcommDialogItem::channel() {
return m_channelDropdown->currentItem();
}
QString RfcommDialogItem::comment() {
return m_commentLine->text();
}
+bool RfcommDialogItem::isBind() {
+ return m_bind->isChecked();
+}
+
void RfcommDialogItem::setIdent( int ident ) {
m_ident = ident;
m_identLabel->setTitle( QString( "rfcomm%1").arg( ident ) );
}
void RfcommDialogItem::setMac( const QString &mac ) {
m_macAddress->setText( mac );
}
void RfcommDialogItem::setChannel( int channel ) {
m_channelDropdown->setCurrentItem( channel );
}
void RfcommDialogItem::setComment( const QString &comment ) {
m_commentLine->setText( comment );
}
+void RfcommDialogItem::setBind( bool dobind ) {
+ m_bind->setChecked( dobind );
+}
+//eof
diff --git a/noncore/net/opietooth/manager/rfcommassigndialogitem.h b/noncore/net/opietooth/manager/rfcommassigndialogitem.h
index 34a794f..cc9c8db 100644
--- a/noncore/net/opietooth/manager/rfcommassigndialogitem.h
+++ b/noncore/net/opietooth/manager/rfcommassigndialogitem.h
@@ -1,40 +1,42 @@
#ifndef RFCOMMDIALOGITEM
#define RFCOMMDIALOGITEM
#include "rfcommdialogitembase.h"
#include <qwidget.h>
namespace OpieTooth {
class RfcommDialogItem : public RfcommDialogItemBase {
Q_OBJECT
public:
RfcommDialogItem( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
~RfcommDialogItem();
// number if the rfcomm device
int ident();
// devices mac address
QString mac();
int channel();
QString comment();
+ bool isBind();
- void setIdent( int ident );
+ void setIdent( int ident );
void setMac( const QString& mac );
void setChannel( int channel );
void setComment( const QString& comment );
+ void setBind(bool dobind);
private:
int m_ident;
};
}
#endif
diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.cpp b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
index f82d2c8..054b446 100644
--- a/noncore/net/opietooth/manager/rfcommconfhandler.cpp
+++ b/noncore/net/opietooth/manager/rfcommconfhandler.cpp
@@ -1,116 +1,160 @@
#include <qtextstream.h>
#include <opie2/odebug.h>
using namespace Opie::Core;
#include "rfcommconfhandler.h"
using namespace OpieTooth;
// move to lib
-RfCommConfObject::RfCommConfObject( int number, QString mac, int channel, QString comment ) {
+RfCommConfObject::RfCommConfObject(int number, QString mac, int channel,
+ QString comment, bool bind) {
m_number = number;
m_mac = mac;
m_channel = channel;
m_comment = comment;
- // m_foundEntries = 0;
+ m_doBind = bind;
}
void RfCommConfObject::setNumber( int number ) {
m_number = number;
}
void RfCommConfObject::setMac( QString mac ) {
m_mac = mac;
}
void RfCommConfObject::setChannel( int channel ) {
m_channel = channel;
}
void RfCommConfObject::setComment( QString comment ) {
m_comment = comment;
}
RfCommConfObject::~RfCommConfObject() {
}
RfCommConfHandler::RfCommConfHandler( const QString & filename ) {
-
m_filename = filename;
load();
}
RfCommConfHandler::~RfCommConfHandler() {
}
void RfCommConfHandler::save( QMap<QString, RfCommConfObject*> devices ) {
- QFile rfCommConf( "/tmp/test" );
+//// For debugging purposes
+//// QFile rfCommConf( "/mnt/net/opie/bin/rfcomm.conf" );
+ QFile rfCommConf( m_filename );
QTextStream outStream( &rfCommConf );
if ( rfCommConf.open( IO_WriteOnly ) ) {
-
QMap<QString, RfCommConfObject*>::Iterator it;
+ outStream << "#\n";
+ outStream << "# RFCOMM configuration file.\n";
+ outStream << "#\n";
+ outStream << "# $Id$\n";
+ outStream << "#\n\n";
for( it = devices.begin(); it != devices.end(); ++it ) {
outStream << "rfcomm" + QString("%1").arg( it.data()->number() ) + " {\n";
- outStream << " device " + it.data()->mac() + ";\n";
- outStream << " channel " + QString( "%1" ).arg( it.data()->channel() ) + ";\n";
- outStream << " comment \"" + it.data()->comment() + "\";\n";
+ outStream << "\t# Automatically bind the device at startup\n";
+ outStream << "\tbind " << ((it.data()->isBind())? "yes": "no") << ";\n";
+ outStream << "\n";
+ outStream << "\t# Bluetooth address of the device\n";
+ outStream << "\tdevice " + it.data()->mac() + ";\n";
+ outStream << "\n";
+ outStream << "\t# RFCOMM channel for the connection\n";
+ outStream << "\tchannel\t" + QString( "%1" ).arg( it.data()->channel() ) + ";\n";
+ outStream << "\n";
+ outStream << "\t# Description of the connection\n";
+ outStream << "\tcomment \"" + it.data()->comment() + "\";\n";
outStream << "}\n\n";
}
-
rfCommConf.close();
}
}
QMap<QString, RfCommConfObject*> RfCommConfHandler::foundEntries() {
return m_foundEntries;
}
void RfCommConfHandler::load() {
+ //Keywords
+ QCString k_rfcomm("rfcomm");
+ QCString k_device("device ");
+ QCString k_channel("channel ");
+ QCString k_comment("comment ");
+ QCString k_bind("bind ");
- QFile rfCommConf( m_filename );
- if ( rfCommConf.open( IO_ReadOnly ) ) {
+ m_foundEntries.clear();
+ QFile rfCommConf(m_filename); //File we read
+ if (rfCommConf.open(IO_ReadOnly)) {
QStringList list;
QTextStream inStream( &rfCommConf );
list = QStringList::split( "\n", inStream.read() );
- QString number;
QString mac;
QString channel;
QString comment;
+ QString bind;
+ bool bbind;
+ QString number;
- for ( QStringList::Iterator line=list.begin(); line != list.end(); line++ ) {
+ for (QStringList::Iterator line = list.begin();
+ line != list.end(); line++) {
- QString tmpLine = ( *line ).stripWhiteSpace();
+ QString tmpLine = (*line).simplifyWhiteSpace();
- if ( tmpLine.startsWith("rfcomm") ) {
- QString number = tmpLine.mid( 6,1 );
+ if (tmpLine.startsWith(k_rfcomm)) {
+ number = tmpLine.mid( k_rfcomm.length(), 1 );
odebug << tmpLine << oendl;
- odebug << "TEST " + number << oendl;
+ odebug << "device " << number << oendl;
} else if ( tmpLine.startsWith( "}" ) ) {
- m_foundEntries.insert( number, new RfCommConfObject( number.toInt(), mac, channel.toInt(), comment ) );
- } else if ( tmpLine.startsWith( "device" ) ) {
- mac = tmpLine.mid( 7, 17 );
- odebug << "mac" + mac << oendl;
- } else if ( tmpLine.startsWith( "channel" ) ) {
- channel = tmpLine.mid( 8, 1 );
- odebug << "Channel :" << channel << oendl;
- } else if ( tmpLine.startsWith( "comment" ) ) {
- comment = tmpLine.mid( 9, tmpLine.find( ';' ) - 9 - 1 );
+ m_foundEntries.insert(number,
+ new RfCommConfObject(number.toInt(), mac, channel.toInt(),
+ comment, bbind));
+ } else if ( tmpLine.startsWith(k_device) ) {
+ mac = tmpLine.mid(k_device.length(),
+ tmpLine.find(';') - k_device.length());
+ odebug << "mac " + mac << oendl;
+ } else if ( tmpLine.startsWith(k_channel) ) {
+ channel = tmpLine.mid(k_channel.length(),
+ tmpLine.find(';') - k_channel.length());
+ odebug << "Channel: " << channel << oendl;
+ } else if ( tmpLine.startsWith(k_comment) ) {
+ comment = tmpLine.mid(k_comment.length(),
+ tmpLine.find(';') - k_comment.length());
+ if (comment.left(1) == "\"")
+ comment.remove(0, 1);
+ if (comment.right(1) == "\"")
+ comment.remove(comment.length() - 1, 1);
odebug << "Comment: " + comment << oendl;
+ } else if ( tmpLine.startsWith(k_bind) ) {
+ bind = tmpLine.mid(k_bind.length(),
+ tmpLine.find(';') - k_bind.length());
+ if (bind == "no")
+ bbind = false;
+ else if (bind == "yes")
+ bbind = true;
+ else
+ bbind = true;
+ odebug << "bind: " + bind << oendl;
}
}
rfCommConf.close();
}
- save( m_foundEntries );
+ save(m_foundEntries);
odebug << QString( "ENTries: %1").arg( m_foundEntries.count() ) << oendl;
}
+
+//eof
diff --git a/noncore/net/opietooth/manager/rfcommconfhandler.h b/noncore/net/opietooth/manager/rfcommconfhandler.h
index e13c833..46aaa26 100644
--- a/noncore/net/opietooth/manager/rfcommconfhandler.h
+++ b/noncore/net/opietooth/manager/rfcommconfhandler.h
@@ -1,54 +1,57 @@
#ifndef RFCOMMCONFHANDLER
#define RFCOMMCONFHANDLER
#include <qstring.h>
#include <qfile.h>
#include <qobject.h>
#include <qmap.h>
namespace OpieTooth {
class RfCommConfObject {
public:
- RfCommConfObject( int number, QString mac, int channel, QString comment );
+ RfCommConfObject( int number, QString mac, int channel, QString comment,
+ bool bind);
~RfCommConfObject();
void setNumber( int number );
int number() { return m_number; };
void setMac( QString mac );
QString mac() { return m_mac; };
void setChannel( int channel );
int channel() { return m_channel; };
void setComment( QString comment );
QString comment() { return m_comment; };
-
+ bool isBind() { return m_doBind; }
+ void doBind(bool arg) { m_doBind = arg; }
private:
+ bool m_doBind;
int m_number;
QString m_mac;
int m_channel;
QString m_comment;
};
class RfCommConfHandler {
public:
RfCommConfHandler( const QString & filename );
~RfCommConfHandler();
void save( QMap<QString, RfCommConfObject*> devices );
QMap<QString, RfCommConfObject*> foundEntries();
private:
void load();
QString m_filename;
QMap<QString, RfCommConfObject*> m_foundEntries;
};
}
#endif
diff --git a/noncore/net/opietooth/manager/rfcommdialogitembase.ui b/noncore/net/opietooth/manager/rfcommdialogitembase.ui
index dd8f121..43f3269 100644
--- a/noncore/net/opietooth/manager/rfcommdialogitembase.ui
+++ b/noncore/net/opietooth/manager/rfcommdialogitembase.ui
@@ -1,243 +1,277 @@
<!DOCTYPE UI><UI>
<class>RfcommDialogItemBase</class>
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>RfcommDialogItemBase</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>239</width>
+ <width>235</width>
<height>95</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Form2</string>
</property>
<vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
<number>0</number>
</property>
<widget>
<class>QGroupBox</class>
<property stdset="1">
<name>name</name>
<cstring>m_identLabel</cstring>
</property>
<property stdset="1">
<name>title</name>
<string></string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
- <grid>
+ <vbox>
<property stdset="1">
<name>margin</name>
- <number>5</number>
+ <number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
- <number>5</number>
+ <number>2</number>
</property>
- <widget row="0" column="0" >
+ <widget>
<class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
<cstring>Layout3</cstring>
</property>
- <hbox>
+ <property>
+ <name>layoutSpacing</name>
+ </property>
+ <vbox>
<property stdset="1">
<name>margin</name>
<number>0</number>
</property>
<property stdset="1">
<name>spacing</name>
- <number>6</number>
+ <number>2</number>
</property>
<widget>
- <class>QLabel</class>
+ <class>QCheckBox</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel4</cstring>
+ <cstring>m_bind</cstring>
</property>
<property stdset="1">
<name>text</name>
- <string>Mac</string>
- </property>
- </widget>
- <widget>
- <class>QLineEdit</class>
- <property stdset="1">
- <name>name</name>
- <cstring>m_macAddress</cstring>
+ <string>bind automatically</string>
</property>
</widget>
<widget>
- <class>QLabel</class>
+ <class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>TextLabel5</cstring>
+ <cstring>Layout3</cstring>
</property>
- <property stdset="1">
- <name>text</name>
- <string>Channel</string>
+ <property>
+ <name>layoutSpacing</name>
</property>
- </widget>
- <widget>
- <class>QComboBox</class>
- <item>
- <property>
- <name>text</name>
- <string>0</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>1</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>2</string>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
</property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>3</string>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
</property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>4</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>5</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>6</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>7</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>8</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>9</string>
- </property>
- </item>
- <item>
- <property>
- <name>text</name>
- <string>10</string>
- </property>
- </item>
- <property stdset="1">
- <name>name</name>
- <cstring>m_channelDropdown</cstring>
- </property>
- </widget>
- </hbox>
- </widget>
- <widget row="1" column="0" >
- <class>QLayoutWidget</class>
- <property stdset="1">
- <name>name</name>
- <cstring>Layout4</cstring>
- </property>
- <hbox>
- <property stdset="1">
- <name>margin</name>
- <number>0</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget>
- <class>QLabel</class>
- <property stdset="1">
- <name>name</name>
- <cstring>TextLabel3</cstring>
- </property>
- <property stdset="1">
- <name>sizePolicy</name>
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>1</vsizetype>
- </sizepolicy>
- </property>
- <property stdset="1">
- <name>text</name>
- <string>Comment:</string>
- </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Mac</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>m_macAddress</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel5</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Channel</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QComboBox</class>
+ <item>
+ <property>
+ <name>text</name>
+ <string>0</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>1</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>2</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>3</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>4</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>5</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>6</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>7</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>8</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>9</string>
+ </property>
+ </item>
+ <item>
+ <property>
+ <name>text</name>
+ <string>10</string>
+ </property>
+ </item>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>m_channelDropdown</cstring>
+ </property>
+ </widget>
+ </hbox>
</widget>
<widget>
- <class>QLineEdit</class>
+ <class>QLayoutWidget</class>
<property stdset="1">
<name>name</name>
- <cstring>m_commentLine</cstring>
+ <cstring>Layout4</cstring>
</property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Comment:</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>m_commentLine</cstring>
+ </property>
+ </widget>
+ </hbox>
</widget>
- </hbox>
+ </vbox>
</widget>
- </grid>
+ </vbox>
</widget>
</vbox>
</widget>
<customwidgets>
<customwidget>
<class>QWidget</class>
<header location="local">qwidget.h</header>
<sizehint>
<width>100</width>
<height>100</height>
</sizehint>
<container>0</container>
<sizepolicy>
<hordata>7</hordata>
<verdata>7</verdata>
</sizepolicy>
<pixmap>image0</pixmap>
</customwidget>
</customwidgets>
<images>
<image>
<name>image0</name>
<data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
</image>
</images>
</UI>
diff --git a/noncore/net/opietooth/manager/rfcpopup.cpp b/noncore/net/opietooth/manager/rfcpopup.cpp
index 7711f0a..04da19f 100644
--- a/noncore/net/opietooth/manager/rfcpopup.cpp
+++ b/noncore/net/opietooth/manager/rfcpopup.cpp
@@ -60,62 +60,63 @@ RfcCommPopup::RfcCommPopup(const OpieTooth::Services& service,
a->setText("Bind table");
a->addTo( this );
connect( a, SIGNAL( activated() ),
this, SLOT( slotBind() ) );
/* bar action */
a = new QAction( );
a->setText( "Bar" );
a->addTo( this );
connect( a, SIGNAL( activated() ),
this, SLOT( slotBar() ) );
};
RfcCommPopup::~RfcCommPopup()
{
/* delete m_con;
delete m_dis;
delete m_foo;
delete m_bar; */
}
void RfcCommPopup::slotConnect()
{
owarn << "connect" << oendl;
PPPDialog pppDialog(m_item->mac(),
m_service.protocolDescriptorList().last().port());
QPEApplication::execDialog( &pppDialog );
}
void RfcCommPopup::slotDisconnect()
{
owarn << "slot disconnected " << procId << oendl;
if (procId >= 0)
PPPDialog::conns[procId].proc.kill();
}
void RfcCommPopup::slotBind()
{
RfcommAssignDialog rfcommAssign ( this, "RfcommAssignDialog", true, WStyle_ContextHelp );
- rfcommAssign.newDevice( m_item->mac() );
+ rfcommAssign.newDevice( m_item->mac(),
+ m_service.protocolDescriptorList().last().port());
if ( QPEApplication::execDialog( &rfcommAssign ) == QDialog::Accepted )
{
rfcommAssign.saveConfig();
}
}
void RfcCommPopup::slotBar()
{
owarn << "slotBar" << oendl;
};