X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fplugins%2Fpgpcore%2Fsgpgme.c;h=990f37747956d29838fae1e2f2baa46f8b1f991f;hp=9060479114a43b30fa79307e735adf6ef75576e8;hb=cb2e6d3aa42f1cf359d2b1b69c8496516f479319;hpb=2af36fb958b467b4b5b1bdc0eb1a18097a8a09f0 diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c index 906047911..990f37747 100644 --- a/src/plugins/pgpcore/sgpgme.c +++ b/src/plugins/pgpcore/sgpgme.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "sgpgme.h" #include "privacy.h" @@ -118,37 +119,39 @@ static const gchar *get_validity_str(unsigned long validity) gchar *sgpgme_sigstat_info_short(gpgme_ctx_t ctx, gpgme_verify_result_t status) { gpgme_signature_t sig = NULL; - + gpgme_user_id_t user = NULL; + gchar *uname = NULL; + gpgme_key_t key; + if (status == NULL) { - return g_strdup(_("The signature has not been checked")); + return g_strdup(_("The signature has not been checked.")); } sig = status->signatures; if (sig == NULL) { - return g_strdup(_("The signature has not been checked")); + return g_strdup(_("The signature has not been checked.")); } + gpgme_get_key(ctx, sig->fpr, &key, 0); + if (key) + uname = key->uids->uid; + else + uname = ""; switch (gpg_err_code(sig->status)) { case GPG_ERR_NO_ERROR: - { gpgme_user_id_t user = NULL; - gpgme_key_t key; - - gpgme_get_key(ctx, sig->fpr, &key, 0); - - user = key->uids; - - return g_strdup_printf(_("Valid signature by %s (Trust: %s)"), - user->uid, get_validity_str(sig->validity)); + { + return g_strdup_printf(_("Good signature from %s (Trust: %s)."), + uname, get_validity_str(sig->validity)); } case GPG_ERR_SIG_EXPIRED: - return g_strdup(_("The signature has expired")); + return g_strdup_printf(_("Expired signature from %s."), uname); case GPG_ERR_KEY_EXPIRED: - return g_strdup(_("The key that was used to sign this part has expired")); + return g_strdup_printf(_("Expired key from %s."), uname); case GPG_ERR_BAD_SIGNATURE: - return g_strdup(_("This signature is invalid")); + return g_strdup_printf(_("Bad signature from %s."), uname); case GPG_ERR_NO_PUBKEY: - return g_strdup(_("You have no key to verify this signature")); + return g_strdup(_("No key available to verify this signature.")); default: - return g_strdup(_("The signature has not been checked")); + return g_strdup(_("The signature has not been checked.")); } return g_strdup(_("Error")); } @@ -364,12 +367,13 @@ void sgpgme_init() if (prefs_gpg_get_config()->gpg_warning) { AlertValue val; - val = alertpanel_message_with_disable + val = alertpanel_full (_("Warning"), _("GnuPG is not installed properly, or needs " - "to be upgraded.\n" - "OpenPGP support disabled."), - NULL, NULL, NULL, ALERT_WARNING); + "to be upgraded.\n" + "OpenPGP support disabled."), + GTK_STOCK_CLOSE, NULL, NULL, TRUE, NULL, + ALERT_WARNING, G_ALERTDEFAULT); if (val & G_ALERTDISABLE) prefs_gpg_get_config()->gpg_warning = FALSE; }