You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
984 B
37 lines
984 B
#include <QtGui> |
|
#include "pindialog.h" |
|
|
|
|
|
PinDialog::PinDialog(QWidget *parent) |
|
: QDialog(parent) |
|
{ |
|
label=new QLabel(tr("Enter &PIN:")); |
|
lineEdit=new QLineEdit; |
|
lineEdit->setEchoMode(QLineEdit::Password); |
|
label->setBuddy(lineEdit); |
|
|
|
okButton=new QPushButton(tr("&OK")); |
|
okButton->setDefault(true); |
|
|
|
cancelButton=new QPushButton(tr("&Cancel")); |
|
|
|
connect(okButton, SIGNAL(clicked()), this, SLOT(accept())); |
|
connect(cancelButton, SIGNAL(clicked()), this, SLOT(reject())); |
|
|
|
QHBoxLayout* tl= new QHBoxLayout; |
|
tl->addWidget(label); |
|
tl->addWidget(lineEdit); |
|
QHBoxLayout* bl= new QHBoxLayout; |
|
bl->addStretch(); |
|
bl->addWidget(okButton); |
|
bl->addWidget(cancelButton); |
|
QVBoxLayout* ml= new QVBoxLayout; |
|
ml->addLayout(tl); |
|
ml->addLayout(bl); |
|
setLayout(ml); |
|
} |
|
|
|
QString PinDialog::pin() const { |
|
// TODO: Cleanup of internal strings as soon as the PIN is retrieved |
|
return lineEdit ? lineEdit->text() : ""; |
|
}
|
|
|