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

Contents of /trunk/Src/wptKeyCacheDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 48 - (show annotations)
Mon Oct 31 21:14:11 2005 UTC (19 years, 4 months ago) by werner
File size: 2421 byte(s)
More changes.  Compiles again but there are at least gettext issues with
w32-gettext.c.  I can't get a gpg-error build with ENABLE_NLS.

1 /* wptKeyCacheDlg.cpp - Key caching dialog
2 * Copyright (C) 2000-2005 Timo Schulz
3 * Copyright (C) 2005 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
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <windows.h>
27
28 #include "resource.h"
29 #include "wptNLS.h"
30 #include "wptGPG.h"
31 #include "wptTypes.h"
32 #include "wptW32API.h"
33 #include "wptVersion.h"
34
35 /* Dialog box procedure for starting the key cache procedure.
36 Actually this dialog is hidden and just kick off the real
37 caching process. */
38 BOOL CALLBACK
39 keycache_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
40 {
41 gpgme_error_t err;
42 refresh_cache_s * rcs;
43 char * pubring = NULL, * secring = NULL;
44
45 switch( msg ) {
46 case WM_INITDIALOG:
47 rcs = (refresh_cache_s *)lparam;
48 if (!rcs)
49 BUG (NULL);
50 SetForegroundWindow (dlg);
51 ShowWindow (dlg, SW_HIDE);
52 center_window (dlg, NULL);
53 #ifndef LANG_DE
54 SetWindowText (dlg, _("WinPT Key Caching"));
55 #endif
56 ShowWindow (GetDlgItem (dlg, IDC_KEYCACHE_INFO), SW_SHOW);
57 SetDlgItemText (dlg, IDC_KEYCACHE_INFO,
58 _("Caching keyrings, please wait..."));
59
60 pubring = get_gnupg_keyring (1, NO_STRICT);
61 if (!pubring)
62 BUG (0);
63 secring = get_gnupg_keyring (0, NO_STRICT);
64 if (!secring)
65 BUG (0);
66 if (rcs->tr_update)
67 gpg_rebuild_cache (NULL);
68 if (rcs->kr_update) {
69 keycache_set_reload (rcs->kr_reload);
70 err = keycache_init (pubring, secring);
71 if (err)
72 msg_box (dlg, gpgme_strerror (err), _("Key Cache"), MB_ERR);
73 }
74 free_if_alloc (pubring);
75 free_if_alloc (secring);
76 EndDialog (dlg, TRUE);
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