[Gpa-commits] r818 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Feb 15 13:42:43 CET 2008


Author: marcus
Date: 2008-02-15 13:42:42 +0100 (Fri, 15 Feb 2008)
New Revision: 818

Modified:
   trunk/src/ChangeLog
   trunk/src/keygendlg.c
Log:
2008-02-15  Marcus Brinkmann  <marcus at g10code.de>

	* keygendlg.c (struct _GPAKeyGenDialog): New member entryUserID.
	(gpa_key_gen_run_dialog): Initialize it.
	(response_cb): Complain if there is no user ID.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-02-12 13:14:23 UTC (rev 817)
+++ trunk/src/ChangeLog	2008-02-15 12:42:42 UTC (rev 818)
@@ -1,3 +1,9 @@
+2008-02-15  Marcus Brinkmann  <marcus at g10code.de>
+
+	* keygendlg.c (struct _GPAKeyGenDialog): New member entryUserID.
+	(gpa_key_gen_run_dialog): Initialize it.
+	(response_cb): Complain if there is no user ID.
+
 2008-02-12  Marcus Brinkmann  <marcus at g10code.de>
 
 	* encryptdlg.c (gpa_file_encrypt_dialog_constructor): Use

Modified: trunk/src/keygendlg.c
===================================================================
--- trunk/src/keygendlg.c	2008-02-12 13:14:23 UTC (rev 817)
+++ trunk/src/keygendlg.c	2008-02-15 12:42:42 UTC (rev 818)
@@ -32,6 +32,7 @@
 
 struct _GPAKeyGenDialog {
   GtkWidget * window;
+  GtkWidget * entryUserID;
   GtkWidget * entryPasswd;
   GtkWidget * entryRepeat;
   GtkWidget * frameExpire;
@@ -46,13 +47,19 @@
 {
   GPAKeyGenDialog * dialog = param;
   gchar * expiry_error;
+  const gchar *userid = gtk_entry_get_text (GTK_ENTRY (dialog->entryUserID));
   const gchar *passwd = gtk_entry_get_text (GTK_ENTRY (dialog->entryPasswd));
   const gchar *repeat = gtk_entry_get_text (GTK_ENTRY (dialog->entryRepeat));
 
   if (response == GTK_RESPONSE_OK)
-    {
-      if (!g_str_equal (passwd, repeat))
+    { 
+      if (! *userid)
         {
+          gpa_window_error (_("You must enter a User ID."), dialog->window);
+          g_signal_stop_emission_by_name (dlg, "response");
+        }
+      else if (!g_str_equal (passwd, repeat))
+        {
           gpa_window_error (_("In \"Passphrase\" and \"Repeat passphrase\",\n"
                               "you must enter the same passphrase."),
                             dialog->window);
@@ -204,6 +211,7 @@
   gtk_table_attach (GTK_TABLE (table), labelUserID, 0, 1, 2, 3,
 		    GTK_FILL, GTK_SHRINK, 0, 0);
   entryUserID = gtk_entry_new ();
+  dialog.entryUserID = entryUserID;
   gpa_connect_by_accelerator (GTK_LABEL (labelUserID), entryUserID,
 			      accelGroup, _("_User ID: "));
   gtk_table_attach (GTK_TABLE (table), entryUserID, 1, 2, 2, 3, GTK_FILL,



More information about the Gpa-commits mailing list