Commit b416fabb authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Rolf Eike Beer
Browse files

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
parent cb37cb8b
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment