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

Diff of /trunk/Src/wptGPGPrefsDlg.cpp

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

revision 270 by twoaday, Sat Oct 21 18:08:57 2006 UTC revision 271 by twoaday, Sun Nov 5 08:57:45 2006 UTC
# Line 143  gpgprefs_dlg_proc (HWND dlg, UINT msg, W Line 143  gpgprefs_dlg_proc (HWND dlg, UINT msg, W
143      char *p = NULL, t[256];      char *p = NULL, t[256];
144      const char *s;      const char *s;
145      const char *folder;      const char *folder;
146      gpg_optfile_t opt = NULL;      config_file_t opt = NULL;
147      gpg_option_t e;      conf_option_t e;
148      UINT n;      UINT n;
149            
150      switch (msg) {      switch (msg) {
# Line 178  gpgprefs_dlg_proc (HWND dlg, UINT msg, W Line 178  gpgprefs_dlg_proc (HWND dlg, UINT msg, W
178              parse_config (p, &opt);              parse_config (p, &opt);
179              free_if_alloc (p);              free_if_alloc (p);
180              if (opt) {              if (opt) {
181                  if (find_option (opt, "ask-cert-expire"))                  if (conf_find_option (opt, "ask-cert-expire"))
182                      CheckDlgButton (dlg, IDC_GPGPREFS_ASKEXPIRE, BST_CHECKED);                      CheckDlgButton (dlg, IDC_GPGPREFS_ASKEXPIRE, BST_CHECKED);
183                  if (find_option (opt, "ask-cert-level"))                  if (conf_find_option (opt, "ask-cert-level"))
184                      CheckDlgButton (dlg, IDC_GPGPREFS_ASKLEVEL, BST_CHECKED);                      CheckDlgButton (dlg, IDC_GPGPREFS_ASKLEVEL, BST_CHECKED);
185                  e = find_option (opt, "comment");                  e = conf_find_option (opt, "comment");
186                  if (e != NULL)                  if (e != NULL)
187                      SetDlgItemText (dlg, IDC_GPGPREFS_COMMENT, e->val);                      SetDlgItemText (dlg, IDC_GPGPREFS_COMMENT, e->val);
188                  e = find_option (opt, "encrypt-to");                  e = conf_find_option (opt, "encrypt-to");
189                  if (e != NULL)                  if (e != NULL)
190                      SetDlgItemText (dlg, IDC_GPGPREFS_ENCTO, e->val);                      SetDlgItemText (dlg, IDC_GPGPREFS_ENCTO, e->val);
191                  release_config (opt);                  release_config (opt);
# Line 274  gpgprefs_dlg_proc (HWND dlg, UINT msg, W Line 274  gpgprefs_dlg_proc (HWND dlg, UINT msg, W
274              parse_config (p, &opt);              parse_config (p, &opt);
275    
276              if (IsDlgButtonChecked (dlg, IDC_GPGPREFS_ASKLEVEL)) {              if (IsDlgButtonChecked (dlg, IDC_GPGPREFS_ASKLEVEL)) {
277                  modify_entry (opt, ENTRY_SINGLE, "ask-cert-level", NULL);                  conf_modify_entry (opt, ENTRY_SINGLE, "ask-cert-level", NULL);
278                  reg_prefs.gpg.ask_cert_level = 1;                  reg_prefs.gpg.ask_cert_level = 1;
279              }              }
280              else {              else {
281                  delete_option (opt, "ask-cert-level");                  conf_delete_option (opt, "ask-cert-level");
282                  reg_prefs.gpg.ask_cert_level = 0;                  reg_prefs.gpg.ask_cert_level = 0;
283              }              }
284              if (IsDlgButtonChecked (dlg, IDC_GPGPREFS_ASKEXPIRE)) {              if (IsDlgButtonChecked (dlg, IDC_GPGPREFS_ASKEXPIRE)) {
285                  modify_entry (opt, ENTRY_SINGLE, "ask-cert-expire", NULL);                  conf_modify_entry (opt, ENTRY_SINGLE, "ask-cert-expire", NULL);
286                  reg_prefs.gpg.ask_cert_expire = 1;                  reg_prefs.gpg.ask_cert_expire = 1;
287              }              }
288              else {              else {
289                  delete_option (opt, "ask-cert-expire");                  conf_delete_option (opt, "ask-cert-expire");
290                  reg_prefs.gpg.ask_cert_expire = 0;                  reg_prefs.gpg.ask_cert_expire = 0;
291              }              }
292    
293              n = GetDlgItemText(dlg, IDC_GPGPREFS_COMMENT, t, DIM (t)-1);              n = GetDlgItemText(dlg, IDC_GPGPREFS_COMMENT, t, DIM (t)-1);
294              if (n > 0)              if (n > 0)
295                  modify_entry (opt, ENTRY_MULTI, "comment", t);                  conf_modify_entry (opt, ENTRY_MULTI, "comment", t);
296              else if (n == 0)              else if (n == 0)
297                  modify_entry (opt, ENTRY_MULTI, "comment", "\"\"");                  conf_modify_entry (opt, ENTRY_MULTI, "comment", "\"\"");
298              else              else
299                  delete_option (opt, "comment");                  conf_delete_option (opt, "comment");
300    
301              n = GetDlgItemText (dlg, IDC_GPGPREFS_ENCTO, t, DIM (t)-1);              n = GetDlgItemText (dlg, IDC_GPGPREFS_ENCTO, t, DIM (t)-1);
302              if (n > 0)              if (n > 0)
303                  modify_entry (opt, ENTRY_MULTI, "encrypt-to", t);                  conf_modify_entry (opt, ENTRY_MULTI, "encrypt-to", t);
304              else              else
305                  delete_option (opt, "encrypt-to");                  conf_delete_option (opt, "encrypt-to");
306    
307              commit_config (p, opt);              commit_config (p, opt);
308              release_config (opt);              release_config (opt);

Legend:
Removed from v.270  
changed lines
  Added in v.271

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26