-rw-r--r-- | noncore/net/opietooth/blue-pin/pindlg.cc | 12 | ||||
-rw-r--r-- | noncore/net/opietooth/blue-pin/pindlg.h | 1 | ||||
-rw-r--r-- | noncore/net/opietooth/blue-pin/pindlgbase.ui | 519 |
3 files changed, 466 insertions, 66 deletions
diff --git a/noncore/net/opietooth/blue-pin/pindlg.cc b/noncore/net/opietooth/blue-pin/pindlg.cc index e40fe33..3db6095 100644 --- a/noncore/net/opietooth/blue-pin/pindlg.cc +++ b/noncore/net/opietooth/blue-pin/pindlg.cc @@ -4,16 +4,17 @@ /* OPIE */ #include <qpe/config.h> #include <qpe/qpeapplication.h> /* QT */ #include <qcheckbox.h> #include <qlabel.h> #include <qlineedit.h> +#include <qpushbutton.h> /* STD */ #include <stdio.h> using namespace OpieTooth; PinDlg::PinDlg(QWidget* parent, const char* name, @@ -27,17 +28,17 @@ PinDlg::PinDlg(QWidget* parent, // can't obtain MAC printf("ERR\n"); ::exit(0); } else { test( m_mac ); txtStatus->setText(makeTextFromArgs()); - QPEApplication::showDialog( this , true) ; + QPEApplication::showDialog( this , false) ; } } PinDlg::~PinDlg() {} void PinDlg::setMac( const QString& mac ) { @@ -89,21 +90,30 @@ QString PinDlg::makeTextFromArgs() QString PinDlg::makeMacFromArgs() { if(qApp->argc() < 3) return QString::null; else return qApp->argv()[2] ; } +void PinDlg::addnum() +{ + if( sender()->inherits( "QPushButton") ) { + const QPushButton* btn = static_cast<const QPushButton*> (sender()); + lnePin->setText(lnePin->text() + btn->text()); + } +} + void PinDlg::accept() { if ( ckbPin->isChecked() ) { Config cfg("bluepin"); cfg.setGroup(m_mac ); cfg.writeEntryCrypt("pin", lnePin->text() ); } printf("PIN:%s\n", lnePin->text().latin1()); QDialog::accept(); qApp->quit(); ::exit(0); } + diff --git a/noncore/net/opietooth/blue-pin/pindlg.h b/noncore/net/opietooth/blue-pin/pindlg.h index 8623274..1817aa8 100644 --- a/noncore/net/opietooth/blue-pin/pindlg.h +++ b/noncore/net/opietooth/blue-pin/pindlg.h @@ -23,11 +23,12 @@ namespace OpieTooth { QString makeTextFromArgs(); QString makeMacFromArgs(); QString m_mac; protected slots: void accept(); + void addnum(); }; }; diff --git a/noncore/net/opietooth/blue-pin/pindlgbase.ui b/noncore/net/opietooth/blue-pin/pindlgbase.ui index a79bb49..6586014 100644 --- a/noncore/net/opietooth/blue-pin/pindlgbase.ui +++ b/noncore/net/opietooth/blue-pin/pindlgbase.ui @@ -1,232 +1,621 @@ <!DOCTYPE UI><UI> <class>PinDlgBase</class> -<author>zecke</author> +<author>gints</author> <widget> <class>QDialog</class> <property stdset="1"> <name>name</name> <cstring>Form1</cstring> </property> <property stdset="1"> <name>geometry</name> <rect> <x>0</x> <y>0</y> - <width>267</width> - <height>161</height> + <width>196</width> + <height>175</height> </rect> </property> <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>3</hsizetype> + <vsizetype>3</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> <name>caption</name> <string>Please enter pin</string> </property> - <grid> <property stdset="1"> - <name>margin</name> - <number>11</number> + <name>sizeGripEnabled</name> + <bool>false</bool> </property> - <property stdset="1"> - <name>spacing</name> - <number>6</number> + <property> + <name>layoutMargin</name> </property> - <widget row="0" column="0" > - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>txtStatus</cstring> + <property> + <name>layoutSpacing</name> </property> + <vbox> <property stdset="1"> - <name>text</name> - <string></string> + <name>margin</name> + <number>5</number> </property> <property stdset="1"> - <name>textFormat</name> - <enum>RichText</enum> + <name>spacing</name> + <number>2</number> </property> - </widget> - <widget row="1" column="0" > + <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>Layout6</cstring> + <cstring>Layout9</cstring> </property> - <vbox> + <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> + <cstring>txtStatus</cstring> + </property> + <property stdset="1"> + <name>font</name> + <font> + </font> </property> <property stdset="1"> <name>text</name> - <string>Please enter PIN:</string> + <string>Enter PIN:</string> + </property> + </widget> + <spacer> + <property> + <name>name</name> + <cstring>Spacer1</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Horizontal</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> </property> + </spacer> + </hbox> </widget> <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>Layout5</cstring> + <cstring>Layout8</cstring> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> <number>6</number> </property> + <spacer> + <property> + <name>name</name> + <cstring>Spacer2</cstring> + </property> + <property stdset="1"> + <name>orientation</name> + <enum>Horizontal</enum> + </property> + <property stdset="1"> + <name>sizeType</name> + <enum>Expanding</enum> + </property> + <property> + <name>sizeHint</name> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> <widget> <class>QLineEdit</class> <property stdset="1"> <name>name</name> <cstring>lnePin</cstring> </property> <property stdset="1"> - <name>echoMode</name> - <enum>Password</enum> + <name>frame</name> + <bool>true</bool> </property> </widget> <spacer> <property> <name>name</name> - <cstring>Spacer4</cstring> + <cstring>Spacer3</cstring> </property> <property stdset="1"> <name>orientation</name> <enum>Horizontal</enum> </property> <property stdset="1"> <name>sizeType</name> - <enum>Fixed</enum> + <enum>Expanding</enum> </property> <property> <name>sizeHint</name> <size> - <width>21</width> + <width>20</width> <height>20</height> </size> </property> </spacer> - </hbox> - </widget> <widget> <class>QCheckBox</class> <property stdset="1"> <name>name</name> <cstring>ckbPin</cstring> </property> <property stdset="1"> <name>text</name> - <string>Save pin</string> + <string>Save</string> + </property> + <property stdset="1"> + <name>checked</name> + <bool>true</bool> </property> </widget> - </vbox> + </hbox> </widget> - <widget row="2" column="0" > + <widget> <class>QLayoutWidget</class> <property stdset="1"> <name>name</name> - <cstring>Layout7</cstring> + <cstring>Layout22</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>32767</width> + <height>35</height> + </size> + </property> + <property> + <name>layoutMargin</name> + </property> + <property> + <name>layoutSpacing</name> </property> <hbox> <property stdset="1"> <name>margin</name> <number>0</number> </property> <property stdset="1"> <name>spacing</name> - <number>6</number> + <number>2</number> </property> - <spacer> - <property> + <widget> + <class>QPushButton</class> + <property stdset="1"> <name>name</name> - <cstring>Spacer1</cstring> + <cstring>bt1</cstring> </property> <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> </property> <property stdset="1"> - <name>sizeType</name> - <enum>Fixed</enum> + <name>text</name> + <string>1</string> + </property> + </widget> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>bt2</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> + </property> + <property stdset="1"> + <name>text</name> + <string>2</string> + </property> + </widget> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>bt3</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> + </property> + <property stdset="1"> + <name>text</name> + <string>3</string> + </property> + </widget> + </hbox> + </widget> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout22_2</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>32767</width> + <height>35</height> + </size> </property> <property> - <name>sizeHint</name> + <name>layoutSpacing</name> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>2</number> + </property> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>bt4</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> <size> - <width>30</width> - <height>20</height> + <width>60</width> + <height>25</height> </size> </property> - </spacer> + <property stdset="1"> + <name>text</name> + <string>4</string> + </property> + </widget> <widget> <class>QPushButton</class> <property stdset="1"> <name>name</name> - <cstring>PushButton1</cstring> + <cstring>bt5</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> </property> <property stdset="1"> <name>text</name> - <string>&Ok</string> + <string>5</string> </property> </widget> <widget> <class>QPushButton</class> <property stdset="1"> <name>name</name> - <cstring>PushButton2</cstring> + <cstring>bt6</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> </property> <property stdset="1"> <name>text</name> - <string>&Cancel</string> + <string>6</string> </property> </widget> - <spacer> + </hbox> + </widget> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout22_2_2</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>32767</width> + <height>35</height> + </size> + </property> <property> + <name>layoutSpacing</name> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>2</number> + </property> + <widget> + <class>QPushButton</class> + <property stdset="1"> <name>name</name> - <cstring>Spacer2</cstring> + <cstring>bt7</cstring> </property> <property stdset="1"> - <name>orientation</name> - <enum>Horizontal</enum> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> </property> <property stdset="1"> - <name>sizeType</name> - <enum>Fixed</enum> + <name>text</name> + <string>7</string> + </property> + </widget> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>bt8</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> + </property> + <property stdset="1"> + <name>text</name> + <string>8</string> + </property> + </widget> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>bt9</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> + </property> + <property stdset="1"> + <name>text</name> + <string>9</string> + </property> + </widget> + </hbox> + </widget> + <widget> + <class>QLayoutWidget</class> + <property stdset="1"> + <name>name</name> + <cstring>Layout24</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>32767</width> + <height>35</height> + </size> </property> <property> - <name>sizeHint</name> + <name>layoutSpacing</name> + </property> + <hbox> + <property stdset="1"> + <name>margin</name> + <number>0</number> + </property> + <property stdset="1"> + <name>spacing</name> + <number>2</number> + </property> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>PushButton1</cstring> + </property> + <property stdset="1"> + <name>maximumSize</name> <size> - <width>16</width> - <height>20</height> + <width>60</width> + <height>25</height> </size> </property> - </spacer> + <property stdset="1"> + <name>text</name> + <string>&Ok</string> + </property> + </widget> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>bt0</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>1</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> + </property> + <property stdset="1"> + <name>text</name> + <string>0</string> + </property> + </widget> + <widget> + <class>QPushButton</class> + <property stdset="1"> + <name>name</name> + <cstring>PushButton2</cstring> + </property> + <property stdset="1"> + <name>sizePolicy</name> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>1</vsizetype> + </sizepolicy> + </property> + <property stdset="1"> + <name>maximumSize</name> + <size> + <width>60</width> + <height>25</height> + </size> + </property> + <property stdset="1"> + <name>text</name> + <string>&Cancel</string> + </property> + </widget> </hbox> </widget> - </grid> + </vbox> </widget> <connections> <connection> + <sender>PushButton2</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>reject()</slot> + </connection> + <connection> <sender>PushButton1</sender> <signal>clicked()</signal> <receiver>Form1</receiver> <slot>accept()</slot> </connection> <connection> - <sender>PushButton2</sender> + <sender>bt0</sender> <signal>clicked()</signal> <receiver>Form1</receiver> - <slot>reject()</slot> + <slot>addnum()</slot> + </connection> + <connection> + <sender>bt1</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>addnum()</slot> + </connection> + <connection> + <sender>bt2</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>addnum()</slot> + </connection> + <connection> + <sender>bt3</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>addnum()</slot> + </connection> + <connection> + <sender>bt4</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>addnum()</slot> + </connection> + <connection> + <sender>bt5</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>addnum()</slot> + </connection> + <connection> + <sender>bt6</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>addnum()</slot> + </connection> + <connection> + <sender>bt7</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>addnum()</slot> + </connection> + <connection> + <sender>bt8</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>addnum()</slot> + </connection> + <connection> + <sender>bt9</sender> + <signal>clicked()</signal> + <receiver>Form1</receiver> + <slot>addnum()</slot> </connection> + <slot access="protected">addnum()</slot> </connections> +<tabstops> + <tabstop>lnePin</tabstop> + <tabstop>PushButton1</tabstop> + <tabstop>PushButton2</tabstop> + <tabstop>bt1</tabstop> + <tabstop>bt2</tabstop> + <tabstop>bt3</tabstop> + <tabstop>bt4</tabstop> + <tabstop>bt5</tabstop> + <tabstop>bt6</tabstop> + <tabstop>bt7</tabstop> + <tabstop>bt8</tabstop> + <tabstop>bt9</tabstop> + <tabstop>bt0</tabstop> +</tabstops> </UI> |