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 |
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); |
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 |
free_if_alloc( optbuf ); |
free_if_alloc (optbuf); |
58 |
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'; |