[svn] GPGol - r146 - trunk/src

svn author twoaday cvs at cvs.gnupg.org
Sat Apr 22 21:32:50 CEST 2006


Author: twoaday
Date: 2006-04-22 21:32:49 +0200 (Sat, 22 Apr 2006)
New Revision: 146

Modified:
   trunk/src/ChangeLog
   trunk/src/common.c
   trunk/src/olflange-dlgs.cpp
   trunk/src/olflange-rsrcs.rc
   trunk/src/passphrase-dialog.c
   trunk/src/verify-dialog.c
Log:
2006-04-22  Timo Schulz  <ts at g10code.com>

        * common.c (utf8_to_wincp): Corrected utf8 decoding.
        * passphrase-dialog.c (load_recipbox): Likewise.
        * olflange-dlg.cpp (GPGOptionsDlgProc): Activate the
        'confirm' button when the dialog state has been changed.
        * olflange-rsrcs.rc (IDD_GPG_OPTIONS_DE): Change description.



Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2006-03-28 10:16:11 UTC (rev 145)
+++ trunk/src/ChangeLog	2006-04-22 19:32:49 UTC (rev 146)
@@ -1,3 +1,11 @@
+2006-04-22  Timo Schulz  <ts at g10code.com>
+
+	* common.c (utf8_to_wincp): Corrected utf8 decoding.
+	* passphrase-dialog.c (load_recipbox): Likewise.
+	* olflange-dlg.cpp (GPGOptionsDlgProc): Activate the
+	'confirm' button when the dialog state has been changed.
+	* olflange-rsrcs.rc (IDD_GPG_OPTIONS_DE): Change description.
+	
 2006-03-28  Werner Koch  <wk at g10code.com>
 
 	* olflange-rsrcs.rc (IDD_GPG_OPTIONS_DE): Add new control box.

Modified: trunk/src/common.c
===================================================================
--- trunk/src/common.c	2006-03-28 10:16:11 UTC (rev 145)
+++ trunk/src/common.c	2006-04-22 19:32:49 UTC (rev 146)
@@ -288,54 +288,14 @@
 }
 
 
-/* CP850 -> CP1251 charset table. */
-static unsigned char cp850_to_cp1251[] = 
-{
-  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c,
-  0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
-  0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
-  0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32, 0x33,
-  0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40,
-  0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d,
-  0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a,
-  0x5b, 0x5c, 0x5d, 0x5e, 0x5f, 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
-  0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, 0x74,
-  0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f, 0xc7, 0xfc,
-  0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7, 0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4,
-  0xc5, 0xc9, 0xe6, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9, 0xff, 0xd6, 0xdc, 0xf8,
-  0xa3, 0xd8, 0xd7, 0x00, 0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba, 0xbf,
-  0xae, 0xac, 0xbd, 0xbc, 0xa1, 0xab, 0xbb, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1,
-  0xc2, 0xc0, 0xa9, 0x00, 0x00, 0x00, 0x00, 0xa2, 0xa5, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0xe3, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa4,
-  0xf0, 0xd0, 0xca, 0xcb, 0xc8, 0x00, 0xcd, 0xce, 0xcf, 0x00, 0x00, 0x00, 0x00,
-  0xa6, 0xcc, 0x00, 0xd3, 0xdf, 0xd4, 0xd2, 0xf5, 0xd5, 0xb5, 0xfe, 0xde, 0xda,
-  0xdb, 0xd9, 0xfd, 0xdd, 0xaf, 0xb4, 0xad, 0xb1, 0x00, 0xbe, 0xb6, 0xa7, 0xf7,
-  0xb8, 0xb0, 0xa8, 0xb7, 0xb9, 0xb3, 0xb2, 0x00, 0xa0,
-};
-
 char *utf8_to_native (const char *string);
     
-/* Convert the console (CP850) encoded UTF8 data from STRING into
-   the current window charset and return it.
-   Caller must free string. */
+/* Convert the UTF8 encoding string STRING into the current
+   Windows charset and return it. */
 char *
 utf8_to_wincp (const char *string)
 {
-  char *res;
-  unsigned char *res_8;
-  size_t i;
-
-  res_8 = res = utf8_to_native (string);
-  
-  /* XXX: currently only CP850->CP1251 is supported. */
-  for (i=0; i < strlen (res); i++)
-    {
-      unsigned char ch = cp850_to_cp1251[res_8[i]];
-      if (ch != 0x00)
-	res_8[i] = ch;
-    }
-  
-  return res;
+  return utf8_to_native (string);
 }
 
   

Modified: trunk/src/olflange-dlgs.cpp
===================================================================
--- trunk/src/olflange-dlgs.cpp	2006-03-28 10:16:11 UTC (rev 145)
+++ trunk/src/olflange-dlgs.cpp	2006-04-22 19:32:49 UTC (rev 146)
@@ -108,15 +108,31 @@
       break;
 
     case WM_COMMAND:
