diff options
author | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2009-09-19 15:11:33 +0000 |
---|---|---|
committer | nils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2009-09-19 15:11:33 +0000 |
commit | f6a63c3c5318a61c1b7aeb9a8d0abffb70646b05 (patch) | |
tree | c5d5c449c2d55adcd60cb776bf11d82e61153739 /keymgmt.cpp | |
parent | added picture for splashcreen (diff) | |
download | gpg4usb-f6a63c3c5318a61c1b7aeb9a8d0abffb70646b05.tar.gz gpg4usb-f6a63c3c5318a61c1b7aeb9a8d0abffb70646b05.zip |
enhanced key generation dialog
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@215 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'keymgmt.cpp')
-rwxr-xr-x | keymgmt.cpp | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/keymgmt.cpp b/keymgmt.cpp index b5c92af..942bd5f 100755 --- a/keymgmt.cpp +++ b/keymgmt.cpp @@ -197,13 +197,13 @@ void KeyMgmt::generateKeyDialog() expireLabel = new QLabel(tr("Never Expire")); pwStrengthLabel = new QLabel(tr("Password: Strength\nWeak -> Strong")); errorLabel = new QLabel(tr("")); - nameEdit = new QLineEdit("hallo",genkeyDialog); + nameEdit = new QLineEdit(genkeyDialog); emailEdit = new QLineEdit(genkeyDialog); commentEdit = new QLineEdit(genkeyDialog); keySizeSpinBox = new QSpinBox(genkeyDialog); keySizeSpinBox->setRange(512,8192); - keySizeSpinBox->setValue(512); + keySizeSpinBox->setValue(1024); keySizeSpinBox->setSingleStep(256); @@ -216,8 +216,8 @@ void KeyMgmt::generateKeyDialog() expireCheckBox = new QCheckBox(genkeyDialog); expireCheckBox->setCheckState(Qt::Checked); - passwordEdit = new QLineEdit("asd",genkeyDialog); - repeatpwEdit = new QLineEdit("asd",genkeyDialog); + passwordEdit = new QLineEdit(genkeyDialog); + repeatpwEdit = new QLineEdit(genkeyDialog); passwordEdit->setEchoMode(QLineEdit::Password); repeatpwEdit->setEchoMode(QLineEdit::Password); @@ -311,37 +311,33 @@ void KeyMgmt::keyGenAccept() "Passphrase: "+passwordEdit->text()+"\n"; } keyGenParams += "</GnupgKeyParms>"; -// mCtx->generateKey(&keyGenParams); KeyGenThread *kg = new KeyGenThread(keyGenParams, mCtx); kg->start(); genkeyDialog->accept(); - QPixmap pix(mIconPath+"genkey.jpeg"); - QSplashScreen splash(this, pix); - splash.releaseMouse(); - splash.show(); - splash.showMessage("Generating Key"); - //QProgressBar* progress = new QProgressBar(splash); -// QProgressDialog *qpd = new QProgressDialog("Generating", "Jau",0,5,this); - // qpd->setWindowModality(Qt::WindowModal); - int value=0; + + QDialog *dialog = new QDialog(this, Qt::CustomizeWindowHint | Qt::WindowTitleHint); + dialog->setModal(true); + dialog->setWindowTitle(tr("Generating Key...")); + + QLabel *waitMessage = new QLabel(tr("Collecting random data for key generation.\n This may take a while.\n To speed up the process use your computer\n (e.g. browse the net, listen to music,...)")); + QProgressBar *pb = new QProgressBar(); + pb->setRange(0,0); + + QVBoxLayout *layout = new QVBoxLayout(dialog); + layout->addWidget(waitMessage); + layout->addWidget(pb); + dialog->setLayout(layout); + + dialog->show(); + while(kg->isRunning()) { - value++; - value=value%32000; - - qDebug() << value << value; - splash.show(); QCoreApplication::processEvents(); - - //qpd->setValue(value); - //sleep(1); } - splash.finish(this); - //qpd->cancel(); - qDebug() << "hallo"; - //genkeyDialog->accept(); + + dialog->close(); } else { /** |