136 |
SetDlgItemText (dlg, IDC_PREFS_DISABLE_HOTKEYS, _("&Disable hotkeys (Not recommended!)")); |
SetDlgItemText (dlg, IDC_PREFS_DISABLE_HOTKEYS, _("&Disable hotkeys (Not recommended!)")); |
137 |
SetDlgItemText (dlg, IDC_PREFS_TRUST, _("Skip key validation and assume that keys are always fully trusted")); |
SetDlgItemText (dlg, IDC_PREFS_TRUST, _("Skip key validation and assume that keys are always fully trusted")); |
138 |
SetDlgItemText (dlg, IDC_PREFS_AUTOBACKUP, _("&Automatic keyring backup when WinPT closes")); |
SetDlgItemText (dlg, IDC_PREFS_AUTOBACKUP, _("&Automatic keyring backup when WinPT closes")); |
139 |
SetDlgItemText (dlg, IDC_PREFS_BAKHOME, _("Backup to GPG &home folder")); |
SetDlgItemText (dlg, IDC_PREFS_BAKHOME, _("Backup to &keyring folder")); |
140 |
SetDlgItemText (dlg, IDC_PREFS_BAKUSER, _("Backup to:")); |
SetDlgItemText (dlg, IDC_PREFS_BAKUSER, _("Backup to:")); |
141 |
SetDlgItemText (dlg, IDC_PREFS_KEYLISTINF, _("Select &key list mode")); |
SetDlgItemText (dlg, IDC_PREFS_KEYLISTINF, _("Select &key list mode")); |
142 |
SetDlgItemText (dlg, IDC_PREFS_WIPEINF, _("Select &wipe mode")); |
SetDlgItemText (dlg, IDC_PREFS_WIPEINF, _("Select &wipe mode")); |
146 |
SetDlgItemText (dlg, IDC_PREFS_ALLOPTINF, _("General options")); |
SetDlgItemText (dlg, IDC_PREFS_ALLOPTINF, _("General options")); |
147 |
SetDlgItemText (dlg, IDC_PREFS_CLIPINF, _("Clipboard hotkeys")); |
SetDlgItemText (dlg, IDC_PREFS_CLIPINF, _("Clipboard hotkeys")); |
148 |
SetDlgItemText (dlg, IDC_PREFS_CURRINF, _("Current window hotkeys")); |
SetDlgItemText (dlg, IDC_PREFS_CURRINF, _("Current window hotkeys")); |
149 |
|
SetDlgItemText (dlg, IDC_PREFS_KSELFILE, _("Browse...")); |
150 |
|
SetDlgItemText (dlg, IDC_PREFS_BAKSELECT, _("Browse...")); |
151 |
SetDlgItemText (dlg, IDCANCEL, _("&Cancel")); |
SetDlgItemText (dlg, IDCANCEL, _("&Cancel")); |
152 |
|
|
153 |
SetDlgItemInt (dlg, IDC_PREFS_CACHETIME, reg_prefs.cache_time, TRUE); |
SetDlgItemInt (dlg, IDC_PREFS_CACHETIME, reg_prefs.cache_time, TRUE); |
154 |
SetDlgItemInt (dlg, IDC_PREFS_WORDWRAP, reg_prefs.word_wrap, TRUE); |
SetDlgItemInt (dlg, IDC_PREFS_WORDWRAP, reg_prefs.word_wrap, TRUE); |
155 |
if (reg_prefs.backup.path) |
if (reg_prefs.backup.path) |
156 |
SetDlgItemText (dlg, IDC_PREFS_BAKPATH, reg_prefs.backup.path); |
SetDlgItemText (dlg, IDC_PREFS_BAKPATH, reg_prefs.backup.path); |
|
if (reg_prefs.kserv_conf) |
|
|
SetDlgItemText (dlg, IDC_PREFS_KSERVER, reg_prefs.kserv_conf); |
|
157 |
|
|
158 |
for (i=0; (id=hotkeys[i]); i++) |
for (i=0; (id=hotkeys[i]); i++) |
159 |
SetDlgItemText (dlg, id, reg_hotkeys[i].key); |
SetDlgItemText (dlg, id, reg_hotkeys[i].key); |
242 |
SetDlgItemText (dlg, IDC_PREFS_BAKPATH, bpath); |
SetDlgItemText (dlg, IDC_PREFS_BAKPATH, bpath); |
243 |
break; |
break; |
244 |
|
|
|
case IDC_PREFS_KSELFILE: { |
|
|
const char * name; |
|
|
name = get_fileopen_dlg (dlg, _("Please select a keyserver.conf file"), |
|
|
NULL, NULL); |
|
|
if (name != NULL) |
|
|
SetDlgItemText (dlg, IDC_PREFS_KSERVER, name); |
|
|
break; } |
|
|
|
|
245 |
case IDOK: |
case IDOK: |
246 |
rc = GetDlgItemInt( dlg, IDC_PREFS_CACHETIME, NULL, FALSE ); |
rc = GetDlgItemInt( dlg, IDC_PREFS_CACHETIME, NULL, FALSE ); |
247 |
if (!rc) |
if (!rc) |
280 |
if (!p) |
if (!p) |
281 |
BUG (0); |
BUG (0); |
282 |
} |
} |
|
free_if_alloc (reg_prefs.kserv_conf); |
|
|
if (!GetDlgItemText (dlg, IDC_PREFS_KSERVER, path, sizeof (path)-1) |
|
|
|| file_exist_check (path)) { |
|
|
rc = msg_box (dlg, _("The specified keyserver config file is invalid.\n\n" |
|
|
"Create new default config file?"), |
|
|
_("Preferences"), MB_ERR|MB_YESNO); |
|
|
if (rc == IDNO) |
|
|
return TRUE; |
|
|
else |
|
|
{ |
|
|
char cwd[256], * fn; |
|
|
FILE * fp = fopen ("keyserver.conf", "wb"); |
|
|
if (fp) { |
|
|
fprintf (fp, "%s\r\n", DEF_HKP_KEYSERVER); |
|
|
fclose (fp); |
|
|
} |
|
|
GetCurrentDirectory (DIM (cwd)-1, cwd); |
|
|
fn = make_filename (cwd, "keyserver", "conf"); |
|
|
memset (path, 0, sizeof( path)); |
|
|
strncpy (path, fn, DIM (path)-1); |
|
|
free_if_alloc (fn); |
|
|
} |
|
|
} |
|
|
p = reg_prefs.kserv_conf = m_strdup (path); |
|
|
if (!p) |
|
|
BUG (0); |
|
283 |
|
|
284 |
cb = GetDlgItem( dlg, IDC_PREFS_LISTMODE ); |
cb = GetDlgItem( dlg, IDC_PREFS_LISTMODE ); |
285 |
reg_prefs.keylist_mode = SendMessage( cb, CB_GETCURSEL, 0, 0 ); |
reg_prefs.keylist_mode = SendMessage( cb, CB_GETCURSEL, 0, 0 ); |