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

Legend:
Removed from v.24  
changed lines
  Added in v.36

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26