summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <kde@opensource.sf-tec.de>2011-10-27 16:33:17 (GMT)
committerRolf Eike Beer <eike-kernel@sf-tec.de>2011-10-27 20:31:45 (GMT)
commitb416fabb00fb53e5f4c0774247b640dd3f6a014d (patch)
treea4e804e2b718f8b09ead5c4d4d9c415aff434c66
parentcb37cb8b2cbb76fca2ebc01f47b3016fdf66d0c5 (diff)
fix job status message when key generation fails
If the generation of a key fails for whatever reason we tell the user that things gone wrong in a messagebox, but the systray message always suggested that the key was created. Use the same messages for both. BUG:285081 FIXED-IN:4.7.3
-rw-r--r--transactions/kgpggeneratekey.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/transactions/kgpggeneratekey.cpp b/transactions/kgpggeneratekey.cpp
index e0ca0db..1738077 100644
--- a/transactions/kgpggeneratekey.cpp
+++ b/transactions/kgpggeneratekey.cpp
@@ -169,7 +169,25 @@ KGpgGenerateKey::nextLine(const QString &line)
void
KGpgGenerateKey::finish()
{
- emit statusMessage(i18n("Key %1 generated", getFingerprint()));
+ switch (getSuccess()) {
+ case TS_BAD_PASSPHRASE:
+ emit statusMessage(i18n("Bad passphrase. Cannot generate a new key pair."));
+ break;
+ case TS_USER_ABORTED:
+ emit statusMessage(i18n("Aborted by the user. Cannot generate a new key pair."));
+ break;
+ case TS_INVALID_EMAIL:
+ emit statusMessage(i18n("The email address is not valid. Cannot generate a new key pair."));
+ break;
+ case TS_INVALID_NAME:
+ emit statusMessage(i18n("The name is not accepted by gpg. Cannot generate a new key pair."));
+ break;
+ case TS_OK:
+ emit statusMessage(i18n("Key %1 generated", getFingerprint()));
+ break;
+ default:
+ emit statusMessage(i18n("gpg process did not finish. Cannot generate a new key pair."));
+ }
}
void