Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 54 |
1 files changed, 48 insertions, 6 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index af65f14..b4b59c3 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp @@ -19,2 +19,3 @@ #include "scandialog.h" +#include "hciconfwrapper.h" @@ -32,3 +33,2 @@ #include <qmessagebox.h> -#include <qapplication.h> #include <qcheckbox.h> @@ -60,4 +60,5 @@ namespace OpieTooth { this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); + // hehe, cast right later connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), - this, SLOT(startServiceActionHold( BTListItem *, const QPoint &, int) ) ); + this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) ); connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), @@ -92,2 +93,3 @@ namespace OpieTooth { (void) new BTListItem( topLV2, "BlueNiC" , "", "service" ); + writeToHciConfig(); } @@ -128,3 +130,41 @@ namespace OpieTooth { cfg.writeEntry( "enableInquiryscan" , enableInquiryscan ); -} + + writeToHciConfig(); + } + + void BlueBase::writeToHciConfig() { + + HciConfWrapper *hciconf = new HciConfWrapper( "/tmp/hcid.conf" ); + hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); + + + // hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" ); + + hciconf->setName( deviceName ); + + if ( useEncryption == 1) { + hciconf->setEncrypt( true ); + } else { + hciconf->setEncrypt( false ); + } + + + if ( enableAuthentification == 1) { + hciconf->setAuth( true ); + } else { + hciconf->setAuth( false ); + } + + if ( enablePagescan == 1) { + hciconf->setPscan( true ); + } else { + hciconf->setPscan( false ); + } + + if ( enableInquiryscan == 1) { + hciconf->setIscan( true ); + } else { + hciconf->setIscan( false ); + } + } @@ -227,2 +267,3 @@ namespace OpieTooth { + QMessageBox* box = new QMessageBox( this, "Test" ); @@ -276,3 +317,3 @@ namespace OpieTooth { */ - void BlueBase::startServiceActionHold( BTListItem * item, const QPoint & point, int column ) { + void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column ) { @@ -282,5 +323,6 @@ namespace OpieTooth { + //QSize s = menu->sizeHint ( ); - if ( item->type() == "device") { + if ( ((BTListItem*)item)->type() == "device") { @@ -307,3 +349,3 @@ namespace OpieTooth { - } else if ( item->type() == "service") { + } else if ( ((BTListItem*)item)->type() == "service") { menu->insertItem( tr("Test1:"), 0); |