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

Diff of /trunk/Src/wptPreferencesDlg.cpp

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

revision 116 by twoaday, Wed Nov 30 10:22:00 2005 UTC revision 117 by twoaday, Thu Dec 8 09:26:32 2005 UTC
# Line 148  prefs_dlg_proc (HWND dlg, UINT msg, WPAR Line 148  prefs_dlg_proc (HWND dlg, UINT msg, WPAR
148          SetDlgItemText (dlg, IDC_PREFS_CURRINF, _("Current window hotkeys"));          SetDlgItemText (dlg, IDC_PREFS_CURRINF, _("Current window hotkeys"));
149          SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));          SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));
150    
151          SetDlgItemInt( dlg, IDC_PREFS_CACHETIME, reg_prefs.cache_time, TRUE );          SetDlgItemInt (dlg, IDC_PREFS_CACHETIME, reg_prefs.cache_time, TRUE);
152          SetDlgItemInt( dlg, IDC_PREFS_WORDWRAP, reg_prefs.word_wrap, TRUE );          SetDlgItemInt (dlg, IDC_PREFS_WORDWRAP, reg_prefs.word_wrap, TRUE);
153          if (reg_prefs.backup.path)          if (reg_prefs.backup.path)
154              SetDlgItemText (dlg, IDC_PREFS_BAKPATH, reg_prefs.backup.path);              SetDlgItemText (dlg, IDC_PREFS_BAKPATH, reg_prefs.backup.path);
155          if (reg_prefs.kserv_conf)          if (reg_prefs.kserv_conf)
# Line 171  prefs_dlg_proc (HWND dlg, UINT msg, WPAR Line 171  prefs_dlg_proc (HWND dlg, UINT msg, WPAR
171                          reg_prefs.backup.mode==1? BST_CHECKED : BST_UNCHECKED );                          reg_prefs.backup.mode==1? BST_CHECKED : BST_UNCHECKED );
172          CheckDlgButton( dlg, IDC_PREFS_BAKUSER,          CheckDlgButton( dlg, IDC_PREFS_BAKUSER,
173                          reg_prefs.backup.mode==2? BST_CHECKED : BST_UNCHECKED );                          reg_prefs.backup.mode==2? BST_CHECKED : BST_UNCHECKED );
174          if( reg_prefs.no_hotkeys )          if (reg_prefs.no_hotkeys)
175              disable_hotkey_items( dlg, 1 );              disable_hotkey_items (dlg, 1);
176          if (!reg_prefs.auto_backup)          if (!reg_prefs.auto_backup)
177              enable_backup_items (dlg, 0);              enable_backup_items (dlg, 0);
178          EnableWindow (GetDlgItem (dlg, IDC_PREFS_BAKPATH),          EnableWindow (GetDlgItem (dlg, IDC_PREFS_BAKPATH),
# Line 196  prefs_dlg_proc (HWND dlg, UINT msg, WPAR Line 196  prefs_dlg_proc (HWND dlg, UINT msg, WPAR
196              switch( (int)LOWORD( wparam ) ) {              switch( (int)LOWORD( wparam ) ) {
197              case IDC_PREFS_DISABLE_HOTKEYS:                          case IDC_PREFS_DISABLE_HOTKEYS:            
198                  reg_prefs.no_hotkeys ^= 1;                  reg_prefs.no_hotkeys ^= 1;
199                  disable_hotkey_items( dlg, reg_prefs.no_hotkeys );                  disable_hotkey_items (dlg, reg_prefs.no_hotkeys);
200                  break;                  break;
201    
202              case IDC_PREFS_TRUST:              case IDC_PREFS_TRUST:
203                  reg_prefs.always_trust ^= 1;                  reg_prefs.always_trust ^= 1;
204                  if( reg_prefs.always_trust ) {                  if (reg_prefs.always_trust) {
205                      msg_box (dlg,                      msg_box (dlg,
206                  _("In most cases it is not a good idea to enable this setting.\n"                  _("In most cases it is not a good idea to enable this setting.\n"
207                    "If you know what you are doing let this flag enabled, otherwise\n"                    "If you know what you are doing let this flag enabled, otherwise\n"
208                    "it is safe to leave this flag untouched."),                    "it is safe to leave this flag untouched."),
209                    _("Preferences"), MB_ICONWARNING|MB_OK );                    _("Preferences"), MB_ICONWARNING|MB_OK);
210                  }                  }
211                  break;                  break;
212    
# Line 250  prefs_dlg_proc (HWND dlg, UINT msg, WPAR Line 250  prefs_dlg_proc (HWND dlg, UINT msg, WPAR
250    
251          case IDOK:          case IDOK:
252              rc = GetDlgItemInt( dlg, IDC_PREFS_CACHETIME, NULL, FALSE );              rc = GetDlgItemInt( dlg, IDC_PREFS_CACHETIME, NULL, FALSE );
253              if( !rc )              if (!rc)
254                  reg_prefs.cache_time = 0;                  reg_prefs.cache_time = 0;
255              else if( rc > 3600 ) {              else if (rc > 3600) {
256                  msg_box( dlg, _("Please enter a value that is between 1-3600.\nIt is not "                  msg_box( dlg, _("Please enter a value that is between 1-3600.\nIt is not "
257                                  "a good idea to cache the passphrase more than one hour."),                                  "a good idea to cache the passphrase more than one hour."),
258                                  _("Preferences"), MB_ERR );                                  _("Preferences"), MB_ERR);
259                  SetDlgItemInt( dlg, IDC_PREFS_CACHETIME, 0, FALSE );                  SetDlgItemInt (dlg, IDC_PREFS_CACHETIME, 0, FALSE);
260                  return TRUE;                  return TRUE;
261              }              }
262              if (reg_prefs.cache_time != rc)              if (reg_prefs.cache_time != rc)
263                  agent_flush_cache ();                  agent_flush_cache ();
264              reg_prefs.cache_time = rc;              reg_prefs.cache_time = rc;
265              rc = GetDlgItemInt( dlg, IDC_PREFS_WORDWRAP, NULL, FALSE );              rc = GetDlgItemInt (dlg, IDC_PREFS_WORDWRAP, NULL, FALSE);
266              if( !rc )              if (!rc)
267                  reg_prefs.word_wrap = 0;                  reg_prefs.word_wrap = 0;
268              else if( rc > 80 ) {              else if (rc > 80) {
269                  msg_box( dlg, _("Please enter a value between 1-80."), _("Preferences"), MB_ERR );                  msg_box (dlg, _("Please enter a value between 1-80."), _("Preferences"), MB_ERR);
270                  return TRUE;                  return TRUE;
271              }              }
272              reg_prefs.word_wrap = rc;              reg_prefs.word_wrap = rc;
# Line 349  prefs_dlg_proc (HWND dlg, UINT msg, WPAR Line 349  prefs_dlg_proc (HWND dlg, UINT msg, WPAR
349              return TRUE;              return TRUE;
350                            
351          case IDCANCEL:          case IDCANCEL:
352              EndDialog( dlg, FALSE );              /* Reset backup mode if no mode was chosen. */
353                if (reg_prefs.auto_backup == 1 &&
354                    !IsDlgButtonChecked (dlg, IDC_PREFS_BAKHOME) &&
355                    !IsDlgButtonChecked (dlg, IDC_PREFS_BAKUSER))
356                    reg_prefs.auto_backup = 0;
357                EndDialog (dlg, FALSE);
358              return FALSE;              return FALSE;
359          }          }
360          break;          break;

Legend:
Removed from v.116  
changed lines
  Added in v.117

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26