[Gpa-commits] r922 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Dec 16 12:14:16 CET 2008


Author: werner
Date: 2008-12-16 12:14:15 +0100 (Tue, 16 Dec 2008)
New Revision: 922

Modified:
   trunk/src/ChangeLog
   trunk/src/cardman.c
Log:
More pretty printing and ChangeLog fix.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-12-16 11:00:13 UTC (rev 921)
+++ trunk/src/ChangeLog	2008-12-16 11:14:15 UTC (rev 922)
@@ -1,13 +1,12 @@
 2008-12-16  Werner Koch  <wk at g10code.com>
 
-	* gpa.c (gpa_args_t): Add field start_card_manager.
+	* cardman.c (card_reload_cb): Pretty print serial, version and URL.
+	* utils.c (decode_c_string, hextobyte): New.  Based on code taken
+	GPGME (conversion.c).
 
 	* keygenwizard.c (string_strip_dup): Make arg const char and get
 	rid of the stupid "gchar".
 
-	* utils.c (decode_c_string, hextobyte): New.  Based on code taken
-	GPGME (conversion.c).
-
 	* gpacardreloadop.h: Remove include files. Re-indent macros.  
 	(_GpaCardReloadOperation) 
 	(_GpaCardReloadOperationClass): Move to gpacardreloadop.c.
@@ -16,6 +15,7 @@
 	(xpm): Add it to the list.
 	(register_stock_icons): Remove fake icon.
 	* cardman.c (gpa_card_manager_constructor): Use cardman icon.
+	(card_reload_cb): Pretty print serial, version  and URL.
 
 2008-12-13  Moritz  <moritz at gnu.org>
 

Modified: trunk/src/cardman.c
===================================================================
--- trunk/src/cardman.c	2008-12-16 11:00:13 UTC (rev 921)
+++ trunk/src/cardman.c	2008-12-16 11:14:15 UTC (rev 922)
@@ -170,7 +170,11 @@
   const char *string = value;
 
   if (strcmp (identifier, "serial") == 0 && idx == 0)
-    gtk_entry_set_text (GTK_ENTRY (cardman->entrySerialno), string);
+    {
+      while (*string == '0' && string[1])
+        string++;
+      gtk_entry_set_text (GTK_ENTRY (cardman->entrySerialno), string);
+    }
   else if (strcmp (identifier, "login") == 0 && idx == 0)
     gtk_entry_set_text (GTK_ENTRY (cardman->entryLogin), string);
   else if (strcmp (identifier, "name") == 0 && idx == 0)
@@ -188,7 +192,25 @@
   else if (strcmp (identifier, "vendor") == 0 && idx == 1)
     gtk_entry_set_text (GTK_ENTRY (cardman->entryManufacturer), string);
   else if (strcmp (identifier, "version") == 0 && idx == 0)
-    gtk_entry_set_text (GTK_ENTRY (cardman->entryVersion), string);
+    {
+      char buffer[6];
+      char *p;
+
+      if (strlen (string) == 4)
+        {
+          /* Reformat the version number to be better human readable.  */
+          p = buffer;
+          if (string[0] != '0')
+            *p++ = string[0];
+          *p++ = string[1];
+          *p++ = '.';
+          if (string[2] != '0')
+            *p++ = string[2];
+          *p++ = string[3];
+          string = buffer;
+        }
+      gtk_entry_set_text (GTK_ENTRY (cardman->entryVersion), string);
+    }
   else if (strcmp (identifier, "fpr") == 0 && idx == 0)
     gtk_entry_set_text (GTK_ENTRY (cardman->entryKeySig), string);
   else if (strcmp (identifier, "fpr") == 0 && idx == 1)



More information about the Gpa-commits mailing list