2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
14 #include <afs/param.h>
18 #include "afs_config.h"
22 * DEFINITIONS ________________________________________________________________
27 #define nRETRY_MAX 180
29 static TCHAR szYes[10] = TEXT("Yes");
30 static TCHAR szNo[10] = TEXT("No");
33 static BOOL fFirstTime = TRUE;
34 static DWORD nLoginRetryInterval;
35 static BOOL fFailLoginsSilently;
39 * PROTOTYPES _________________________________________________________________
43 void Logon_OnInitDialog (HWND hDlg);
44 void Logon_OnOK (HWND hDlg);
45 void Logon_OnCancel(HWND hDlg);
50 * ROUTINES ___________________________________________________________________
54 BOOL CALLBACK Logon_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
59 Logon_OnInitDialog (hDlg);
62 case WM_CTLCOLORSTATIC:
63 if ((HWND)lp == GetDlgItem (hDlg, IDC_CHUNK_SIZE))
65 if (IsWindowEnabled ((HWND)lp))
67 static HBRUSH hbrStatic = CreateSolidBrush (GetSysColor (COLOR_WINDOW));
68 SetTextColor ((HDC)wp, GetSysColor (COLOR_WINDOWTEXT));
69 SetBkColor ((HDC)wp, GetSysColor (COLOR_WINDOW));
70 return (BOOL)hbrStatic;
79 Logon_DlgProc (hDlg, WM_HELP, 0, 0);
93 WinHelp (hDlg, g.szHelpFile, HELP_CONTEXT, IDH_AFSCONFIG_ADVANCED_LOGON);
101 void Logon_OnInitDialog (HWND hDlg)
104 Config_GetLoginRetryInterval(&g.Configuration.nLoginRetryInterval);
105 Config_GetFailLoginsSilently(&g.Configuration.fFailLoginsSilently);
107 nLoginRetryInterval = g.Configuration.nLoginRetryInterval;
108 fFailLoginsSilently = g.Configuration.fFailLoginsSilently;
113 CreateSpinner (GetDlgItem (hDlg, IDC_LOGIN_RETRY_INTERVAL), 10, FALSE, nRETRY_MIN, nLoginRetryInterval, nRETRY_MAX);
115 GetString (szYes, IDS_YES);
116 GetString (szNo, IDS_NO);
118 HWND hCombo = GetDlgItem(hDlg, IDC_FAIL_SILENTLY);
120 // Always add szNo first so it has index 0 and szYes has index 1
121 CB_AddItem (hCombo, szNo, 0);
122 CB_AddItem (hCombo, szYes, 0);
124 CB_SetSelected (hCombo, fFailLoginsSilently);
128 void Logon_OnOK (HWND hDlg)
130 nLoginRetryInterval = SP_GetPos (GetDlgItem (hDlg, IDC_LOGIN_RETRY_INTERVAL));
131 fFailLoginsSilently = CB_GetSelected (GetDlgItem (hDlg, IDC_FAIL_SILENTLY));
133 EndDialog(hDlg, IDOK);
142 if (nLoginRetryInterval != g.Configuration.nLoginRetryInterval) {
143 if (!Config_SetLoginRetryInterval (nLoginRetryInterval))
145 g.Configuration.nLoginRetryInterval = nLoginRetryInterval;
148 if (fFailLoginsSilently != g.Configuration.fFailLoginsSilently) {
149 if (!Config_SetFailLoginsSilently (fFailLoginsSilently))
151 g.Configuration.fFailLoginsSilently = fFailLoginsSilently;
158 void Logon_OnCancel(HWND hDlg)
162 EndDialog(hDlg, IDCANCEL);