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

Diff of /trunk/Src/wptKeyCacheDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 32 by twoaday, Mon Oct 24 08:03:48 2005 UTC revision 48 by werner, Mon Oct 31 21:14:11 2005 UTC
# Line 1  Line 1 
1  /* wptKeyCacheDlg.cpp - Key caching dialog  /* wptKeyCacheDlg.cpp - Key caching dialog
2   *      Copyright (C) 2000-2005 Timo Schulz   *      Copyright (C) 2000-2005 Timo Schulz
3   *      Copyright (C) 2005 g10 Code GmbH   *      Copyright (C) 2005 g10 Code GmbH
4   *   *
5   * This file is part of WinPT.   * This file is part of WinPT.
6   *   *
7   * WinPT is free software; you can redistribute it and/or modify   * 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   * 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   * the Free Software Foundation; either version 2 of the License, or
10   * (at your option) any later version.   * (at your option) any later version.
11   *   *
12   * WinPT is distributed in the hope that it will be useful,   * WinPT is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU General Public License for more details.   * GNU General Public License for more details.
16   *   *
17   * You should have received a copy of the GNU General Public License   * You should have received a copy of the GNU General Public License
18   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
19   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20   */   */
21    
22  #include <windows.h>  #ifdef HAVE_CONFIG_H
23    #include <config.h>
24  #include "../resource.h"  #endif
25  #include "wptNLS.h"  
26  #include "wptGPG.h"  #include <windows.h>
27  #include "wptTypes.h"  
28  #include "wptW32API.h"  #include "resource.h"
29  #include "wptVersion.h"  #include "wptNLS.h"
30    #include "wptGPG.h"
31  /* Dialog box procedure for starting the key cache procedure.  #include "wptTypes.h"
32     Actually this dialog is hidden and just kick off the real  #include "wptW32API.h"
33     caching process. */  #include "wptVersion.h"
34  BOOL CALLBACK  
35  keycache_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)  /* Dialog box procedure for starting the key cache procedure.
36  {     Actually this dialog is hidden and just kick off the real
37      gpgme_error_t err;     caching process. */
38      refresh_cache_s * rcs;  BOOL CALLBACK
39      char * pubring = NULL, * secring = NULL;  keycache_dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam)
40        {
41      switch( msg ) {      gpgme_error_t err;
42      case WM_INITDIALOG:      refresh_cache_s * rcs;
43          rcs = (refresh_cache_s *)lparam;      char * pubring = NULL, * secring = NULL;
44          if (!rcs)      
45              BUG (NULL);      switch( msg ) {
46          SetForegroundWindow (dlg);      case WM_INITDIALOG:
47          ShowWindow (dlg, SW_HIDE);          rcs = (refresh_cache_s *)lparam;
48          center_window (dlg, NULL);          if (!rcs)
49          #ifndef LANG_DE              BUG (NULL);
50          SetWindowText (dlg, _("WinPT Key Caching"));          SetForegroundWindow (dlg);
51          #endif          ShowWindow (dlg, SW_HIDE);
52          ShowWindow (GetDlgItem (dlg, IDC_KEYCACHE_INFO), SW_SHOW);          center_window (dlg, NULL);
53          SetDlgItemText (dlg, IDC_KEYCACHE_INFO,          #ifndef LANG_DE
54                          _("Caching keyrings, please wait..."));          SetWindowText (dlg, _("WinPT Key Caching"));
55                    #endif
56          pubring = get_gnupg_keyring (1, NO_STRICT);          ShowWindow (GetDlgItem (dlg, IDC_KEYCACHE_INFO), SW_SHOW);
57          if (!pubring)          SetDlgItemText (dlg, IDC_KEYCACHE_INFO,
58              BUG (0);                          _("Caching keyrings, please wait..."));
59          secring = get_gnupg_keyring (0, NO_STRICT);          
60          if (!secring)          pubring = get_gnupg_keyring (1, NO_STRICT);
61              BUG (0);          if (!pubring)
62          if (rcs->tr_update)              BUG (0);
63              gpg_rebuild_cache (NULL);          secring = get_gnupg_keyring (0, NO_STRICT);
64          if (rcs->kr_update) {          if (!secring)
65              keycache_set_reload (rcs->kr_reload);              BUG (0);
66              err = keycache_init (pubring, secring);          if (rcs->tr_update)
67              if (err)              gpg_rebuild_cache (NULL);
68                  msg_box (dlg, gpgme_strerror (err), _("Key Cache"), MB_ERR);          if (rcs->kr_update) {
69          }              keycache_set_reload (rcs->kr_reload);
70          free_if_alloc (pubring);              err = keycache_init (pubring, secring);
71          free_if_alloc (secring);              if (err)
72          EndDialog (dlg, TRUE);                  msg_box (dlg, gpgme_strerror (err), _("Key Cache"), MB_ERR);
73          return FALSE;          }
74      }          free_if_alloc (pubring);
75                free_if_alloc (secring);
76      return FALSE;          EndDialog (dlg, TRUE);
77  }          return FALSE;
78        }
79        
80        return FALSE;
81    }

Legend:
Removed from v.32  
changed lines
  Added in v.48

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26