33 |
#include "wptCard.h" |
#include "wptCard.h" |
34 |
#include "wptFileManager.h" |
#include "wptFileManager.h" |
35 |
#include "wptContext.h" |
#include "wptContext.h" |
36 |
|
#include "wptCardEdit.h" |
37 |
|
|
38 |
HINSTANCE glob_hinst; /* global instance for the dialogs */ |
HINSTANCE glob_hinst; /* global instance for the dialogs */ |
39 |
HWND glob_hwnd; /* global window handle for the dialogs */ |
HWND glob_hwnd; /* global window handle for the dialogs */ |
98 |
check_default_key (gpgme_keycache_t kc) |
check_default_key (gpgme_keycache_t kc) |
99 |
{ |
{ |
100 |
gpgme_key_t key; |
gpgme_key_t key; |
101 |
gpgme_error_t err = GPGME_No_Error; |
gpgme_error_t err = GPG_ERR_NO_ERROR; |
102 |
char * defkey; |
char * defkey; |
103 |
|
|
104 |
defkey = get_gnupg_default_key (); |
defkey = get_gnupg_default_key (); |
224 |
|
|
225 |
glob_hinst = hinst; |
glob_hinst = hinst; |
226 |
|
|
|
gpgme_lib_init (); |
|
227 |
#ifdef _DEBUG |
#ifdef _DEBUG |
228 |
gpgme_set_debug_mode (1); |
gpgme_set_debug_mode (1); |
229 |
#endif |
#endif |
|
gpgme_set_pgm_string ("WinPT "PGM_VERSION); |
|
230 |
|
|
231 |
s = PTD_get_version (); |
s = PTD_get_version (); |
232 |
if (strcmp (s, "0.8.0")) { |
if (strcmp (s, "0.8.0")) { |
279 |
_("Select GPG Public Keyring"), |
_("Select GPG Public Keyring"), |
280 |
_("GPG Keyrings (*.gpg)\0*.gpg\0\0"), |
_("GPG Keyrings (*.gpg)\0*.gpg\0\0"), |
281 |
NULL); |
NULL); |
282 |
if (s && !file_exist_check (s)) |
if (s != NULL) { |
|
{ |
|
283 |
size_t n; |
size_t n; |
284 |
char * p = strrchr (s, '\\'); |
char * p = strrchr (s, '\\'); |
285 |
if (!p) |
if (!p) |
381 |
GetDesktopWindow(), keymanager_dlg_proc, NULL, |
GetDesktopWindow(), keymanager_dlg_proc, NULL, |
382 |
_("Key Manager"), IDS_WINPT_KEYMISC); |
_("Key Manager"), IDS_WINPT_KEYMISC); |
383 |
else { |
else { |
384 |
gpgme_card_t crd = smartcard_init (); |
gpg_card_t crd = smartcard_init (); |
385 |
if (crd) |
if (crd) |
386 |
dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_CARD_EDIT, |
dialog_box_param (glob_hinst, (LPCTSTR)IDD_WINPT_CARD_EDIT, |
387 |
GetDesktopWindow(), card_edit_dlg_proc, |
GetDesktopWindow(), card_edit_dlg_proc, |
388 |
(LPARAM)crd, _("Card Manager"), |
(LPARAM)crd, _("Card Manager"), |
389 |
IDS_WINPT_CARD_EDIT); |
IDS_WINPT_CARD_EDIT); |
390 |
gpgme_card_release (crd); |
gpg_card_release (crd); |
391 |
} |
} |
392 |
keycache_release (); |
keycache_release (); |
393 |
free_gnupg_table (); |
free_gnupg_table (); |
402 |
|
|
403 |
if (cmdline) { |
if (cmdline) { |
404 |
if (stristr (cmdline, "--enable-debug") || stristr (cmdline, "--debug")) { |
if (stristr (cmdline, "--enable-debug") || stristr (cmdline, "--debug")) { |
405 |
gpgme_set_debug_mode (1); |
gpg_set_debug_mode (1); |
406 |
winpt_debug_msg (); |
winpt_debug_msg (); |
407 |
debug = 1; |
debug = 1; |
408 |
} |
} |
432 |
UpdateWindow (hwnd); |
UpdateWindow (hwnd); |
433 |
|
|
434 |
if (!first_start && !start_gpgprefs) { |
if (!first_start && !start_gpgprefs) { |
435 |
gnupg_backup_options (1); |
gnupg_backup_options (); |
|
gnupg_backup_options (0); |
|
|
|
|
436 |
rc = check_crypto_engine (); |
rc = check_crypto_engine (); |
437 |
if (rc) { |
if (rc) { |
438 |
DestroyWindow (hwnd); |
DestroyWindow (hwnd); |