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

Contents of /trunk/Src/wptKeyCacheDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 208 - (show annotations)
Mon May 1 12:22:18 2006 UTC (18 years, 10 months ago) by twoaday
File size: 2354 byte(s)
See ChangeLog.


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 /* Dialog box procedure for starting the key cache procedure.
35 Actually this dialog is hidden and just kick off the real
36 caching process. */
37 BOOL CALLBACK
38 keycache_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
39 {
40 gpgme_error_t err = 0;
41 refresh_cache_s *rcs;
42 char *pubring, *secring;
43
44 switch (msg) {
45 case WM_INITDIALOG:
46 rcs = (refresh_cache_s *)lparam;
47 if (!rcs)
48 BUG (NULL);
49 SetForegroundWindow (dlg);
50 ShowWindow (dlg, SW_HIDE);
51 center_window (dlg, NULL);
52 SetWindowText (dlg, _("WinPT Key Caching"));
53 ShowWindow (GetDlgItem (dlg, IDC_KEYCACHE_INFO), SW_SHOW);
54 SetDlgItemText (dlg, IDC_KEYCACHE_INFO,
55 _("Caching keyrings, please wait..."));
56
57 pubring = get_gnupg_keyring (1, NO_STRICT);
58 if (!pubring)
59 BUG (0);
60 secring = get_gnupg_keyring (0, NO_STRICT);
61 if (!secring)
62 BUG (0);
63 if (rcs->tr_update)
64 gpg_rebuild_cache (NULL);
65 if (rcs->kr_update)
66 err = keycache_init (pubring, secring);
67 free_if_alloc (pubring);
68 free_if_alloc (secring);
69 if (err) {
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