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" |
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. */ |
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 |
free_if_alloc (optbuf); |
58 |
free_if_alloc( optbuf ); |
SetForegroundWindow (dlg); |
|
SetForegroundWindow( dlg ); |
|
59 |
return TRUE; |
return TRUE; |
60 |
|
|
|
case WM_SYSCOMMAND: |
|
|
if( LOWORD (wparam) == SC_CLOSE ) |
|
|
EndDialog(dlg, TRUE); |
|
|
return FALSE; |
|
|
|
|
61 |
case WM_COMMAND: |
case WM_COMMAND: |
62 |
switch( LOWORD( wparam ) ) { |
switch( LOWORD( wparam ) ) { |
63 |
case IDC_GPGOPT_SAVE: |
case IDC_GPGOPT_SAVE: |
64 |
optbuf = new char[nbytes + 1]; |
optbuf = new char[nbytes + 1]; |
65 |
if( !optbuf ) |
if (!optbuf) |
66 |
BUG( dlg); |
BUG (0); |
67 |
nbytes = GetDlgItemText( dlg, IDC_GPGOPT_FILE, optbuf, nbytes ); |
nbytes = GetDlgItemText (dlg, IDC_GPGOPT_FILE, optbuf, nbytes); |
68 |
if( !nbytes ) { |
if (!nbytes) { |
69 |
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); |
70 |
free_if_alloc( optbuf ); |
free_if_alloc (optbuf); |
71 |
return FALSE; |
return FALSE; |
72 |
} |
} |
73 |
optbuf[nbytes] = '\0'; |
optbuf[nbytes] = '\0'; |