[Winpt-commits] r117 - in trunk: . Po Src

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Dec 8 10:26:35 CET 2005


Author: twoaday
Date: 2005-12-08 10:26:32 +0100 (Thu, 08 Dec 2005)
New Revision: 117

Modified:
   trunk/NEWS
   trunk/Po/de.po
   trunk/Src/ChangeLog
   trunk/Src/WinPT-en.rc
   trunk/Src/wptGPG.cpp
   trunk/Src/wptGPGPrefsDlg.cpp
   trunk/Src/wptKeyEditDlgs.cpp
   trunk/Src/wptKeyserverDlg.cpp
   trunk/Src/wptOwnertrustDlg.cpp
   trunk/Src/wptPreferencesDlg.cpp
   trunk/Src/wptRegistry.cpp
   trunk/TODO
Log:
2005-12-07  Timo Schulz  <ts at g10code.com>
 
        * wptOwnertrustDlg.cpp (ownertrust_dlg_proc):
        Use 'Close' instead of 'Exit'.
        * wptKeyEditDlgs.cpp (keyedit_dlg_proc): Likewise.
        * wptGPG.cpp (gnupg_backup_keyrings): Use $APPDATA
        as the destination dir. Thanks to Werner.
        * wptRegistry.cpp (is_gpgee_installed): New.
        (regist_inst_winpt): Do not register file extensions
        if GPGee is available.
        * wptGPGPrefsDlg.cpp (gpgprefs_dlg_proc): Limit
        use of local vars.
        * wptPreferencesDlg.cpp (prefs_dlg_proc): Make sure
        no illegal backup mode is saved.
        * wptKeyserverDlg.cpp (show_imported_key): New.
        (hkp_recv_key2): Show imported keys if the blob
        contained more than one.
         



Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/NEWS	2005-12-08 09:26:32 UTC (rev 117)
@@ -684,4 +684,4 @@
   keyserver.
 * Initialize gettext early as possible to avoid that
   greeting messages are still in English.
-  
\ No newline at end of file
+* Do not register file extensions if GPGee is available.

Modified: trunk/Po/de.po
===================================================================
--- trunk/Po/de.po	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Po/de.po	2005-12-08 09:26:32 UTC (rev 117)
@@ -2808,7 +2808,7 @@
 msgstr ""
 "WinPT kann einige GPG-Dateien für Sie registrieren, so dass Sie diese per "
 "Doppelklick im Explorer öffnen können.\n"
-"Fortfahren?"
+"Möchten Sie fortfahren?"
 
 msgid ""
 "WinPT is distributed in the hope that it will be useful, but WITHOUT ANY "
@@ -3258,6 +3258,7 @@
 msgid "Add Photo ID"
 msgstr "Photo ID hinzufügen"
 
+
 msgid "&Find"
 msgstr "&Suche"
 
@@ -3315,3 +3316,12 @@
 msgid "New signatures"
 msgstr "Neue Signaturen"
 
+msgid "&Close"
+msgstr "&Schliessen"
+
+msgid "Imported Keys"
+msgstr "Importierte Schlüssel"
+
+msgid "WARNING: multiple keys matched request.\n\n"
+msgstr "WARNUNG: Mehrere Schlüssel wurden gefunden.\n\n"
+

Modified: trunk/Src/ChangeLog
===================================================================
--- trunk/Src/ChangeLog	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Src/ChangeLog	2005-12-08 09:26:32 UTC (rev 117)
@@ -1,3 +1,21 @@
+2005-12-07  Timo Schulz  <ts at g10code.com>
+
+	* wptOwnertrustDlg.cpp (ownertrust_dlg_proc): 
+	Use 'Close' instead of 'Exit'.
+	* wptKeyEditDlgs.cpp (keyedit_dlg_proc): Likewise.
+	* wptGPG.cpp (gnupg_backup_keyrings): Use $APPDATA
+	as the destination dir. Thanks to Werner.
+	* wptRegistry.cpp (is_gpgee_installed): New.
+	(regist_inst_winpt): Do not register file extensions
+	if GPGee is available.
+	* wptGPGPrefsDlg.cpp (gpgprefs_dlg_proc): Limit
+	use of local vars.
+	* wptPreferencesDlg.cpp (prefs_dlg_proc): Make sure
+	no illegal backup mode is saved.
+	* wptKeyserverDlg.cpp (show_imported_key): New.
+	(hkp_recv_key2): Show imported keys if the blob
+	contained more than one.
+	
 2005-12-06  Timo Schulz  <ts at g10code.com>
 
 	* WinPT.cpp (WinMain): Load the gettext environment soon

Modified: trunk/Src/WinPT-en.rc
===================================================================
--- trunk/Src/WinPT-en.rc	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Src/WinPT-en.rc	2005-12-08 09:26:32 UTC (rev 117)
@@ -103,7 +103,7 @@
     PUSHBUTTON      "&Cancel",IDCANCEL,162,167,50,14
 END
 
-IDD_WINPT_KEYWIZARD DIALOG DISCARDABLE  0, 0, 273, 170
+IDD_WINPT_KEYWIZARD DIALOG DISCARDABLE  0, 0, 273, 178
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Key Generation Wizard"
 FONT 8, "MS Sans Serif"
