summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/bluebase.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp30
1 files changed, 24 insertions, 6 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 924d191..13954c5 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -13,24 +13,25 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "bluebase.h"
#include "scandialog.h"
#include "hciconfwrapper.h"
#include "devicehandler.h"
#include "btconnectionitem.h"
#include "rfcommassigndialogimpl.h"
#include "forwarder.h"
+#include "servicesdialog.h"
#include <termios.h>
#include <string.h>
#include <errno.h>
/* OPIE */
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/config.h>
#include <opie2/odebug.h>
using namespace Opie::Core;
/* QT */
@@ -87,24 +88,25 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
connect( devicesView, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ),
this, SLOT(startServiceActionHold(QListViewItem*,const QPoint&,int) ) );
connect( m_localDevice , SIGNAL( foundServices(const QString&,Services::ValueList) ),
this, SLOT( addServicesToDevice(const QString&,Services::ValueList) ) );
connect( m_localDevice, SIGNAL( available(const QString&,bool) ),
this, SLOT( deviceActive(const QString&,bool) ) );
connect( m_localDevice, SIGNAL( connections(ConnectionState::ValueList) ),
this, SLOT( addConnectedDevices(ConnectionState::ValueList) ) );
connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ),
this, SLOT( addSignalStrength(const QString&,const QString&) ) );
connect(runButton, SIGNAL(clicked()), this, SLOT(doForward()));
connect(encCheckBox, SIGNAL(toggled(bool)), this, SLOT(doEncrypt(bool)));
+ connect(servicesEditButton, SIGNAL(clicked()), this, SLOT(editServices()));
// let hold be rightButtonClicked()
QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold);
QPEApplication::setStylusOperation( connectionsView->viewport(), QPEApplication::RightOnHold);
//Load all icons needed
m_offPix = Resource::loadPixmap( "opietooth/notconnected" );
m_onPix = Resource::loadPixmap( "opietooth/connected" );
m_findPix = Resource::loadPixmap( "opietooth/find" );
QPalette pal = this->palette();
QColor col = pal.color( QPalette::Active, QColorGroup::Background );
@@ -118,30 +120,24 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
readConfig();
initGui();
devicesView->setRootIsDecorated(true);
m_iconLoader = new BTIconLoader();
writeToHciConfig();
addConnectedDevices();
readSavedDevices();
addServicesToDevices();
QTimer::singleShot( 3000, this, SLOT( addServicesToDevices() ) );
forwarder = NULL;
- serDevName->setText(tr("/dev/ircomm0"));
- for (unsigned int i = 0; i < (sizeof(speeds) / sizeof(speeds[0])); i++) {
- serSpeed->insertItem(speeds[i].str);
- }
- serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1);
- encCheckBox->setChecked(true);
}
/**
* Reads all options from the config file
*/
void BlueBase::readConfig()
{
Config cfg( "bluetoothmanager" );
cfg.setGroup( "bluezsettings" );
m_deviceName = cfg.readEntry( "name" , "No name" ); // name the device should identify with
@@ -244,24 +240,30 @@ void BlueBase::writeSavedDevices()
*/
void BlueBase::initGui()
{
StatusLabel->setText( status() ); // maybe move it to getStatus()
cryptCheckBox->setChecked( m_useEncryption );
authCheckBox->setChecked( m_enableAuthentification );
pagescanCheckBox->setChecked( m_enablePagescan );
inquiryscanCheckBox->setChecked( m_enableInquiryscan );
deviceNameLine->setText( m_deviceName );
passkeyLine->setText( m_defaultPasskey );
// set info tab
setInfo();
+ serDevName->setText(tr("/dev/ircomm0"));
+ for (unsigned int i = 0; i < (sizeof(speeds) / sizeof(speeds[0])); i++) {
+ serSpeed->insertItem(speeds[i].str);
+ }
+ serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1);
+ encCheckBox->setChecked(true);
}
/**
* Get the status informations and returns it
* @return QString the status informations gathered
*/
QString BlueBase::status()const
{
QString infoString = tr( "<b>Device name : </b> Ipaq" );
infoString += QString( "<br><b>" + tr( "MAC adress: " ) +"</b> No idea" );
infoString += QString( "<br><b>" + tr( "Class" ) + "</b> PDA" );
@@ -751,13 +753,29 @@ void BlueBase::forwardExit(Opie::Core::OProcess* proc)
runButton->setText("start gateway");
}
/**
* Encrypt entered passkey
* doit - do encryption of the key
*/
void BlueBase::doEncrypt(bool doit)
{
passkeyLine->setEchoMode((doit)? QLineEdit::Password: QLineEdit::Normal);
}
+/**
+ * Start services edit dialog
+ */
+void BlueBase::editServices()
+{
+ QString conf = "/etc/default/bluetooth";
+//// Use for debugging purposes
+//// QString conf = "/mnt/net/opie/bin/bluetooth";
+ ServicesDialog svcEdit(conf, this, "ServicesDialog", true,
+ WStyle_ContextHelp);
+
+ if (QPEApplication::execDialog(&svcEdit) == QDialog::Accepted)
+ {
+ }
+}
+
//eof