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

Annotation of /trunk/Src/wptKeyCacheDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25 - (hide annotations)
Wed Oct 12 10:04:26 2005 UTC (19 years, 4 months ago) by twoaday
File size: 2447 byte(s)
First testing phase finished.
Provide bug fixes for a lot of (minor) problems.

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26