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
11 #include <afs/param.h>
15 #include "afs_config.h"
19 * DEFINITIONS ________________________________________________________________
24 #define nRETRY_MAX 180
26 static TCHAR szYes[10] = TEXT("Yes");
27 static TCHAR szNo[10] = TEXT("No");
30 static BOOL fFirstTime = TRUE;
31 static DWORD nLoginRetryInterval;
32 static BOOL fFailLoginsSilently;
36 * PROTOTYPES _________________________________________________________________
40 void Logon_OnInitDialog (HWND hDlg);
41 void Logon_OnOK (HWND hDlg);
42 void Logon_OnCancel(HWND hDlg);
47 * ROUTINES ___________________________________________________________________
51 BOOL CALLBACK Logon_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp)
56 Logon_OnInitDialog (hDlg);
59 case WM_CTLCOLORSTATIC:
60 if ((HWND)lp == GetDlgItem (hDlg, IDC_CHUNK_SIZE))
62 if (IsWindowEnabled ((HWND)lp))
64 static HBRUSH hbrStatic = CreateSolidBrush (GetSysColor (COLOR_WINDOW));
65 SetTextColor ((HDC)wp, GetSysColor (COLOR_WINDOWTEXT));
66 SetBkColor ((HDC)wp, GetSysColor (COLOR_WINDOW));
67 return (BOOL)hbrStatic;
76 Logon_DlgProc (hDlg, WM_HELP, 0, 0);
90 WinHelp (hDlg, g.szHelpFile, HELP_CONTEXT, IDH_AFSCONFIG_ADVANCED_LOGON);
98 void Logon_OnInitDialog (HWND hDlg)
101 Config_GetLoginRetryInterval(&g.Configuration.nLoginRetryInterval);
102 Config_GetFailLoginsSilently(&g.Configuration.fFailLoginsSilently);
104 nLoginRetryInterval = g.Configuration.nLoginRetryInterval;
105 fFailLoginsSilently = g.Configuration.fFailLoginsSilently;
110 CreateSpinner (GetDlgItem (hDlg, IDC_LOGIN_RETRY_INTERVAL), 10, FALSE, nRETRY_MIN, nLoginRetryInterval, nRETRY_MAX);
112 GetString (szYes, IDS_YES);
113 GetString (szNo, IDS_NO);
115 HWND hCombo = GetDlgItem(hDlg, IDC_FAIL_SILENTLY);
117 // Always add szNo first so it has index 0 and szYes has index 1
118 CB_AddItem (hCombo, szNo, 0);
119 CB_AddItem (hCombo, szYes, 0);
121 CB_SetSelected (hCombo, fFailLoginsSilently);
125 void Logon_OnOK (HWND hDlg)
127 nLoginRetryInterval = SP_GetPos (GetDlgItem (hDlg, IDC_LOGIN_RETRY_INTERVAL));
128 fFailLoginsSilently = CB_GetSelected (GetDlgItem (hDlg, IDC_FAIL_SILENTLY));
130 EndDialog(hDlg, IDOK);
139 if (nLoginRetryInterval != g.Configuration.nLoginRetryInterval) {
140 if (!Config_SetLoginRetryInterval (nLoginRetryInterval))
142 g.Configuration.nLoginRetryInterval = nLoginRetryInterval;
145 if (fFailLoginsSilently != g.Configuration.fFailLoginsSilently) {
146 if (!Config_SetFailLoginsSilently (fFailLoginsSilently))
148 g.Configuration.fFailLoginsSilently = fFailLoginsSilently;
155 void Logon_OnCancel(HWND hDlg)
159 EndDialog(hDlg, IDCANCEL);