-	if (HIWORD (wParam) == BN_CLICKED &&
-	    LOWORD (wParam) == IDC_ENCRYPT_WITH_STANDARD_KEY) {
-	    opt.enable_default_key = !opt.enable_default_key;
-	    EnableWindow (GetDlgItem (hDlg, IDC_ENCRYPT_TO), 
-			  !!opt.enable_default_key);
+      if (HIWORD (wParam) == BN_CLICKED)
+	{
+	  /* If dialog state has been changed, activate the confirm button. */
+	  switch (wParam)
+	    {
+	    case IDC_ENCRYPT_WITH_STANDARD_KEY:
+	    case IDC_PREFER_HTML:
+	    case IDC_SIGN_DEFAULT:
+	    case IDC_SAVE_DECRYPTED:
+	    case IDC_PREVIEW_DECRYPT:
+	    case IDC_SIGN_ATTACHMENTS:
+	      SendMessage (GetParent (hDlg), PSM_CHANGED, (WPARAM)hDlg, 0L);
+	      break;
+	    }
 	}
-	if (LOWORD(wParam) == IDC_GPG_OPTIONS)
-	    config_dialog_box (hDlg);
-	break;
+      if (HIWORD (wParam) == BN_CLICKED &&
+	  LOWORD (wParam) == IDC_ENCRYPT_WITH_STANDARD_KEY) 
+	{
+	  opt.enable_default_key = !opt.enable_default_key;
+	  EnableWindow (GetDlgItem (hDlg, IDC_ENCRYPT_TO), 
+			!!opt.enable_default_key);
+	}
+      if (LOWORD (wParam) == IDC_GPG_OPTIONS)
+	config_dialog_box (hDlg);
+      break;
 	
     case WM_NOTIFY:
 	pnmhdr = ((LPNMHDR) lParam);

Modified: trunk/src/olflange-rsrcs.rc
===================================================================
--- trunk/src/olflange-rsrcs.rc	2006-03-28 10:16:11 UTC (rev 145)
+++ trunk/src/olflange-rsrcs.rc	2006-04-22 19:32:49 UTC (rev 146)
@@ -77,7 +77,7 @@
                     IDC_PREVIEW_DECRYPT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
                     24,95,162,10
 
-    CONTROL         "Wenn möglich, HTML Version anzeigen",
+    CONTROL         "Wenn möglich, HTML Darstellung anzeigen",
                     IDC_PREFER_HTML,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
                     24,107,162,10
 
@@ -155,7 +155,7 @@
                     IDC_PREVIEW_DECRYPT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
                     24,95,162,10
 
-    CONTROL         "Show HTML Version is possible",
+    CONTROL         "Show HTML View if possible",
                     IDC_PREFER_HTML,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
                     24,107,162,10
 

Modified: trunk/src/passphrase-dialog.c
===================================================================
--- trunk/src/passphrase-dialog.c	2006-03-28 10:16:11 UTC (rev 145)
+++ trunk/src/passphrase-dialog.c	2006-04-22 19:32:49 UTC (rev 146)
@@ -1,6 +1,6 @@
 /* passphrase-dialog.c
  *	Copyright (C) 2004 Timo Schulz
- *	Copyright (C) 2005 g10 Code GmbH
+ *	Copyright (C) 2005, 2006 g10 Code GmbH
  *
  * This file is part of GPGol.
  * 
@@ -149,11 +149,15 @@
   if (err)
     goto fail;
 
-  while ( !gpgme_op_keylist_next (keyctx, &key) )
+  while (!gpgme_op_keylist_next (keyctx, &key))
     {
       if (key && key->uids && key->uids->uid)
-	SendDlgItemMessage (dlg, ctlid, LB_ADDSTRING, 0,
-			    (LPARAM)(const char *)key->uids->uid);
+	{
+	  char *utf8_uid = utf8_to_wincp (key->uids->uid);
+	  SendDlgItemMessage (dlg, ctlid, LB_ADDSTRING, 0,
+			      (LPARAM)(const char *)utf8_uid);
+	  xfree (utf8_uid);
+	}
       if (key)
 	gpgme_key_release (key);
     }
@@ -187,7 +191,7 @@
       return "DSA";
 
     case GPGME_PK_ELG:
-      return "elg";
+      return "ELG";
 
     default:
       break;

Modified: trunk/src/verify-dialog.c
===================================================================
--- trunk/src/verify-dialog.c	2006-03-28 10:16:11 UTC (rev 145)
+++ trunk/src/verify-dialog.c	2006-04-22 19:32:49 UTC (rev 146)
@@ -70,7 +70,7 @@
       uid = utf8_to_wincp (u->uid);
       SendDlgItemMessage (dlg, IDC_VRY_AKALIST, LB_ADDSTRING,
 			  0, (LPARAM)(const char*)uid);
-      free (uid);
+      xfree (uid);
       n++;
     }
   return n;
@@ -145,7 +145,7 @@
     {
       p = utf8_to_wincp (key->uids->uid);
       SetDlgItemText (dlg, IDC_VRY_ISSUER, p);
-      free (p);
+      xfree (p);
       
       n = load_akalist (dlg, key);
       gpgme_key_release (key);




More information about the Gnupg-commits mailing list