@@ -121,9 +121,9 @@
     EDITTEXT        IDC_KEYWIZARD_EMAIL,67,123,190,12,ES_AUTOHSCROLL
     CONTROL         "&Prefer RSA keys",IDC_KEYWIZARD_USERSA,"Button",
                     BS_AUTOCHECKBOX | WS_TABSTOP,12,146,100,10
-    DEFPUSHBUTTON   "&OK",IDOK,117,146,50,14
-    PUSHBUTTON      "&Cancel",IDCANCEL,169,146,50,14
-    PUSHBUTTON      "E&xpert",IDC_KEYWIZARD_EXPERT,221,146,46,14
+    DEFPUSHBUTTON   "&OK",IDOK,117,156,50,14
+    PUSHBUTTON      "&Cancel",IDCANCEL,169,156,50,14
+    PUSHBUTTON      "E&xpert",IDC_KEYWIZARD_EXPERT,221,156,46,14
 END
 
 IDD_WINPT_CDISK_NEW DIALOG DISCARDABLE  0, 0, 186, 150
@@ -222,7 +222,7 @@
         LEFTMARGIN, 2
         RIGHTMARGIN, 269
         TOPMARGIN, 3
-        BOTTOMMARGIN, 163
+        BOTTOMMARGIN, 171
     END
 
     IDD_WINPT_CDISK_NEW, DIALOG
@@ -379,7 +379,7 @@
     DEFPUSHBUTTON   "&Receive",IDC_KEYSERVER_RECV,5,196,46,14
     PUSHBUTTON      "&Search",IDC_KEYSERVER_INDEX,53,196,36,14
     PUSHBUTTON      "Set &default",IDC_KEYSERVER_DEFAULT,119,196,48,14
-    PUSHBUTTON      "&Cancel",IDCANCEL,169,196,45,14
+    PUSHBUTTON      "&Close",IDCANCEL,169,196,45,14
 END
 
 IDD_WINPT_SIGN DIALOG DISCARDABLE  0, 0, 299, 125
@@ -390,8 +390,8 @@
     CONTROL         "List1",IDC_SIGN_KEYLIST,"SysListView32",LVS_REPORT | 
                     LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | 
                     WS_TABSTOP,6,5,286,93
-    DEFPUSHBUTTON   "&OK",IDOK,189,100,50,14
-    PUSHBUTTON      "&Cancel",IDCANCEL,242,100,50,14
+    DEFPUSHBUTTON   "&OK",IDOK,189,103,50,14
+    PUSHBUTTON      "&Cancel",IDCANCEL,242,103,50,14
 END
 
 IDD_WINPT_KEYGEN DIALOG DISCARDABLE  0, 0, 174, 213
@@ -430,7 +430,7 @@
     PUSHBUTTON      "&Cancel",IDCANCEL,115,191,50,14
 END
 
-IDD_WINPT_SIGNENC DIALOG DISCARDABLE  0, 0, 386, 194
+IDD_WINPT_SIGNENC DIALOG DISCARDABLE  0, 0, 386, 197
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Sign & Encrypt"
 FONT 8, "MS Sans Serif"
@@ -439,11 +439,11 @@
                     LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,368,147
     CONTROL         "Select key for signing",IDC_SIGNENC_SELKEY,"Button",
                     BS_AUTOCHECKBOX | WS_TABSTOP,7,156,169,10
-    LTEXT           "Signing key:",IDC_SIGNENC_SECLISTINF,7,173,40,8
-    COMBOBOX        IDC_SIGNENC_SECLIST,51,171,178,59,CBS_DROPDOWNLIST | 
+    LTEXT           "Signing key:",IDC_SIGNENC_SECLISTINF,7,171,40,8
+    COMBOBOX        IDC_SIGNENC_SECLIST,51,169,178,59,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
-    DEFPUSHBUTTON   "&OK",IDOK,270,157,50,14
-    PUSHBUTTON      "&Cancel",IDCANCEL,325,157,50,14
+    DEFPUSHBUTTON   "&OK",IDOK,274,176,50,14
+    PUSHBUTTON      "&Cancel",IDCANCEL,329,176,50,14
 END
 
 IDD_WINPT_KEYMISC DIALOG DISCARDABLE  0, 0, 470, 305
@@ -491,7 +491,7 @@
     LTEXT           "Info",IDC_KEYCACHE_INFO,10,9,162,8
 END
 
-IDD_WINPT_KEYSIGN DIALOG DISCARDABLE  0, 0, 286, 191
+IDD_WINPT_KEYSIGN DIALOG DISCARDABLE  0, 0, 286, 193
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Key Signing"
 FONT 8, "MS Sans Serif"
@@ -513,10 +513,10 @@
     LTEXT           "Passphrase",IDC_KEYSIGN_PWDINF,5,153,44,8
     EDITTEXT        IDC_KEYSIGN_PASSPHRASE,53,151,144,13,ES_PASSWORD | 
                     ES_AUTOHSCROLL
