A simple Qt based browser with no bullshit that supports PKCS#11 tokens (such as the SuisseID).
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.

67 lines
1.6 KiB

/*! @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 <cassert>
#include <QtCore/QDebug>
#ifndef LOG
#define LOG qDebug()<<__PRETTY_FUNCTION__
#endif
class PinEntry: public QDialog, public Ui::PinEntry {
Q_OBJECT;
public:
PinEntry(const QSslCertificate& cert, QWidget *parent=0): QDialog(parent) {
setupUi(this);
14 years ago
_cert->certificate(cert);
}
PinEntry& retries(int num) {
_pinstatus->setCurrentIndex(num==-1?1:(num==-2?2:0));
_retries->setText(tr("there are %1 PIN attempts left").arg(num));
return *this;
}
QString pin() const {
return _pin->text();
}
int myexec() {
LOG;
show();
LOG<<"SSSSSSSSSTTTTTTTAAAAAAAAAAAAARRRRRRRRRRTTTTTTTTTT";
int res(_run.exec(QEventLoop::ExcludeSocketNotifiers));
LOG<<"EEEEEEEEEEEEENNNNNNNNNNNNNNNNNNNNNDDDDDDDDDDDDDDEEEEEEEEEEEEE";
hide();
return res;
}
public Q_SLOTS:
virtual void accept() {
LOG;
QDialog::accept();
}
virtual void done(int r) {
LOG<<r;
_run.exit(r);
assert(!_run.isRunning());
LOG<<"DDDDDDDDOOOOOOOOOOOONNNNNNNNNNNEEEEEEE";
QDialog::done(r);
}
virtual void reject() {
LOG;
QDialog::reject();
}
private:
QEventLoop _run;
};
#endif