[Gpa-commits] r950 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 12 18:27:01 CET 2009


Author: werner
Date: 2009-02-12 18:27:00 +0100 (Thu, 12 Feb 2009)
New Revision: 950

Modified:
   trunk/src/ChangeLog
   trunk/src/cardman.c
   trunk/src/gpgmeedit.c
Log:
Ask before overwriting exististing keys.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2009-02-12 17:17:38 UTC (rev 949)
+++ trunk/src/ChangeLog	2009-02-12 17:27:00 UTC (rev 950)
@@ -16,6 +16,8 @@
 	(card_edit_genkey_parms_new): Use xcalloc to initialze the parms.
 	(card_edit_genkey_fnc_transit): Make more robust against changes
 	in gpg.
+	(card_edit_genkey_fnc_action): Pop up a dialog to ask for
+	overwriting existing keys.
 
 	* gpgmeedit.c (gpa_gpgme_card_edit_list_start) 
 	(card_edit_list_parms_release, card_edit_list_fnc_transit) 

Modified: trunk/src/cardman.c
===================================================================
--- trunk/src/cardman.c	2009-02-12 17:17:38 UTC (rev 949)
+++ trunk/src/cardman.c	2009-02-12 17:27:00 UTC (rev 950)
@@ -366,33 +366,6 @@
     }
 
 
-/* FIXME: Instead of doing this test on our own, I believe it belongs
-   into the edit interactor: gpg knows bets whether keys already
-   exists and we only need to process the corresponding prompt.  */
-/*   if (card_contains_keys (cardman)) */
-/*     { */
-/*       GtkWidget *dialog; */
-/*       gint dialog_response; */
-
-/*       dialog = gtk_message_dialog_new (GTK_WINDOW (cardman->window), */
-/* 				       GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, */
-/* 				       GTK_MESSAGE_WARNING, */
-/* 				       GTK_BUTTONS_OK_CANCEL, */
-/* 				       "Keys are already stored on the card. " */
-/* 				       "Really replace existing keys?"); */
-
-/*       dialog_response = gtk_dialog_run (GTK_DIALOG (dialog)); */
-/*       gtk_widget_destroy (dialog); */
-/*       switch (dialog_response) */
-/* 	{ */
-/* 	case GTK_RESPONSE_OK: */
-/*          break; */
-
-/* 	default: */
-/* 	  return; */
-/* 	} */
-/*     } */
-
   op = gpa_gen_key_card_operation_new (GTK_WIDGET (cardman));
   g_signal_connect_swapped (G_OBJECT (op), "completed",
                             G_CALLBACK (card_genkey_completed), cardman);

Modified: trunk/src/gpgmeedit.c
===================================================================
--- trunk/src/gpgmeedit.c	2009-02-12 17:17:38 UTC (rev 949)
+++ trunk/src/gpgmeedit.c	2009-02-12 17:27:00 UTC (rev 950)
@@ -1187,8 +1187,21 @@
       break;
 
     case CARD_GENERATE_REPLACE_KEYS:
-      /* FIXME: simply replace existing keys for now. -mo  */
-      *result = "Y";
+      {
+        GtkWidget *dialog;
+
+        dialog = gtk_message_dialog_new 
+          (NULL, GTK_DIALOG_MODAL,
+           GTK_MESSAGE_WARNING,  GTK_BUTTONS_OK_CANCEL,
+           _("Keys are already stored on the card.\n"
+             "Really replace existing keys?"));
+
+        if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK )
+          *result = "Y";
+        else
+          *result = "N";
+        gtk_widget_destroy (dialog);
+      }
       break;
 
     case CARD_GENERATE_VALIDITY:



More information about the Gpa-commits mailing list