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

Annotation of /trunk/Src/wptKeyCacheDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 47 - (hide annotations)
Mon Oct 31 14:04:59 2005 UTC (19 years, 4 months ago) by werner
File size: 2442 byte(s)
Minor changes; compiles now but gettext is still missing.

1 werner 36 /* 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     #include <windows.h>
28    
29 werner 47 #include "resource.h"
30 werner 36 #include "wptNLS.h"
31     #include "wptGPG.h"
32     #include "wptTypes.h"
33     #include "wptW32API.h"
34     #include "wptVersion.h"
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;
43     refresh_cache_s * rcs;
44     char * pubring = NULL, * secring = NULL;
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     #ifndef LANG_DE
55     SetWindowText (dlg, _("WinPT Key Caching"));
56     #endif
57     ShowWindow (GetDlgItem (dlg, IDC_KEYCACHE_INFO), SW_SHOW);
58     SetDlgItemText (dlg, IDC_KEYCACHE_INFO,
59     _("Caching keyrings, please wait..."));
60    
61     pubring = get_gnupg_keyring (1, NO_STRICT);
62     if (!pubring)
63     BUG (0);
64     secring = get_gnupg_keyring (0, NO_STRICT);
65     if (!secring)
66     BUG (0);
67     if (rcs->tr_update)
68     gpg_rebuild_cache (NULL);
69     if (rcs->kr_update) {
70     keycache_set_reload (rcs->kr_reload);
71     err = keycache_init (pubring, secring);
72     if (err)
73     msg_box (dlg, gpgme_strerror (err), _("Key Cache"), MB_ERR);
74     }
75     free_if_alloc (pubring);
76     free_if_alloc (secring);
77     EndDialog (dlg, TRUE);
78     return FALSE;
79     }
80    
81     return FALSE;
82     }

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26