-    PUSHBUTTON      "&Show photo",IDC_KEYSIGN_SHOWIMG,2,173,67,14,
+    PUSHBUTTON      "&Show photo",IDC_KEYSIGN_SHOWIMG,2,175,67,14,
                     WS_DISABLED
-    DEFPUSHBUTTON   "&OK",IDOK,174,173,50,14
-    PUSHBUTTON      "&Cancel",IDCANCEL,227,172,54,15
+    DEFPUSHBUTTON   "&OK",IDOK,174,175,50,14
+    PUSHBUTTON      "&Cancel",IDCANCEL,227,174,54,15
 END
 
 IDD_WINPT_GPGPREFS DIALOG DISCARDABLE  0, 0, 227, 241
@@ -579,16 +579,16 @@
     PUSHBUTTON      "&OK",IDCANCEL,273,122,50,14
 END
 
-IDD_WINPT_KEYSIG DIALOG DISCARDABLE  0, 0, 356, 170
+IDD_WINPT_KEYSIG DIALOG DISCARDABLE  0, 0, 351, 170
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Signature list for key ..."
 FONT 8, "MS Sans Serif"
 BEGIN
     CONTROL         "List1",IDC_KEYSIG_LIST,"SysListView32",LVS_REPORT | 
                     LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,8,8,335,134
-    DEFPUSHBUTTON   "&OK",IDOK,153,145,55,14
-    PUSHBUTTON      "&Receive Key",IDC_KEYSIG_RECVKEY,210,145,75,14
-    PUSHBUTTON      "&Properties",IDC_KEYSIG_SIGPROPS,288,145,55,14
+    DEFPUSHBUTTON   "&OK",IDOK,153,149,55,14
+    PUSHBUTTON      "&Receive Key",IDC_KEYSIG_RECVKEY,210,149,75,14
+    PUSHBUTTON      "&Properties",IDC_KEYSIG_SIGPROPS,288,149,55,14
 END
 
 IDD_WINPT_VERIFY DIALOG DISCARDABLE  0, 0, 394, 87
@@ -610,9 +610,9 @@
 BEGIN
     LTEXT           "Here it is possible to save or restore the ownertrust from the trustdb file. This could be very useful because the values are NOT stored in the keyring.",
                     IDC_OWNERTRUST_DESC,8,5,163,43
-    PUSHBUTTON      "&Export",IDC_OWNERTRUST_EXPORT,8,57,50,14
-    PUSHBUTTON      "&Import",IDC_OWNERTRUST_IMPORT,60,57,50,14
-    PUSHBUTTON      "&Cancel",IDCANCEL,112,57,50,14
+    PUSHBUTTON      "&Export",IDC_OWNERTRUST_EXPORT,22,57,50,14
+    PUSHBUTTON      "&Import",IDC_OWNERTRUST_IMPORT,74,57,50,14
+    PUSHBUTTON      "&Close",IDCANCEL,126,57,50,14
 END
 
 IDD_WINPT_KEYEDIT_ADDUID DIALOG DISCARDABLE  0, 0, 166, 82
@@ -841,17 +841,17 @@
     PUSHBUTTON      "&Cancel",IDCANCEL,119,182,50,14
 END
 
-IDD_WINPT_PASSWD DIALOG DISCARDABLE  0, 0, 221, 58
+IDD_WINPT_PASSWD DIALOG DISCARDABLE  0, 0, 219, 58
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Passphrase Dialog"
 FONT 8, "MS Sans Serif"
 BEGIN
     LTEXT           "Enter passphrase",IDC_PASSWD_INFO,9,7,108,8
     EDITTEXT        IDC_PASSWD_PWD,9,18,202,12,ES_PASSWORD | ES_AUTOHSCROLL
-    DEFPUSHBUTTON   "&OK",IDOK,107,34,50,14
-    PUSHBUTTON      "&Cancel",IDCANCEL,160,34,50,14
+    DEFPUSHBUTTON   "&OK",IDOK,107,37,50,14
+    PUSHBUTTON      "&Cancel",IDCANCEL,160,37,50,14
     CONTROL         "&Hide Typing",IDC_PASSWD_HIDE,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,136,7,78,10
+                    WS_TABSTOP,134,7,78,10
 END
 
 IDD_WINPT_DATE DIALOG DISCARDABLE  0, 0, 93, 58
@@ -1159,7 +1159,7 @@
     COMBOBOX        IDC_KEYEDIT_CMD,204,138,84,108,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
     DEFPUSHBUTTON   "&OK",IDOK,134,162,50,14
-    PUSHBUTTON      "&Exit",IDCANCEL,186,162,50,14
+    PUSHBUTTON      "&Close",IDCANCEL,186,162,50,14
     PUSHBUTTON      "&Help",IDC_KEYEDIT_HELP,238,162,50,14
 END
 
@@ -1488,7 +1488,7 @@
         LEFTMARGIN, 3
         RIGHTMARGIN, 379
         TOPMARGIN, 3
-        BOTTOMMARGIN, 187
+        BOTTOMMARGIN, 190
     END
 
     IDD_WINPT_KEYMISC, DIALOG
@@ -1528,7 +1528,7 @@
         LEFTMARGIN, 3
         RIGHTMARGIN, 281
         TOPMARGIN, 3
