[seahorse] Show information message when you try to sign an UID...



commit 42691a5b192ce753beb4218202733db2b99c572d
Author: Pablo Castellano <pablog src gnome org>
Date:   Sun Feb 21 02:27:28 2010 +0100

    Show information message when you try to sign an UID...
    
    ... which was already signed with that key.
    Before, nothing happened and this was confusing some users,
    specially because self-signatures are not shown.
    
    Part of: https://bugzilla.gnome.org/show_bug.cgi?id=357322

 pgp/seahorse-gpgme-key-op.c |    6 +-----
 pgp/seahorse-gpgme-sign.c   |   18 +++++++++++++-----
 2 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/pgp/seahorse-gpgme-key-op.c b/pgp/seahorse-gpgme-key-op.c
index babc3d4..37d7c48 100644
--- a/pgp/seahorse-gpgme-key-op.c
+++ b/pgp/seahorse-gpgme-key-op.c
@@ -538,11 +538,7 @@ sign_process (gpgme_key_t signed_key, gpgme_key_t signing_key, guint sign_index,
 	g_free (parms);
 	 
 	gpgme_release (ctx);
-	
-	/* If it was already signed then it's not an error */
-	if (gpgme_err_code (gerr) == GPG_ERR_EALREADY)
-		gerr = GPG_OK;
-	    
+
 	return gerr;
 }
 
diff --git a/pgp/seahorse-gpgme-sign.c b/pgp/seahorse-gpgme-sign.c
index 4272898..aa1291b 100644
--- a/pgp/seahorse-gpgme-sign.c
+++ b/pgp/seahorse-gpgme-sign.c
@@ -36,7 +36,7 @@
 #include <glib/gi18n.h>
 
 G_MODULE_EXPORT gboolean
-on_gpgme_sign_ok_clicked (SeahorseWidget *swidget)
+on_gpgme_sign_ok_clicked (SeahorseWidget *swidget, GtkWindow *parent)
 {
     SeahorseSignCheck check;
     SeahorseSignOptions options = 0;
@@ -92,9 +92,17 @@ on_gpgme_sign_ok_clicked (SeahorseWidget *swidget)
     else
 	    g_assert (FALSE);
     
-    if (!GPG_IS_OK (err))
-        seahorse_gpgme_handle_error (err, _("Couldn't sign key"));
-    
+
+    if (!GPG_IS_OK (err)) {
+        if (gpgme_err_code (err) == GPG_ERR_EALREADY) {
+            w = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE,
+                                        _("This key was already signed by\n\"%s\""), seahorse_object_get_label (signer));
+            gtk_dialog_run (GTK_DIALOG (w));
+            gtk_widget_destroy (w);
+        } else
+            seahorse_gpgme_handle_error (err, _("Couldn't sign key"));
+    }
+
     seahorse_widget_destroy (swidget);
     
     return TRUE;
@@ -211,7 +219,7 @@ sign_internal (SeahorseObject *to_sign, GtkWindow *parent)
         case GTK_RESPONSE_HELP:
             break;
         case GTK_RESPONSE_OK:
-            do_sign = !on_gpgme_sign_ok_clicked (swidget);
+            do_sign = !on_gpgme_sign_ok_clicked (swidget, parent);
             break;
         default:
             do_sign = FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]