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

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26