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 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/noncore/net/opietooth/blue-pin/pindlg.cc b/noncore/net/opietooth/blue-pin/pindlg.cc index 3db6095..b03ae7d 100644 --- a/noncore/net/opietooth/blue-pin/pindlg.cc +++ b/noncore/net/opietooth/blue-pin/pindlg.cc | |||
@@ -74,46 +74,68 @@ QString PinDlg::makeTextFromArgs() | |||
74 | QString status; | 74 | QString status; |
75 | if (dir == "out" ) { | 75 | if (dir == "out" ) { |
76 | status = QObject::tr("Outgoing connection to "); | 76 | status = QObject::tr("Outgoing connection to "); |
77 | } else | 77 | } else |
78 | status = QObject::tr("Incoming connection from "); | 78 | status = QObject::tr("Incoming connection from "); |
79 | 79 | ||
80 | status += name; | 80 | status += name; |
81 | status += "<br>"; | 81 | status += "<br>"; |
82 | status += "[" + bdaddr + "]"; | 82 | status += "[" + bdaddr + "]"; |
83 | 83 | ||
84 | return status ; | 84 | return status ; |
85 | } | 85 | } |
86 | else | 86 | else |
87 | return QString::null; | 87 | return QString::null; |
88 | } | 88 | } |
89 | 89 | ||
90 | QString PinDlg::makeMacFromArgs() | 90 | QString PinDlg::makeMacFromArgs() |
91 | { | 91 | { |
92 | if(qApp->argc() < 3) | 92 | if(qApp->argc() < 3) |
93 | return QString::null; | 93 | return QString::null; |
94 | else | 94 | else |
95 | return qApp->argv()[2] ; | 95 | return qApp->argv()[2] ; |
96 | } | 96 | } |
97 | 97 | ||
98 | /* | ||
99 | * Add a number to the PIN number | ||
100 | */ | ||
98 | void PinDlg::addnum() | 101 | void PinDlg::addnum() |
99 | { | 102 | { |
100 | if( sender()->inherits( "QPushButton") ) { | 103 | if( sender()->inherits( "QPushButton") ) { |
101 | const QPushButton* btn = static_cast<const QPushButton*> (sender()); | 104 | const QPushButton* btn = static_cast<const QPushButton*> (sender()); |
102 | lnePin->setText(lnePin->text() + btn->text()); | 105 | lnePin->setText(lnePin->text() + btn->text()); |
103 | } | 106 | } |
104 | } | 107 | } |
105 | 108 | ||
109 | /* | ||
110 | * Delete a number from the end of the line | ||
111 | */ | ||
112 | void PinDlg::delnum() | ||
113 | { | ||
114 | if( sender()->inherits( "QPushButton") ) { | ||
115 | const QPushButton* btn = static_cast<const QPushButton*> (sender()); | ||
116 | lnePin->setText(lnePin->text().remove(lnePin->text().length() - 1, 1)); | ||
117 | } | ||
118 | } | ||
119 | |||
106 | void PinDlg::accept() | 120 | void PinDlg::accept() |
107 | { | 121 | { |
108 | if ( ckbPin->isChecked() ) | 122 | if ( ckbPin->isChecked() ) |
109 | { | 123 | { |
110 | Config cfg("bluepin"); | 124 | Config cfg("bluepin"); |
111 | cfg.setGroup(m_mac ); | 125 | cfg.setGroup(m_mac ); |
112 | cfg.writeEntryCrypt("pin", lnePin->text() ); | 126 | cfg.writeEntryCrypt("pin", lnePin->text() ); |
113 | } | 127 | } |
114 | printf("PIN:%s\n", lnePin->text().latin1()); | 128 | printf("PIN:%s\n", lnePin->text().latin1()); |
115 | QDialog::accept(); | 129 | QDialog::accept(); |
116 | qApp->quit(); | 130 | qApp->quit(); |
117 | ::exit(0); | 131 | ::exit(0); |
118 | } | 132 | } |
119 | 133 | ||
134 | void PinDlg::reject() | ||
135 | { | ||
136 | printf("ERR\n"); | ||
137 | QDialog::reject(); | ||
138 | qApp->quit(); | ||
139 | ::exit(0); | ||
140 | } | ||
141 | |||