-        BOTTOMMARGIN, 187
+        BOTTOMMARGIN, 189
     END
 
     IDD_WINPT_GPGPREFS, DIALOG
@@ -1558,7 +1558,7 @@
     IDD_WINPT_KEYSIG, DIALOG
     BEGIN
         LEFTMARGIN, 3
-        RIGHTMARGIN, 349
+        RIGHTMARGIN, 344
         TOPMARGIN, 4
         BOTTOMMARGIN, 163
     END
@@ -1662,7 +1662,7 @@
     IDD_WINPT_PASSWD, DIALOG
     BEGIN
         LEFTMARGIN, 4
-        RIGHTMARGIN, 214
+        RIGHTMARGIN, 212
         TOPMARGIN, 3
         BOTTOMMARGIN, 52
     END
@@ -1941,8 +1941,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,11,2,0
- PRODUCTVERSION 0,11,2,0
+ FILEVERSION 0,11,3,0
+ PRODUCTVERSION 0,11,3,0
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -1960,14 +1960,14 @@
             VALUE "Comments", "This is free software under the terms of the GNU GPL v2\0"
             VALUE "CompanyName", "\0"
             VALUE "FileDescription", "Windows Privacy Tray (WinPT)\0"
-            VALUE "FileVersion", "0.11.2\0"
+            VALUE "FileVersion", "0.11.3\0"
             VALUE "InternalName", "WinPT\0"
             VALUE "LegalCopyright", " Copyright (C) 2005 Timo Schulz\0"
             VALUE "LegalTrademarks", "\0"
             VALUE "OriginalFilename", "WinPT.exe\0"
             VALUE "PrivateBuild", "\0"
             VALUE "ProductName", "Windows Privacy Tray\0"
-            VALUE "ProductVersion", "0.11.2\0"
+            VALUE "ProductVersion", "0.11.3\0"
             VALUE "SpecialBuild", "\0"
         END
     END

Modified: trunk/Src/wptGPG.cpp
===================================================================
--- trunk/Src/wptGPG.cpp	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Src/wptGPG.cpp	2005-12-08 09:26:32 UTC (rev 117)
@@ -673,10 +673,10 @@
 	ctx->modified = 1;
     
     /* XXX: find a better way. without it, winpt --keymanager loads
-            the key cache twice otherwise. */
+            the key cache twice. */
     if (ctx->last_access.dwLowDateTime == 0)
 	ctx->modified = 0;
-    
+
     ctx->last_access.dwLowDateTime = ctx->access.dwLowDateTime;
     ctx->last_access.dwHighDateTime = ctx->access.dwHighDateTime;
 }
@@ -1082,6 +1082,8 @@
 }
 
 
+/* Make backups of all keyrings. The public key ring is
+   rotated like this pubring-%d.gpg. */
 void
 gnupg_backup_keyrings (void)
 {
@@ -1092,15 +1094,15 @@
     if (!reg_prefs.auto_backup)
 	return;
     bakmode = reg_prefs.backup.mode;
-    srcpath =  get_gnupg_path ();
+    srcpath = get_gnupg_path ();
     check_keyring (&srcpath);
     if (bakmode == 1) {
-	dstpath = get_gnupg_path ();
+	dstpath = multi_gnupg_path (1);
 	check_keyring (&dstpath);
     }
     else if (bakmode == 2) {
-	char * tmpfile;
-	FILE * fp;
+	char *tmpfile;
+	FILE *fp;
 
 	dstpath = m_strdup (reg_prefs.backup.path);
 	if (!dstpath)
@@ -1131,7 +1133,7 @@
     free_if_alloc (name);
     free_if_alloc (srcpath);
     free_if_alloc (dstpath);
-} /* gnupg_backup_keyrings */
+}
 
 
 /* Display GPG error from file if possible. */

Modified: trunk/Src/wptGPGPrefsDlg.cpp
===================================================================
--- trunk/Src/wptGPGPrefsDlg.cpp	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Src/wptGPGPrefsDlg.cpp	2005-12-08 09:26:32 UTC (rev 117)
@@ -17,7 +17,6 @@
  * along with WinPT; if not, write to the Free Software Foundation, 
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -54,6 +53,7 @@
     char locale_dir[512];
     char *p = NULL, t[256];
     const char *s;
+    const char *file;
     int have_optfile = 0;
     gpg_optfile_t opt = NULL;
     gpg_option_t e;
