Diffstat (limited to 'noncore/net/opietooth/blue-pin/pindlg.cc') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/blue-pin/pindlg.cc | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/noncore/net/opietooth/blue-pin/pindlg.cc b/noncore/net/opietooth/blue-pin/pindlg.cc new file mode 100644 index 0000000..54f096e --- a/dev/null +++ b/noncore/net/opietooth/blue-pin/pindlg.cc | |||
@@ -0,0 +1,53 @@ | |||
1 | |||
2 | #include <stdio.h> | ||
3 | |||
4 | #include <qcheckbox.h> | ||
5 | #include <qlabel.h> | ||
6 | #include <qlineedit.h> | ||
7 | #include <qtimer.h> | ||
8 | |||
9 | #include <qpe/config.h> | ||
10 | |||
11 | #include "pindlg.h" | ||
12 | |||
13 | using namespace OpieTooth; | ||
14 | |||
15 | PinDlg::PinDlg( const QString& status, | ||
16 | const QString& mac, QWidget* parent, | ||
17 | const char* name ) | ||
18 | : PinDlgBase( parent, name, WType_Modal ) | ||
19 | { | ||
20 | m_mac = mac; | ||
21 | test( mac ); | ||
22 | txtStatus->setText(status); | ||
23 | } | ||
24 | PinDlg::~PinDlg() { | ||
25 | |||
26 | } | ||
27 | void PinDlg::setMac( const QString& mac ) { | ||
28 | txtStatus->setText( mac ); | ||
29 | } | ||
30 | QString PinDlg::pin() const{ | ||
31 | return lnePin->text(); | ||
32 | } | ||
33 | |||
34 | void PinDlg::test( const QString& mac ) { | ||
35 | if (!mac.isEmpty() ) { | ||
36 | Config cfg("bluepin"); | ||
37 | cfg.setGroup(mac); | ||
38 | lnePin->setText(cfg.readEntryCrypt("pin", QString::null ) ); | ||
39 | if ( !lnePin->text().isEmpty() ) { | ||
40 | //QTimer::singleShot(100, this, SLOT(accept() ) ); | ||
41 | } | ||
42 | |||
43 | } | ||
44 | |||
45 | } | ||
46 | void PinDlg::accept() { | ||
47 | if ( ckbPin->isChecked() ) { | ||
48 | Config cfg("bluepin"); | ||
49 | cfg.setGroup(m_mac ); | ||
50 | cfg.writeEntryCrypt("pin", lnePin->text() ); | ||
51 | } | ||
52 | QDialog::accept(); | ||
53 | } | ||