aboutsummaryrefslogtreecommitdiffstats
path: root/keygendialog.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-08-03 01:20:06 +0200
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2012-08-03 01:20:06 +0200
commit19fede8a86a9c63967cbb01a4a3ebcd64b517919 (patch)
tree57ac2beb27254076bb16cf37dace9641562a13a4 /keygendialog.cpp
parentadd posibility to remove keyserver in settingsdialog (diff)
downloadgpg4usb-19fede8a86a9c63967cbb01a4a3ebcd64b517919.tar.gz
gpg4usb-19fede8a86a9c63967cbb01a4a3ebcd64b517919.zip
show messagebox, if keysize is set to more than 2048 bit
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@930 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'keygendialog.cpp')
-rw-r--r--keygendialog.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/keygendialog.cpp b/keygendialog.cpp
index bce9071..c387681 100644
--- a/keygendialog.cpp
+++ b/keygendialog.cpp
@@ -27,7 +27,6 @@ KeyGenDialog::KeyGenDialog(GpgME::GpgContext *ctx, QWidget *parent)
{
mCtx = ctx;
buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
-
this->setWindowTitle(tr("Generate Key"));
this->setModal(true);
generateKeyDialog();
@@ -43,6 +42,7 @@ void KeyGenDialog::generateKeyDialog()
keySizeSpinBox = new QSpinBox(this);
keySizeSpinBox->setRange(768, 16384);
keySizeSpinBox->setValue(2048);
+ this->lastKeySize=2048;
keySizeSpinBox->setSingleStep(256);
@@ -110,6 +110,7 @@ void KeyGenDialog::generateKeyDialog()
connect(expireCheckBox, SIGNAL(stateChanged(int)), this, SLOT(expireBoxChanged()));
connect(passwordEdit, SIGNAL(textChanged(QString)), this, SLOT(passwordEditChanged()));
connect(keyTypeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(keyTypeChanged()));
+ connect(keySizeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(keySizeChanged()));
this->setLayout(vbox2);
}
@@ -219,18 +220,24 @@ void KeyGenDialog::passwordEditChanged()
pwStrengthSlider->setValue(checkPassWordStrength());
update();
}
+void KeyGenDialog::keySizeChanged()
+{
+ if (keySizeSpinBox->value() > 2048 && lastKeySize <=2048) {
+ QMessageBox::warning(this, tr("Key size warning"),
+ tr("You've set the keysize to more than 2048 bits. This setting is for advanced users only. The key generation could take a very, very long time."));
+ }
+ lastKeySize=keySizeSpinBox->value();
+}
void KeyGenDialog::keyTypeChanged()
{
- qDebug() << "changed";
if (keyTypeComboBox->currentText() == "RSA") {
- qDebug() << "RSA";
keySizeSpinBox->setMaximum(16384);
+ keySizeSpinBox->setMinimum(1024);
} else {
- qDebug() << "DSA";
- keySizeSpinBox->setMaximum(65536);
+ keySizeSpinBox->setMaximum(16384);
+ keySizeSpinBox->setMinimum(768);
}
-
}
int KeyGenDialog::checkPassWordStrength()