@@ -62,24 +62,24 @@
     switch (msg) {
     case WM_INITDIALOG:
         SetWindowText (dlg, _("GnuPG Preferences"));
-        SetDlgItemText( dlg, IDC_GPGPREFS_HOMEINF,
-                       _("GnuPG home directory  (where both keyrings are located)") );
-        SetDlgItemText( dlg, IDC_GPGPREFS_OPTINF,
-                       _("GnuPG config file (default: use gpg.conf)") );
-        SetDlgItemText( dlg, IDC_GPGPREFS_EXEINF,
-                       _("GnuPG exe file location (full path with added gpg.exe)") );
-        SetDlgItemText( dlg, IDC_GPGPREFS_LOCALINF,
-                       _("Locale directory (to access the translation files)") );
+        SetDlgItemText (dlg, IDC_GPGPREFS_HOMEINF,
+                       _("GnuPG home directory  (where both keyrings are located)"));
+        SetDlgItemText ( dlg, IDC_GPGPREFS_OPTINF,
+                        _("GnuPG config file (default: use gpg.conf)"));
+        SetDlgItemText ( dlg, IDC_GPGPREFS_EXEINF,
+                        _("GnuPG exe file location (full path with added gpg.exe)"));
+        SetDlgItemText ( dlg, IDC_GPGPREFS_LOCALINF,
+                        _("Locale directory (to access the translation files)"));
 	SetDlgItemText (dlg, IDC_GPGPREFS_ASKLEVEL, _("Ask for the signature class during key sign"));
-	SetDlgItemText (dlg, IDC_GPGPREFS_CMTINF, _("Comment in armored files"));	
+	SetDlgItemText (dlg, IDC_GPGPREFS_CMTINF, _("Comment in armored files"));
 	SetDlgItemText (dlg, IDC_GPGPREFS_ENCINF, _("Encrypt to this key"));
 	SetDlgItemText (dlg, IDC_GPGPREFS_ALLOPTINF, _("General GPG options"));
-	
-	for( n=0; (s = opts[n].name); n++ ) {
-	    p = get_reg_entry_gpg( s );
-	    if( p ) {
-		SetDlgItemText( dlg, opts[n].id, p );
-		free_if_alloc( p );
+
+	for (n=0; (s = opts[n].name); n++) {
+	    p = get_reg_entry_gpg (s);
+	    if (p) {
+		SetDlgItemText (dlg, opts[n].id, p);
+		free_if_alloc (p);
 	    }
 	}
         
@@ -101,6 +101,7 @@
 	    if (opt)
 		release_gpg_options (opt);
 	}
+
 	center_window (dlg, NULL);
         SetForegroundWindow (dlg);
         return TRUE;
@@ -117,9 +118,10 @@
                 msg_box( dlg, _("Please enter the GnuPG home directory."), _("Preferences"), MB_ERR );
                 return FALSE;
             }
-            if( dir_exist_check( homedir ) ) {
-		_snprintf( t, sizeof t - 1, "%s: %s", homedir, winpt_strerror(WPTERR_DIR_OPEN) );
-                msg_box( dlg, t, _("Preferences"), MB_ERR );
+            if (dir_exist_check (homedir)) {
+		_snprintf (t, sizeof (t) - 1, "%s: %s", homedir, 
+			   winpt_strerror (WPTERR_DIR_OPEN));
+                msg_box (dlg, t, _("Preferences"), MB_ERR);
                 return FALSE;
             }
             
@@ -219,7 +221,7 @@
             return TRUE;
             
 	case IDC_GPGPREFS_HOMEDLG:
-	    const char * home;
+	    const char *home;
 	    home = get_folder_dlg (dlg, _("Choose GPG home directory"), NULL);
 	    if (home) {
 		SetDlgItemText (dlg, IDC_GPGPREFS_HOMEDIR, home);
@@ -237,20 +239,18 @@
 	    break;
 
         case IDC_GPGREFS_EXEDLG:
-            const char *bin;
-            bin = get_fileopen_dlg (dlg, _("Choose GPG binary"), 
-				    _("Executable Files (*.exe)\0*.exe\0\0"), 
-				    NULL);
-            if (bin)
-                SetDlgItemText (dlg, IDC_GPGPREFS_EXEDIR, bin);
+	    file = get_fileopen_dlg (dlg, _("Choose GPG binary"), 
+				     _("Executable Files (*.exe)\0*.exe\0\0"),
+				     NULL);
+            if (file)
+                SetDlgItemText (dlg, IDC_GPGPREFS_EXEDIR, file);
             return TRUE;
             
         case IDC_GPGPREFS_OPTDLG:
-            const char *optf;
-            optf = get_fileopen_dlg (dlg, _("Choose GPG config file"), 
+            file = get_fileopen_dlg (dlg, _("Choose GPG config file"), 
 				     NULL, NULL);
-            if (optf)
-                SetDlgItemText (dlg, IDC_GPGPREFS_OPTFILE, optf);
+            if (file)
+                SetDlgItemText (dlg, IDC_GPGPREFS_OPTFILE, file);
             return TRUE;
         }
         break;

Modified: trunk/Src/wptKeyEditDlgs.cpp
===================================================================
--- trunk/Src/wptKeyEditDlgs.cpp	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Src/wptKeyEditDlgs.cpp	2005-12-08 09:26:32 UTC (rev 117)
@@ -1762,7 +1762,7 @@
 	    EnableWindow (GetDlgItem (dlg, IDOK), FALSE);
 	}
 	SetDlgItemText (dlg, IDC_KEYEDIT_CMDINF, _("Command>"));
-	SetDlgItemText (dlg, IDCANCEL, _("&Exit"));
+	SetDlgItemText (dlg, IDCANCEL, _("&Close"));
 	SetDlgItemText (dlg, IDC_KEYEDIT_HELP, _("&Help"));
 	SetWindowText (dlg, _("Key Edit"));
 	

Modified: trunk/Src/wptKeyserverDlg.cpp
===================================================================
--- trunk/Src/wptKeyserverDlg.cpp	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Src/wptKeyserverDlg.cpp	2005-12-08 09:26:32 UTC (rev 117)
@@ -102,6 +102,47 @@
 }
 
 
+
+/* If the keyserver returned one than more key in a
+   keyblob, show the names of all imported keys. */
+static void
+show_imported_keys (gpgme_import_result_t res)
+{
+    gpgme_import_status_t t;
+    gpgme_key_t key;
+    gpgme_data_t msg;
+    gpgme_ctx_t ctx;
+    gpgme_error_t err;
+    const char *s;
+    char *p;
+    size_t n=0;
+
+    err = gpgme_data_new (&msg);
+    if (err)
+	BUG (NULL);
+    err = gpgme_new (&ctx);
+    if (err)
+	BUG (NULL);
+    s = _("WARNING: multiple keys matched request.\n\n");
+    gpgme_data_write (msg, s, strlen (s));
+    for (t=res->imports; t; t = t->next) {
+	if (!gpgme_get_key (ctx, t->fpr, &key, 0)) {
+	    s = key->uids->uid;
+	    gpgme_data_write (msg, s, strlen (s));
+	    gpgme_data_write (msg, "\n", 1);
+	    gpgme_key_release (key);
+	}
+    }
+    gpgme_data_write (msg, "\0", 1);
+    p = gpgme_data_release_and_get_mem (msg, &n);
+    if (p != NULL) {
+	msg_box (NULL, p, _("Imported Keys"), MB_INFO);
+	gpgme_free (p);
+    }
+    gpgme_release (ctx);
+}
+
+
 /* Receive a key from the keyserver @kserver (port @port)
    with the pattern @pattern.
    Return value: 0 on success. */
@@ -166,14 +207,16 @@
             goto leave;
         }
 	import_res = gpgme_op_import_result (ctx);
