Diffstat (limited to 'noncore/net/opietooth/manager/bluebase.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp index 9ec5bf8..924d191 100644 --- a/noncore/net/opietooth/manager/bluebase.cpp +++ b/noncore/net/opietooth/manager/bluebase.cpp @@ -55,2 +55,3 @@ using namespace Opie::Core; #include <qlist.h> +#include <qfile.h> @@ -96,2 +97,3 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) connect(runButton, SIGNAL(clicked()), this, SLOT(doForward())); + connect(encCheckBox, SIGNAL(toggled(bool)), this, SLOT(doEncrypt(bool))); @@ -132,2 +134,3 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1); + encCheckBox->setChecked(true); } @@ -175,3 +178,5 @@ void BlueBase::writeToHciConfig() { + QFile pinFile("/etc/bluetooth/pin"); // /etc/bluetooth/pin file owarn << "writeToHciConfig" << oendl; + //Write /etc/bluetooth/hcid.conf file HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); @@ -185,2 +190,8 @@ void BlueBase::writeToHciConfig() hciconf.save(); + // Write /etc/bluetooth/pin (default PIN file) + pinFile.open(IO_WriteOnly | IO_Truncate); + pinFile.writeBlock(m_defaultPasskey, m_defaultPasskey.length()); + pinFile.writeBlock("\n", sizeof("\n")); + pinFile.flush(); + pinFile.close(); } @@ -742,2 +753,11 @@ void BlueBase::forwardExit(Opie::Core::OProcess* proc) +/** + * Encrypt entered passkey + * doit - do encryption of the key + */ +void BlueBase::doEncrypt(bool doit) +{ + passkeyLine->setEchoMode((doit)? QLineEdit::Password: QLineEdit::Normal); +} + //eof |