X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=blobdiff_plain;f=src%2Fplugins%2Fpgpcore%2Fpassphrase.c;h=12b4d968858dbf0fddac2d195185daff0f31bd0f;hp=ef5d22c794e81a8cc83db038e130ce65c23d9125;hb=81b38ddaac8a751fd2c47fba34333c19c0561c11;hpb=f8e892d23945020f73e1545bc6bf1aba520293a2 diff --git a/src/plugins/pgpcore/passphrase.c b/src/plugins/pgpcore/passphrase.c index ef5d22c79..12b4d9688 100644 --- a/src/plugins/pgpcore/passphrase.c +++ b/src/plugins/pgpcore/passphrase.c @@ -68,11 +68,9 @@ static gint passphrase_deleted(GtkWidget *widget, GdkEventAny *event, gpointer data); static gboolean passphrase_key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data); -static gchar* passphrase_mbox(const gchar *uid_hint, const gchar *pass_hint, - gint prev_bad); static GtkWidget *create_description(const gchar *uid_hint, - const gchar *pass_hint, gint prev_bad); + const gchar *pass_hint, gint prev_bad, gint new_key); void gpgmegtk_set_passphrase_grab(gint yes) @@ -80,8 +78,8 @@ gpgmegtk_set_passphrase_grab(gint yes) grab_all = yes; } -static gchar* -passphrase_mbox(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad) +gchar* +passphrase_mbox(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad, gint new_key) { gchar *the_passphrase = NULL; GtkWidget *vbox, *hbox; @@ -114,7 +112,7 @@ passphrase_mbox(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad) if (uid_hint || pass_hint) { GtkWidget *label, *icon; - label = create_description (uid_hint, pass_hint, prev_bad); + label = create_description (uid_hint, pass_hint, prev_bad, new_key); icon = gtk_image_new_from_stock(GTK_STOCK_DIALOG_AUTHENTICATION, GTK_ICON_SIZE_DIALOG); @@ -250,7 +248,7 @@ linelen (const gchar *s) } static GtkWidget * -create_description(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad) +create_description(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad, gint new_key) { const gchar *uid = NULL, *info = NULL; gchar *buf; @@ -271,11 +269,23 @@ create_description(const gchar *uid_hint, const gchar *pass_hint, gint prev_bad) while (strchr(my_uid, '>')) *(strchr(my_uid, '>')) = ')'; - buf = g_strdup_printf (_("%sPlease enter the passphrase for:\n\n" + if (new_key == 1) { + buf = g_strdup_printf (_("%sPlease enter the passphrase for the new key:\n\n" + "%.*s\n"), + prev_bad ? + _("Passphrases did not match.\n") : "", + linelen (my_uid), my_uid); + } else if (new_key == 2) { + buf = g_strdup_printf (_("Please re-enter the passphrase for the new key:\n\n" + "%.*s\n"), + linelen (my_uid), my_uid); + } else { + buf = g_strdup_printf (_("%sPlease enter the passphrase for:\n\n" "%.*s\n"), prev_bad ? _("Bad passphrase.\n") : "", linelen (my_uid), my_uid); + } g_free(my_uid); label = gtk_label_new (buf); gtk_label_set_use_markup(GTK_LABEL (label), TRUE); @@ -311,7 +321,7 @@ gpgmegtk_passphrase_cb(void *opaque, const char *uid_hint, else { gpgmegtk_set_passphrase_grab (prefs_gpg_get_config()->passphrase_grab); debug_print ("%% requesting passphrase for '%s'\n ", uid_hint); - pass = passphrase_mbox (uid_hint, passphrase_hint, prev_bad); + pass = passphrase_mbox (uid_hint, passphrase_hint, prev_bad, FALSE); gpgmegtk_free_passphrase(); if (!pass) { debug_print ("%% cancel passphrase entry\n");