/[winpt]/trunk/Src/wptKeyCacheDlg.cpp
ViewVC logotype

Contents of /trunk/Src/wptKeyCacheDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 217 - (show annotations)
Mon May 22 14:21:39 2006 UTC (18 years, 9 months ago) by twoaday
File size: 2356 byte(s)
2005-05-20  Timo Schulz  <ts@g10code.de>
                                                                                
        * wptKeyPropsDlg.cpp (keyprops_load_photo): avoid expensive
        process call when no photo is available.
        (keyprops_dlg_proc): avoid static data.
        * wptFileManager.cpp (fm_add_sig_stat): Free memory in case
        of on demand key requests.
        (show_verify_result): Likewise.
        (secret_key_available): Likewise.
        (fm_decrypt, fm_sign): Handle the new on demand key request
        mode and free all memory.


1 /* wptKeyCacheDlg.cpp - Key caching dialog
2 * Copyright (C) 2000-2006 Timo Schulz
3 * Copyright (C) 2005, 2006 g10 Code GmbH
4 *
5 * This file is part of WinPT.
6 *
7 * WinPT is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * WinPT is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with WinPT; if not, write to the Free Software Foundation,
19 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 */
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24
25 #include <windows.h>
26
27 #include "resource.h"
28 #include "wptNLS.h"
29 #include "wptGPG.h"
30 #include "wptTypes.h"
31 #include "wptW32API.h"
32 #include "wptVersion.h"
33
34
35
36 /* Dialog box procedure for starting the key cache procedure.
37 Actually this dialog is hidden and just kick off the real
38 caching process. */
39 BOOL CALLBACK
40 keycache_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
41 {
42 gpgme_error_t err = 0;
43 refresh_cache_s *rcs;
44 char *pubring, *secring;
45
46 switch (msg) {
47 case WM_INITDIALOG:
48 rcs = (refresh_cache_s *)lparam;
49 if (!rcs)
50 BUG (NULL);
51 SetForegroundWindow (dlg);
52 ShowWindow (dlg, SW_HIDE);
53 center_window (dlg, NULL);
54 SetWindowText (dlg, _("WinPT Key Caching"));
55 ShowWindow (GetDlgItem (dlg, IDC_KEYCACHE_INFO), SW_SHOW);
56 SetDlgItemText (dlg, IDC_KEYCACHE_INFO,
57 _("Caching keyrings, please wait..."));
58
59 pubring = get_gnupg_keyring (1, NO_STRICT);
60 if (!pubring)
61 BUG (0);
62 secring = get_gnupg_keyring (0, NO_STRICT);
63 if (!secring)
64 BUG (0);
65 if (rcs->tr_update)
66 gpg_rebuild_cache (NULL);
67 if (rcs->kr_update)
68 err = keycache_init (pubring, secring);
69 free_if_alloc (pubring);
70 free_if_alloc (secring);
71 if (err) {
72 msg_box (dlg, gpgme_strerror (err), _("Key Cache"), MB_ERR);
73 EndDialog (dlg, 1);
74 }
75 else
76 EndDialog (dlg, 0);
77 return FALSE;
78 }
79
80 return FALSE;
81 }

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26