Diffstat (limited to 'noncore/net/opietooth/manager') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 20 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.h | 1 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluetoothbase.ui | 264 |
3 files changed, 145 insertions, 140 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 diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h index 0128a88..9cbea56 100644 --- a/noncore/net/opietooth/manager/bluebase.h +++ b/noncore/net/opietooth/manager/bluebase.h @@ -96,2 +96,3 @@ namespace OpieTooth { void doForward(); + void doEncrypt(bool); void forwardExit(Opie::Core::OProcess* proc); diff --git a/noncore/net/opietooth/manager/bluetoothbase.ui b/noncore/net/opietooth/manager/bluetoothbase.ui index a5e2c6f..5539181 100644 --- a/noncore/net/opietooth/manager/bluetoothbase.ui +++ b/noncore/net/opietooth/manager/bluetoothbase.ui @@ -13,3 +13,3 @@ <y>0</y> - <width>268</width> + <width>273</width> <height>368</height> @@ -21,3 +21,3 @@ </property> - <vbox> + <hbox> <property stdset="1"> @@ -241,7 +241,7 @@ </property> - <widget row="6" column="0" rowspan="1" colspan="2" > - <class>QPushButton</class> + <widget row="0" column="0" > + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>configApplyButton</cstring> + <cstring>deviceNameLabel</cstring> </property> @@ -249,10 +249,10 @@ <name>text</name> - <string>Apply</string> + <string>Device Name</string> </property> </widget> - <widget row="2" column="0" rowspan="1" colspan="2" > - <class>QCheckBox</class> + <widget row="1" column="0" > + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>authCheckBox</cstring> + <cstring>passkeyLabel</cstring> </property> @@ -260,17 +260,24 @@ <name>text</name> - <string>enable authentification</string> + <string>Default Passkey</string> </property> </widget> - <widget row="3" column="0" rowspan="1" colspan="2" > - <class>QCheckBox</class> + <widget row="0" column="1" > + <class>QLineEdit</class> <property stdset="1"> <name>name</name> - <cstring>cryptCheckBox</cstring> + <cstring>deviceNameLine</cstring> </property> + </widget> + <widget row="1" column="1" > + <class>QLineEdit</class> <property stdset="1"> - <name>text</name> - <string>enable encryption</string> + <name>name</name> + <cstring>passkeyLine</cstring> + </property> + <property stdset="1"> + <name>echoMode</name> + <enum>Password</enum> </property> </widget> - <widget row="4" column="0" rowspan="1" colspan="2" > + <widget row="2" column="1" > <class>QCheckBox</class> @@ -278,3 +285,3 @@ <name>name</name> - <cstring>pagescanCheckBox</cstring> + <cstring>encCheckBox</cstring> </property> @@ -282,6 +289,6 @@ <name>text</name> - <string>Enable Page scan</string> + <string>encrypt</string> </property> </widget> - <widget row="5" column="0" rowspan="1" colspan="2" > + <widget row="3" column="0" rowspan="1" colspan="2" > <class>QCheckBox</class> @@ -289,3 +296,3 @@ <name>name</name> - <cstring>inquiryscanCheckBox</cstring> + <cstring>authCheckBox</cstring> </property> @@ -293,10 +300,10 @@ <name>text</name> - <string>Enable Inquiry scan</string> + <string>enable authentification</string> </property> </widget> - <widget row="0" column="0" > - <class>QLabel</class> + <widget row="4" column="0" rowspan="1" colspan="2" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>deviceNameLabel</cstring> + <cstring>cryptCheckBox</cstring> </property> @@ -304,10 +311,10 @@ <name>text</name> - <string>Device Name</string> + <string>enable encryption</string> </property> </widget> - <widget row="1" column="0" > - <class>QLabel</class> + <widget row="5" column="0" rowspan="1" colspan="2" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>passkeyLabel</cstring> + <cstring>pagescanCheckBox</cstring> </property> @@ -315,21 +322,25 @@ <name>text</name> - <string>Default Passkey</string> + <string>Enable Page scan</string> </property> </widget> - <widget row="0" column="1" > - <class>QLineEdit</class> + <widget row="6" column="0" rowspan="1" colspan="2" > + <class>QCheckBox</class> <property stdset="1"> <name>name</name> - <cstring>deviceNameLine</cstring> + <cstring>inquiryscanCheckBox</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Enable Inquiry scan</string> </property> </widget> - <widget row="1" column="1" > - <class>QLineEdit</class> + <widget row="7" column="0" rowspan="1" colspan="2" > + <class>QPushButton</class> <property stdset="1"> <name>name</name> - <cstring>passkeyLine</cstring> + <cstring>configApplyButton</cstring> </property> <property stdset="1"> - <name>echoMode</name> - <enum>Password</enum> + <name>text</name> + <string>Apply</string> </property> @@ -353,3 +364,3 @@ <name>margin</name> - <number>4</number> + <number>0</number> </property> @@ -357,3 +368,3 @@ <name>spacing</name> - <number>2</number> + <number>0</number> </property> @@ -385,3 +396,3 @@ <name>margin</name> - <number>0</number> + <number>4</number> </property> @@ -389,3 +400,3 @@ <name>spacing</name> - <number>0</number> + <number>2</number> </property> @@ -401,6 +412,12 @@ </property> - <vbox> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> + </property> + <grid> <property stdset="1"> <name>margin</name> - <number>11</number> + <number>4</number> </property> @@ -408,103 +425,52 @@ <name>spacing</name> - <number>6</number> + <number>2</number> </property> - <widget> - <class>QLayoutWidget</class> + <widget row="2" column="0" rowspan="1" colspan="3" > + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>runButton</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>start gateway</string> + </property> + </widget> + <widget row="0" column="0" rowspan="1" colspan="2" > + <class>QLabel</class> <property stdset="1"> <name>name</name> - <cstring>Layout9</cstring> + <cstring>serDevLabel</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Serial device:</string> </property> - <vbox> - <property stdset="1"> - <name>margin</name> - <number>0</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> - </property> - <widget> - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout5</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>serDevLabel</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Serial device:</string> - </property> - </widget> - <widget> - <class>QLineEdit</class> - <property stdset="1"> - <name>name</name> - <cstring>serDevName</cstring> - </property> - </widget> - </hbox> - </widget> - <widget> - <class>QLayoutWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Layout6</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>serSpeedLabel</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>Speed:</string> - </property> - </widget> - <widget> - <class>QComboBox</class> - <property stdset="1"> - <name>name</name> - <cstring>serSpeed</cstring> - </property> - </widget> - </hbox> - </widget> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>runButton</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string>start gateway</string> - </property> - </widget> - </vbox> </widget> - </vbox> + <widget row="0" column="2" > + <class>QLineEdit</class> + <property stdset="1"> + <name>name</name> + <cstring>serDevName</cstring> + </property> + </widget> + <widget row="1" column="1" rowspan="1" colspan="2" > + <class>QComboBox</class> + <property stdset="1"> + <name>name</name> + <cstring>serSpeed</cstring> + </property> + </widget> + <widget row="1" column="0" > + <class>QLabel</class> + <property stdset="1"> + <name>name</name> + <cstring>serSpeedLabel</cstring> + </property> + <property stdset="1"> + <name>text</name> + <string>Speed:</string> + </property> + </widget> + </grid> </widget> @@ -513,3 +479,3 @@ </widget> - </vbox> + </hbox> </widget> @@ -537,2 +503,20 @@ </images> +<tabstops> + <tabstop>Status</tabstop> + <tabstop>devicesView</tabstop> + <tabstop>PushButton2</tabstop> + <tabstop>connectionsView</tabstop> + <tabstop>deviceNameLine</tabstop> + <tabstop>passkeyLine</tabstop> + <tabstop>encCheckBox</tabstop> + <tabstop>authCheckBox</tabstop> + <tabstop>cryptCheckBox</tabstop> + <tabstop>pagescanCheckBox</tabstop> + <tabstop>inquiryscanCheckBox</tabstop> + <tabstop>configApplyButton</tabstop> + <tabstop>rfcommBindButton</tabstop> + <tabstop>serDevName</tabstop> + <tabstop>serSpeed</tabstop> + <tabstop>runButton</tabstop> +</tabstops> </UI> |