[Winpt-commits] r80 - in trunk: Include Src
scm-commit at wald.intevation.org
scm-commit at wald.intevation.org
Wed Nov 16 12:05:18 CET 2005
Author: twoaday
Date: 2005-11-16 12:05:16 +0100 (Wed, 16 Nov 2005)
New Revision: 80
Modified:
trunk/Include/ChangeLog
trunk/Include/wptVersion.h
trunk/Include/wptW32API.h
trunk/Src/ChangeLog
trunk/Src/WinPT-en.rc
trunk/Src/WinPT.cpp
trunk/Src/resource.h
trunk/Src/wptAboutDlgs.cpp
trunk/Src/wptKeylist.cpp
trunk/Src/wptPreferencesDlg.cpp
trunk/Src/wptRegistry.cpp
Log:
2005-11-16 Timo Schulz <ts at g10code.com>
* WinPT.cpp (check_crypto_engine): Min is now GPG 1.4.2.
* wptKeylist.cpp (keylist_add_key): Add disabled keys in list
mode.
* wptPreferencesDlg.cpp (prefs_dlg_proc): Localize all strings.
* wptRegistry.cpp (regist_inst_winpt): Set install directory.
Useful for other programs to figure out the path to the EXE.
Modified: trunk/Include/ChangeLog
===================================================================
--- trunk/Include/ChangeLog 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Include/ChangeLog 2005-11-16 11:05:16 UTC (rev 80)
@@ -1,3 +1,8 @@
+2005-11-16 Timo Schulz <ts at g10code.com>
+
+ * wptVersion.h: Define WIN32_LEAN_AND_MEAN.
+ * wptW32API.h: Dummy for the HTML help.
+
2005-11-12 Timo Schulz <ts at g10code.com>
* wptW32API.h: Remove FILE_SAVE, FILE_OPEN. These constants
Modified: trunk/Include/wptVersion.h
===================================================================
--- trunk/Include/wptVersion.h 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Include/wptVersion.h 2005-11-16 11:05:16 UTC (rev 80)
@@ -30,6 +30,9 @@
/* Full package version string */
#define PACKAGE_FULL_VERSION "Version: "PGM_VERSION" "PGM_DATE
+/* Do not include seldom used W32 api parts. */
+#define WIN32_LEAN_AND_MEAN
+
/*-- WinPT.cpp --*/
extern HINSTANCE glob_hinst; /* Global HINSTANCE for tray window */
extern HWND glob_hwnd; /* Global HWND for tray window */
Modified: trunk/Include/wptW32API.h
===================================================================
--- trunk/Include/wptW32API.h 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Include/wptW32API.h 2005-11-16 11:05:16 UTC (rev 80)
@@ -21,7 +21,7 @@
#ifndef WPT_W32_API_H
#define WPT_W32_API_H
-/* #include "wptCrypto.h" */
+/*#include "wptCrypto.h"*/
#include "wptUtil.h"
struct reminder_ctx_s {
@@ -95,4 +95,26 @@
#define item_get_text_length(dlg, itm) \
SendDlgItemMessage ((dlg), (itm), WM_GETTEXTLENGTH, 0, 0)
+#ifdef _MSC_VER
+#include <htmlhelp.h>
+
+#define html_help_init(cookie) \
+ HtmlHelp (NULL, NULL, HH_INITIALIZE, (DWORD)(cookie))
+
+#define html_help_deinit() \
+ HtmlHelp (NULL, NULL, HH_UNINITIALIZE, 0)
+
+#define html_help_dispatch(param, file, helparr) do { \
+ HELPINFO *inf; \
+ inf = (HELPINFO *)param; \
+ if (inf->iContextType == HELPINFO_WINDOW) \
+ HtmlHelp ((HWND)inf->hItemHandle, file, \
+ HH_TP_HELP_CONTEXTMENU, (DWORD)helparr); \
+ } while (0)
+#else
+#define html_help_init(cookie) 0
+#define html_help_deinit() 0
+#define html_help_dispatch(param, file, helparr) 0
+#endif
+
#endif /* WPT_W32_API_H */
Modified: trunk/Src/ChangeLog
===================================================================
--- trunk/Src/ChangeLog 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Src/ChangeLog 2005-11-16 11:05:16 UTC (rev 80)
@@ -1,3 +1,12 @@
+2005-11-16 Timo Schulz <ts at g10code.com>
+
+ * WinPT.cpp (check_crypto_engine): Min is now GPG 1.4.2.
+ * wptKeylist.cpp (keylist_add_key): Add disabled keys in list
+ mode.
+ * wptPreferencesDlg.cpp (prefs_dlg_proc): Localize all strings.
+ * wptRegistry.cpp (regist_inst_winpt): Set install directory.
+ Useful for other programs to figure out the path to the EXE.
+
2005-11-14 Timo Schulz <ts at g10code.com>
* wptGPG.cpp (check_gnupg_engine): Fix version check.
Modified: trunk/Src/WinPT-en.rc
===================================================================
--- trunk/Src/WinPT-en.rc 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Src/WinPT-en.rc 2005-11-16 11:05:16 UTC (rev 80)
@@ -655,10 +655,11 @@
CAPTION "WinPT Preferences"
FONT 8, "MS Sans Serif"
BEGIN
- LTEXT "Cache &passphrases for 'n' seconds",IDC_STATIC,8,9,110,
- 8
+ LTEXT "Cache &passphrases for 'n' seconds",IDC_PREFS_CACHEINF,
+ 5,9,117,8
EDITTEXT IDC_PREFS_CACHETIME,124,7,25,13
- LTEXT "(CTRL+ALT+F to clear the cache)",IDC_STATIC,151,9,108,8
+ LTEXT "(CTRL+ALT+F to clear the cache)",IDC_PREFS_CACHEHINT,
+ 151,9,108,8
GROUPBOX "General options",IDC_STATIC,8,23,245,113
LTEXT "Word wrap cleartext &signatures at column",
IDC_PREFS_WWINFO,13,34,139,8
@@ -671,15 +672,15 @@
CONTROL "Skip key validation and assume that keys are always fully trusted",
IDC_PREFS_TRUST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,
74,234,8
- LTEXT "Select &key list mode",IDC_STATIC,13,88,64,8
- COMBOBOX IDC_PREFS_LISTMODE,81,86,64,35,CBS_DROPDOWNLIST |
+ LTEXT "Select &key list mode",IDC_PREFS_KEYLISTINF,13,88,85,8
+ COMBOBOX IDC_PREFS_LISTMODE,100,86,64,35,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
- LTEXT "Select &wipe mode",IDC_STATIC,13,104,57,8
- COMBOBOX IDC_PREFS_WIPEMODE,81,103,64,40,CBS_DROPDOWNLIST |
+ LTEXT "Select &wipe mode",IDC_PREFS_WIPEINF,13,104,79,8
+ COMBOBOX IDC_PREFS_WIPEMODE,100,103,64,40,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
- LTEXT "Keyserver &config",IDC_STATIC,13,119,54,8
- EDITTEXT IDC_PREFS_KSERVER,81,119,124,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_PREFS_KSELFILE,206,119,22,12
+ LTEXT "Keyserver &config",IDC_PREFS_KSINF,13,119,76,8
+ EDITTEXT IDC_PREFS_KSERVER,100,119,124,12,ES_AUTOHSCROLL
+ PUSHBUTTON "...",IDC_PREFS_KSELFILE,225,119,22,12
GROUPBOX "Clipboard hotkey management",IDC_STATIC,8,137,112,70
LTEXT "Encrypt CTRL+ALT+",IDC_STATIC,13,152,67,8
EDITTEXT IDC_PREFS_CLIP_ENCRYPT,83,150,10,12
@@ -1937,8 +1938,8 @@
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,10,5,0
- PRODUCTVERSION 0,10,5,0
+ FILEVERSION 0,11,0,0
+ PRODUCTVERSION 0,11,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -1956,14 +1957,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.10.5\0"
+ VALUE "FileVersion", "0.11.0\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.10.5\0"
+ VALUE "ProductVersion", "0.11.0\0"
VALUE "SpecialBuild", "\0"
END
END
Modified: trunk/Src/WinPT.cpp
===================================================================
--- trunk/Src/WinPT.cpp 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Src/WinPT.cpp 2005-11-16 11:05:16 UTC (rev 80)
@@ -40,7 +40,7 @@
#include "wptCardEdit.h"
#include "wptCrypto.h"
-#define MIN_GPG_VER "1.4.3" /* Minimal GPG version. */
+#define MIN_GPG_VER "1.4.2" /* Minimal GPG version. */
#define MIN_GPGME_VER "1.2.0" /* Minimal GPGME version. */
@@ -171,7 +171,7 @@
static int
check_crypto_engine (void)
{
- int ma=1, mi=4, pa=3; /* GPG 1.4.3 */
+ int ma=1, mi=4, pa=2; /* GPG 1.4.2 */
int rc;
rc = check_gnupg_engine (&ma, &mi, &pa);
@@ -187,8 +187,8 @@
ma, mi, pa);
return rc;
}
- /* We enable smartcard support for GPG: 1.9 or >= 1.4 */
- if ((ma == 1 && mi >= 4) || ma > 1)
+ /* We enable smartcard support for GPG: >= 2 or >= 1.4.3 */
+ if (ma > 1 || pa >= 3)
scard_support = 1;
gpgver[0] = ma;
Modified: trunk/Src/resource.h
===================================================================
--- trunk/Src/resource.h 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Src/resource.h 2005-11-16 11:05:16 UTC (rev 80)
@@ -580,6 +580,11 @@
#define IDC_KEYPROPS_IMGINF 1466
#define IDC_GPGPREFS_ENCINF 1467
#define IDC_GPGPREFS_CMTINF 1468
+#define IDC_PREFS_KEYLISTINF 1469
+#define IDC_PREFS_WIPEINF 1470
+#define IDC_PREFS_KSINF 1471
+#define IDC_PREFS_CACHEINF 1472
+#define IDC_PREFS_CACHEHINT 1473
#define ID_GPG_ENCRYPT 40003
#define ID_GPG_DECRYPT 40004
#define ID_GPG_SIGN 40005
@@ -750,7 +755,7 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 230
#define _APS_NEXT_COMMAND_VALUE 40176
-#define _APS_NEXT_CONTROL_VALUE 1469
+#define _APS_NEXT_CONTROL_VALUE 1474
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
Modified: trunk/Src/wptAboutDlgs.cpp
===================================================================
--- trunk/Src/wptAboutDlgs.cpp 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Src/wptAboutDlgs.cpp 2005-11-16 11:05:16 UTC (rev 80)
@@ -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
@@ -32,11 +31,20 @@
#include "wptVersion.h"
#include "wptGPG.h"
+#ifdef _MSC_VER
+#include "winpt_header.h"
+static DWORD about_help_arr[] = {
+ IDC_ABOUT_HELP, WPT_ABOUT_HELP,
+ IDC_ABOUT_GPG, WPT_ABOUT_GPG,
+ IDOK, WPT_ABOUT_OK,
+ 0, 0};
+#endif
+
/* Dialog procedure to show 'gpg --version' information. */
static BOOL CALLBACK
about_gpg_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
-{
+{
char *gpg_version;
gpgme_error_t rc;
@@ -77,8 +85,11 @@
BOOL CALLBACK
about_winpt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
{
+ static DWORD cookie = 0;
+
switch (msg) {
case WM_INITDIALOG:
+ html_help_init (&cookie);
SetWindowText (dlg, _("About WinPT"));
SetDlgItemText (dlg, IDC_ABOUT_INFO,
_("A free open source privacy tray for Windows based on GnuPG."));
@@ -98,12 +109,20 @@
"more details. "));
SetDlgItemText (dlg, IDC_ABOUT_GPG, _("&About GPG..."));
SetDlgItemText (dlg, IDC_ABOUT_HELP, _("&Help"));
- SetDlgItemText (dlg, IDC_WINPT_VERSION, PACKAGE_FULL_VERSION);
+ SetDlgItemText (dlg, IDC_WINPT_VERSION, PACKAGE_VERSION);
center_window (dlg, NULL);
SetForegroundWindow (dlg);
return TRUE;
+ case WM_DESTROY:
+ html_help_deinit ();
+ break;
+
+ case WM_HELP:
+ html_help_dispatch (lparam, "winpt.chm::winpt_texts.txt", about_help_arr);
+ break;
+
case WM_SYSCOMMAND:
if (LOWORD (wparam) == SC_CLOSE)
EndDialog (dlg, TRUE);
@@ -112,8 +131,8 @@
case WM_COMMAND:
switch (LOWORD (wparam)) {
case IDC_ABOUT_GPG:
- DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_ABOUTGPG,
- GetDesktopWindow(), about_gpg_dlg_proc, 0);
+ DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_ABOUTGPG, GetDesktopWindow(),
+ about_gpg_dlg_proc, 0);
return TRUE;
case IDC_ABOUT_HELP:
@@ -121,7 +140,7 @@
break;
case IDOK:
- EndDialog( dlg, TRUE );
+ EndDialog (dlg, TRUE);
return TRUE;
}
break;
Modified: trunk/Src/wptKeylist.cpp
===================================================================
--- trunk/Src/wptKeylist.cpp 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Src/wptKeylist.cpp 2005-11-16 11:05:16 UTC (rev 80)
@@ -816,7 +816,7 @@
gpgme_subkey_t k;
/* if the entire key is disabled, just return. */
- if (key->disabled)
+ if (key->disabled && !(mode & KEYLIST_LIST))
return 0;
for (k=key->subkeys, i = 0; i < count_subkeys (key); i++, k=k->next) {
Modified: trunk/Src/wptPreferencesDlg.cpp
===================================================================
--- trunk/Src/wptPreferencesDlg.cpp 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Src/wptPreferencesDlg.cpp 2005-11-16 11:05:16 UTC (rev 80)
@@ -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
@@ -130,7 +129,6 @@
switch ( msg ) {
case WM_INITDIALOG:
- #ifndef LANG_DE
SetWindowText (dlg, _("WinPT Preferences"));
SetDlgItemText (dlg, IDC_PREFS_SECMODE, _("Do not use any &temporary files"));
SetDlgItemText (dlg, IDC_PREFS_VIEWER, _("Use clipboard &viewer to display the plaintext"));
@@ -140,7 +138,12 @@
SetDlgItemText (dlg, IDC_PREFS_AUTOBACKUP, _("&Automatic keyring backup when WinPT closes"));
SetDlgItemText (dlg, IDC_PREFS_BAKHOME, _("Backup to GPG &home folder"));
SetDlgItemText (dlg, IDC_PREFS_BAKUSER, _("Backup to:"));
- #endif
+ SetDlgItemText (dlg, IDC_PREFS_KEYLISTINF, _("Select &key list mode"));
+ SetDlgItemText (dlg, IDC_PREFS_WIPEINF, _("Select &wipe mode"));
+ SetDlgItemText (dlg, IDC_PREFS_KSINF, _("Keyserver &config"));
+ SetDlgItemText (dlg, IDC_PREFS_CACHEINF, _("Cache &passphrases for 'n' seconds"));
+ SetDlgItemText (dlg, IDC_PREFS_CACHEHINT, _("(CTRL+ALT+F to clear the cache)"));
+
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)
Modified: trunk/Src/wptRegistry.cpp
===================================================================
--- trunk/Src/wptRegistry.cpp 2005-11-15 09:07:37 UTC (rev 79)
+++ trunk/Src/wptRegistry.cpp 2005-11-16 11:05:16 UTC (rev 80)
@@ -122,7 +122,8 @@
regist_inst_winpt (int with_ext, int * created)
{
HKEY reg;
- char * p = NULL;
+ char *p = NULL;
+ char modpath[MAX_PATH+1];
int rc, i, id, n = 0;
if( created )
@@ -185,8 +186,19 @@
RegCloseKey( reg );
if( n )
set_reg_entry( HKEY_CURRENT_USER, WINPT_REG, "Extensions", "1" );
+ if ((n=GetModuleFileName (NULL, modpath, MAX_PATH-1)) > 0) {
+ while (n-- > 0) {
+ if (modpath[n] == '\\') {
+ modpath[n] = 0;
+ break;
+ }
+ }
+ set_reg_entry (HKEY_CURRENT_USER, WINPT_REG,
+ "Install Directory", modpath);
+ }
+
return 0;
-} /* regist_inst_winpt */
+}
/* Create a new filetype in the W32 registry.
More information about the Winpt-commits
mailing list