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

Diff of /trunk/Src/wptGPGOptDlg.cpp

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

revision 36 by werner, Thu Oct 27 15:25:13 2005 UTC revision 248 by twoaday, Fri Jul 28 11:11:09 2006 UTC
# Line 17  Line 17 
17   * along with WinPT; if not, write to the Free Software Foundation,   * along with WinPT; if not, write to the Free Software Foundation,
18   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA   * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19   */   */
   
20  #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
21  #include <config.h>  #include <config.h>
22  #endif  #endif
23    
24  #include <windows.h>  #include <windows.h>
 #include <windows.h>  
25    
26  #include "wptTypes.h"  #include "wptTypes.h"
27  #include "wptNLS.h"  #include "wptNLS.h"
# Line 33  Line 31 
31  #include "wptDlgs.h"  #include "wptDlgs.h"
32  #include "wptW32API.h"  #include "wptW32API.h"
33  #include "wptErrors.h"  #include "wptErrors.h"
34  #include "../resource.h"  #include "resource.h"
35    
36    
37  /* Dialog box procedure for the GPG config file. */  /* Dialog box procedure for the GPG config file. */
# Line 46  gpgopt_dlg_proc (HWND dlg, UINT msg, WPA Line 44  gpgopt_dlg_proc (HWND dlg, UINT msg, WPA
44      switch (msg)  {      switch (msg)  {
45      case WM_INITDIALOG:        case WM_INITDIALOG:  
46          optbuf = get_gnupg_config ();          optbuf = get_gnupg_config ();
47          if (!optbuf)          if (!optbuf) {
48              dlg_fatal_error (dlg,  _("Could not load GnuPG config file!"));              msg_box (dlg,  _("Could not load GnuPG config file!"),
49                         _("GPG Config"), MB_ERR);
50                EndDialog (dlg, FALSE);
51                return TRUE;
52            }
53          SetDlgItemText (dlg, IDC_GPGOPT_FILE, optbuf);          SetDlgItemText (dlg, IDC_GPGOPT_FILE, optbuf);
         #ifndef LANG_DE  
54          SetWindowText (dlg, _("GnuPG Configuration File" ));          SetWindowText (dlg, _("GnuPG Configuration File" ));
55          SetDlgItemText (dlg, IDC_GPGOPT_SAVE, _("&Save"));          SetDlgItemText (dlg, IDC_GPGOPT_SAVE, _("&Save"));
56          SetDlgItemText (dlg, IDC_GPGOPT_LOAD, _("&Load"));          SetDlgItemText (dlg, IDC_GPGOPT_LOAD, _("&Load"));
57          #endif          SetDlgItemText (dlg, IDCANCEL, _("&Exit"));
58          free_if_alloc( optbuf );          free_if_alloc (optbuf);
59          SetForegroundWindow( dlg );          SetForegroundWindow (dlg);
60          return TRUE;          return TRUE;
61                    
     case WM_SYSCOMMAND:  
         if( LOWORD (wparam) == SC_CLOSE )  
             EndDialog(dlg, TRUE);  
         return FALSE;  
           
62      case WM_COMMAND:      case WM_COMMAND:
63          switch( LOWORD( wparam ) ) {          switch( LOWORD( wparam ) ) {
64          case IDC_GPGOPT_SAVE:                        case IDC_GPGOPT_SAVE:              
65              optbuf = new char[nbytes + 1];              optbuf = new char[nbytes + 1];
66              if( !optbuf )              if (!optbuf)
67                  BUG( dlg);                  BUG (0);
68              nbytes = GetDlgItemText( dlg, IDC_GPGOPT_FILE, optbuf, nbytes );              nbytes = GetDlgItemText (dlg, IDC_GPGOPT_FILE, optbuf, nbytes);
69              if( !nbytes ) {              if (!nbytes) {
70                  msg_box( dlg, _("The 'gpg.conf' file is not loaded."), _("GPG Config"), MB_ERR );                  msg_box (dlg, _("The 'gpg.conf' file is not loaded."), _("GPG Config"), MB_ERR);
71                  free_if_alloc( optbuf );                  free_if_alloc (optbuf);
72                  return FALSE;                            return FALSE;          
73              }              }
74              optbuf[nbytes] = '\0';              optbuf[nbytes] = '\0';

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26