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

Contents of /trunk/Src/wptKeyCacheDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 273 - (show annotations)
Fri Dec 8 10:22:17 2006 UTC (18 years, 2 months ago) by twoaday
File size: 2277 byte(s)


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 #ifdef HAVE_CONFIG_H
18 #include <config.h>
19 #endif
20
21 #include <windows.h>
22
23 #include "resource.h"
24 #include "wptNLS.h"
25 #include "wptGPG.h"
26 #include "wptTypes.h"
27 #include "wptW32API.h"
28 #include "wptVersion.h"
29
30
31
32 /* Dialog box procedure for starting the key cache procedure.
33 Actually this dialog is hidden and just kick off the real
34 caching process. */
35 BOOL CALLBACK
36 keycache_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
37 {
38 gpgme_error_t err = 0;
39 refresh_cache_s *rcs;
40 char *pubring, *secring;
41
42 switch (msg) {
43 case WM_INITDIALOG:
44 rcs = (refresh_cache_s *)lparam;
45 if (!rcs)
46 BUG (NULL);
47 SetForegroundWindow (dlg);
48 ShowWindow (dlg, SW_HIDE);
49 center_window (dlg, NULL);
50 SetWindowText (dlg, _("WinPT Key Caching"));
51 ShowWindow (GetDlgItem (dlg, IDC_KEYCACHE_INFO), SW_SHOW);
52 SetDlgItemText (dlg, IDC_KEYCACHE_INFO,
53 _("Caching keyrings, please wait..."));
54
55 pubring = get_gnupg_keyring (1, NO_STRICT);
56 if (!pubring)
57 BUG (0);
58 secring = get_gnupg_keyring (0, NO_STRICT);
59 if (!secring)
60 BUG (0);
61 if (rcs->sig_update)
62 gpg_rebuild_cache (NULL);
63 if (rcs->kring_update)
64 err = keycache_init (pubring, secring);
65 free_if_alloc (pubring);
66 free_if_alloc (secring);
67 if (err) {
68 /* XXX: should we use gpg_check_return_code() to suggest
69 to check the config file in case of errors?? */
70 msg_box (dlg, gpgme_strerror (err), _("Key Cache"), MB_ERR);
71 EndDialog (dlg, 1);
72 }
73 else
74 EndDialog (dlg, 0);
75 return FALSE;
76 }
77
78 return FALSE;
79 }

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26