-	if (r_fpr)
+	if (import_res && r_fpr)
 	    *r_fpr = m_strdup (import_res->imports->fpr);
     }
     
     /* if we use the refresh mode, a lot of keys will be fetched and thus only
        a summarize at the end is presented and not for each key. */
     if (!(flags & KM_KS_REFRESH)) {
-	if (import_res && import_res->unchanged == 1) {
+	if (import_res && import_res->considered > 1)
+	    show_imported_keys (import_res);
+	if (import_res && import_res->unchanged == import_res->considered) {
 	    _snprintf (msg, DIM (msg)-1,
 		       _("Key '%s' successfully received but nothing was changed."), pattern );
 	    status_box (dlg, msg, _("GnuPG Status"));
@@ -395,7 +438,7 @@
         SetDlgItemText (dlg, IDC_KEYSERVER_INDEX, _("&Search"));
 	SetDlgItemText (dlg, IDC_KEYSERVER_PROXSETT, _("C&hange"));
 	SetDlgItemText (dlg, IDC_KEYSERVER_DEFAULT, _("Set &default"));
-	SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));
+	SetDlgItemText (dlg, IDCANCEL, _("&Close"));
 
         set_proxy (dlg);
         keyserver_list_build (&lv, GetDlgItem (dlg, IDC_KEYSERVER_LIST));
@@ -428,7 +471,7 @@
         switch (LOWORD (wparam)) {
         case IDC_KEYSERVER_PROXSETT:
             dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_KEYSERVER_PROXY, 
-			      dlg, keyserver_proxy_dlg_proc, 0,
+			      dlg, keyserver_proxy_dlg_proc, NULL,
                               _("Proxy Settings"), IDS_WINPT_KEYSERVER_PROXY);
             set_proxy (dlg);
             return TRUE;

Modified: trunk/Src/wptOwnertrustDlg.cpp
===================================================================
--- trunk/Src/wptOwnertrustDlg.cpp	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Src/wptOwnertrustDlg.cpp	2005-12-08 09:26:32 UTC (rev 117)
@@ -100,7 +100,7 @@
                        _("Here it is possible to save or restore the ownertrust from the "
                          "'trustdb' file. This could be very useful because the values are NOT "
                          "stored in the keyring."));
-	SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));
+	SetDlgItemText (dlg, IDCANCEL, _("&Close"));
 	center_window (dlg, NULL);
         SetForegroundWindow (dlg);
         return TRUE;

Modified: trunk/Src/wptPreferencesDlg.cpp
===================================================================
--- trunk/Src/wptPreferencesDlg.cpp	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Src/wptPreferencesDlg.cpp	2005-12-08 09:26:32 UTC (rev 117)
@@ -148,8 +148,8 @@
 	SetDlgItemText (dlg, IDC_PREFS_CURRINF, _("Current window hotkeys"));
 	SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));
 
-        SetDlgItemInt( dlg, IDC_PREFS_CACHETIME, reg_prefs.cache_time, TRUE );
-        SetDlgItemInt( dlg, IDC_PREFS_WORDWRAP, reg_prefs.word_wrap, TRUE );
+        SetDlgItemInt (dlg, IDC_PREFS_CACHETIME, reg_prefs.cache_time, TRUE);
+        SetDlgItemInt (dlg, IDC_PREFS_WORDWRAP, reg_prefs.word_wrap, TRUE);
 	if (reg_prefs.backup.path)
 	    SetDlgItemText (dlg, IDC_PREFS_BAKPATH, reg_prefs.backup.path);
 	if (reg_prefs.kserv_conf)
