parent
aa806fef5c
commit
9620b5e810
13 changed files with 687 additions and 284 deletions
@ -1,37 +0,0 @@ |
||||
#include <QtGui> |
||||
#include "pindialog.hxx" |
||||
|
||||
|
||||
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() : ""; |
||||
} |
@ -1,22 +0,0 @@ |
||||
#ifndef PINDIALOG_H |
||||
#define PINDIALOG_H |
||||
|
||||
#include <QDialog> |
||||
class QLabel; |
||||
class QLineEdit; |
||||
class QPushButton; |
||||
|
||||
class PinDialog : public QDialog |
||||
{ |
||||
Q_OBJECT |
||||
public: |
||||
PinDialog(QWidget *parent = 0); |
||||
QString pin() const; |
||||
private: |
||||
QLabel* label; |
||||
QLineEdit* lineEdit; |
||||
QPushButton* okButton; |
||||
QPushButton* cancelButton; |
||||
}; |
||||
|
||||
#endif // PINDIALOG_H
|
@ -0,0 +1,48 @@ |
||||
/*! @file
|
||||
|
||||
@id $Id$ |
||||
*/ |
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#ifndef __PINDIALOG_HXX__ |
||||
#define __PINDIALOG_HXX__ |
||||
|
||||
#include <ui_pinentry.h> |
||||
#include <QtGui/QDialog> |
||||
#include <QtCore/QDateTime> |
||||
#include <QtNetwork/QSslCertificate> |
||||
|
||||
#include <QtCore/QDebug> |
||||
|
||||
class PinEntry: public QDialog, public Ui::PinEntry { |
||||
Q_OBJECT; |
||||
public: |
||||
PinEntry(const QSslCertificate& cert, QWidget *parent=0): QDialog(parent) { |
||||
setupUi(this); |
||||
_commonName->setText(cert.subjectInfo(QSslCertificate::CommonName)); |
||||
_organization->setText(cert.subjectInfo(QSslCertificate::Organization)); |
||||
_email->setText(cert.alternateSubjectNames() |
||||
.find(QSsl::EmailEntry).value()); |
||||
_serial->setText(cert.serialNumber()); |
||||
_expiry->setText(cert.expiryDate().toString()); |
||||
_issuerCa->setText(cert.issuerInfo(QSslCertificate::CommonName)); |
||||
_commonName->setVisible(_commonName->text().size()); |
||||
_commonNameLabel->setVisible(_commonName->text().size()); |
||||
_organization->setVisible(_organization->text().size()); |
||||
_organizationLabel->setVisible(_organization->text().size()); |
||||
_email->setVisible(_email->text().size()); |
||||
_emailLabel->setVisible(_email->text().size()); |
||||
_serial->setVisible(_serial->text().size()); |
||||
_serialLabel->setVisible(_serial->text().size()); |
||||
_expiry->setVisible(_expiry->text().size()); |
||||
_expiryLabel->setVisible(_expiry->text().size()); |
||||
_issuerCa->setVisible(_issuerCa->text().size()); |
||||
_issuerCaLabel->setVisible(_issuerCa->text().size()); |
||||
} |
||||
QString pin() const { |
||||
return _pin->text(); |
||||
} |
||||
}; |
||||
|
||||
#endif |
Loading…
Reference in new issue