@@ -171,8 +171,8 @@
 			reg_prefs.backup.mode==1? BST_CHECKED : BST_UNCHECKED );
 	CheckDlgButton( dlg, IDC_PREFS_BAKUSER,
 			reg_prefs.backup.mode==2? BST_CHECKED : BST_UNCHECKED );
-        if( reg_prefs.no_hotkeys )
-            disable_hotkey_items( dlg, 1 );
+        if (reg_prefs.no_hotkeys)
+            disable_hotkey_items (dlg, 1);
 	if (!reg_prefs.auto_backup)
 	    enable_backup_items (dlg, 0);
 	EnableWindow (GetDlgItem (dlg, IDC_PREFS_BAKPATH), 
@@ -196,17 +196,17 @@
 	    switch( (int)LOWORD( wparam ) ) {
 	    case IDC_PREFS_DISABLE_HOTKEYS:            
                 reg_prefs.no_hotkeys ^= 1;
-                disable_hotkey_items( dlg, reg_prefs.no_hotkeys );
+                disable_hotkey_items (dlg, reg_prefs.no_hotkeys);
 		break;
 
 	    case IDC_PREFS_TRUST:
 		reg_prefs.always_trust ^= 1;
-		if( reg_prefs.always_trust ) {
+		if (reg_prefs.always_trust) {
 		    msg_box (dlg,
 		_("In most cases it is not a good idea to enable this setting.\n"
 		  "If you know what you are doing let this flag enabled, otherwise\n"
 		  "it is safe to leave this flag untouched."), 
-		  _("Preferences"), MB_ICONWARNING|MB_OK );
+		  _("Preferences"), MB_ICONWARNING|MB_OK);
 		}
 		break;
 
@@ -250,23 +250,23 @@
 
         case IDOK:
             rc = GetDlgItemInt( dlg, IDC_PREFS_CACHETIME, NULL, FALSE );
-            if( !rc )
+            if (!rc)
                 reg_prefs.cache_time = 0;
-            else if( rc > 3600 ) {
+            else if (rc > 3600) {
                 msg_box( dlg, _("Please enter a value that is between 1-3600.\nIt is not "
 				"a good idea to cache the passphrase more than one hour."),
-				_("Preferences"), MB_ERR );
-		SetDlgItemInt( dlg, IDC_PREFS_CACHETIME, 0, FALSE );
+				_("Preferences"), MB_ERR);
+		SetDlgItemInt (dlg, IDC_PREFS_CACHETIME, 0, FALSE);
                 return TRUE;
             }
 	    if (reg_prefs.cache_time != rc)
 		agent_flush_cache ();
             reg_prefs.cache_time = rc;
-            rc = GetDlgItemInt( dlg, IDC_PREFS_WORDWRAP, NULL, FALSE );
-	    if( !rc )
+            rc = GetDlgItemInt (dlg, IDC_PREFS_WORDWRAP, NULL, FALSE);
+	    if (!rc)
                 reg_prefs.word_wrap = 0;
-            else if( rc > 80 ) {
-                msg_box( dlg, _("Please enter a value between 1-80."), _("Preferences"), MB_ERR );
+            else if (rc > 80) {
+                msg_box (dlg, _("Please enter a value between 1-80."), _("Preferences"), MB_ERR);
                 return TRUE;
             }
             reg_prefs.word_wrap = rc;
@@ -349,7 +349,12 @@
             return TRUE;
             
         case IDCANCEL:
-            EndDialog( dlg, FALSE );
+	    /* Reset backup mode if no mode was chosen. */
+	    if (reg_prefs.auto_backup == 1 &&
+		!IsDlgButtonChecked (dlg, IDC_PREFS_BAKHOME) &&
+		!IsDlgButtonChecked (dlg, IDC_PREFS_BAKUSER))
+		reg_prefs.auto_backup = 0;
+            EndDialog (dlg, FALSE);
             return FALSE;
         }
         break;

Modified: trunk/Src/wptRegistry.cpp
===================================================================
--- trunk/Src/wptRegistry.cpp	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/Src/wptRegistry.cpp	2005-12-08 09:26:32 UTC (rev 117)
@@ -43,6 +43,7 @@
     {0}
 };
 
+
 struct reg_hotkey_s reg_hotkeys[] = {
     {"ClipEncrypt", "", 0},
     {"ClipDecrypt", "", 0},
@@ -60,6 +61,24 @@
 #define WINPT_REG "Software\\WinPT"
 
 
+/* Return != 0 if GPGee is installed. */
+int
+is_gpgee_installed (void)
+{
+    HKEY hk;
+    LONG ec;
+
+    ec = RegOpenKeyEx (HKEY_CURRENT_USER, "Software\\GPGee", 0, KEY_READ, &hk);
+    if (ec == ERROR_SUCCESS) {
+	RegCloseKey (hk);
+	return -1;
+    }
+
+    return 0;
+}
+
+
+/* Free all members in the registry preference struct. */
 void
 free_reg_prefs (void)
 {
@@ -67,7 +86,7 @@
     free_if_alloc (reg_prefs.kserv_conf);
     free_if_alloc (reg_prefs.homedir);
     memset (&reg_prefs, 0, sizeof reg_prefs);
-} /* free_reg_prefs */
+}
 
 
 /* Register the given WinPT filetype. */
@@ -80,7 +99,7 @@
     GetModuleFileName (glob_hinst, prog, sizeof (prog)-1);
     _snprintf (icon, sizeof (icon) -1, "%s,%d", prog, gfile->nicon);
     return create_file_type (prog, gfile->ext, gfile->descr, icon);
-} /* regist_single_filetype */
+}
 
 
 /* Install the GPG related into the W32 resgistry, if the entry already
@@ -116,13 +135,13 @@
 } /* regist_inst_gpg */
 
 
-/* Install WinPT into the W32 registry, if the entry already
+/* Install WinPT into the W32 registry, if the entry already 
    exists the function returns immediately. @with_ext can be
    used to register some file types (if 1). @created contains
    1 if the registry key was created.
    Return value: 0 on success. */
 int
-regist_inst_winpt (int with_ext, int * created)
+regist_inst_winpt (int with_ext, int *created)
 {
     HKEY reg;
     char *p = NULL;
@@ -133,7 +152,7 @@
 	*created = 0;
 
     p = get_reg_entry (HKEY_CURRENT_USER, WINPT_REG, "Extensions");
-    if (p && *p == '1')
+    if ((p && *p == '1') || is_gpgee_installed ())
 	with_ext = 0;
     free_if_alloc (p);
 
@@ -162,10 +181,10 @@
 	
 start:
     rc = RegOpenKeyEx (HKEY_CURRENT_USER, WINPT_REG, 0, KEY_READ, &reg);
-    if (rc_ok (rc)) {	
+    if (rc_ok (rc)) {
 	RegCloseKey (reg);
 	rc = RegOpenKeyEx (HKEY_CURRENT_USER, WINPT_REG"\\Keyserver", 0, KEY_READ, &reg);
-	if (!rc_ok (rc)) {
+	if( !rc_ok (rc)) {
 	    RegCreateKey (HKEY_CURRENT_USER, WINPT_REG"\\Keyserver", &reg);
 	    RegCloseKey (reg);
 	}
@@ -181,7 +200,7 @@
 	    set_reg_entry (HKEY_CURRENT_USER, WINPT_REG, "Extensions", "1");
 	return 0;
     }
-    rc = RegCreateKey(HKEY_CURRENT_USER, WINPT_REG, &reg);
+    rc = RegCreateKey (HKEY_CURRENT_USER, WINPT_REG, &reg);
     if (!rc_ok (rc))
 	return WPTERR_REGISTRY;
     if (created)
@@ -196,10 +215,8 @@
 		break;
 	    }
 	}
-	set_reg_entry (HKEY_CURRENT_USER, WINPT_REG, 
-		       "Install Directory", modpath);
+	set_reg_entry (HKEY_CURRENT_USER, WINPT_REG, "Install Directory", modpath);
     }
-    
     return 0;
 }
 
@@ -380,6 +397,8 @@
 }
 
 
+
+
 int
 set_reg_entry_mo (const char * value)
 {	
@@ -421,17 +440,17 @@
 {	
     char *p, *pp;
     const char *lang;
-    
+
     p = get_reg_entry (HKEY_CURRENT_USER, 
 		       "Control Panel\\Mingw32\\NLS", "MODir");
     if (p)
 	return p;
-    
+
     lang = get_gettext_langid ();
-    if (!lang)
-	return NULL;
+    if (!lang)    
+	return NULL;	
     pp = new char[strlen ("share\\xxxxx\\locale\\LC_MESSAGES")+8];
-    if (!pp)
+    if (!pp)    
 	BUG (NULL);
     sprintf (pp, "share\\locale\\%s\\LC_MESSAGES", lang);
     p = get_reg_entry_gpg4win (pp);
@@ -474,7 +493,7 @@
 int
 get_reg_winpt_single (int id)
 {
-    char * buf = NULL;
+    char *buf = NULL;
     int val = 0;
 
     buf = get_reg_entry (HKEY_CURRENT_USER, WINPT_REG, cfg[id]);
@@ -602,7 +621,7 @@
 int
 get_reg_winpt_prefs (winpt_reg_prefs_s * opt)
 {
-    char * val = NULL;
+    char *val = NULL;
     size_t i;
 
     for (i=1; i < DIM (cfg); i++) {

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2005-12-07 17:06:29 UTC (rev 116)
+++ trunk/TODO	2005-12-08 09:26:32 UTC (rev 117)
@@ -7,7 +7,8 @@
     * Check that the reload keycache flag is set for all keyserver
       operations.
     
-    * Check 'winpt --keymanager' when an instance is running.
+    * winpt --keymanager aborts when the keyring is empty on the
+      first start.
  
 -1.0.0-
     * The key cache reload is much faster when no progress callback



More information about the Winpt-commits mailing list