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 * INCLUDES _________________________________________________________________
15 #include <afs/param.h>
24 * DEFINITIONS _________________________________________________________________
28 int nOptionButtonSeparationHeight; // This is used by sys_control_page.cpp
32 * PROTOTYPES _________________________________________________________________
35 static void OnInitDialog(HWND hwndDlg);
36 static void CantBackup(UINT nMsgID);
37 static void CalcOptionButtonSeparationHeight();
41 * EXPORTED FUNCTIONS _________________________________________________________________
46 * Dialog Proc _________________________________________________________________
49 BOOL CALLBACK BackupPageDlgProc(HWND hwndDlg, UINT msg, WPARAM wp, LPARAM lp)
51 if (WizStep_Common_DlgProc (hwndDlg, msg, wp, lp))
56 OnInitDialog(hwndDlg);
62 g_pWiz->SetState(sidSTEP_EIGHT);
66 g_pWiz->SetState(sidSTEP_SIX);
69 case IDC_DONT_CONFIG_BACKUP_SERVER:
70 g_CfgData.configBak = CS_DONT_CONFIGURE;
73 case IDC_CONFIG_BACKUP_SERVER:
74 g_CfgData.configBak = CS_CONFIGURE;
86 * STATIC FUNCTIONS _________________________________________________________________
91 * Event Handler Functions _________________________________________________________________
94 static void OnInitDialog(HWND hwndDlg)
98 CalcOptionButtonSeparationHeight();
100 g_pWiz->EnableButtons(BACK_BUTTON | NEXT_BUTTON);
101 g_pWiz->SetButtonText(IDNEXT, IDS_NEXT);
102 g_pWiz->SetDefaultControl(IDNEXT);
104 if (g_CfgData.configBak == CS_ALREADY_CONFIGURED) {
105 CantBackup(IDS_ALREADY_A_BACKUP_SERVER);
109 // Should this step be disabled? Yes, if this machine
110 // is not configured as a database server.
111 if (!ConfiguredOrConfiguring(g_CfgData.configDB)) {
112 CantBackup(IDS_NOT_A_DB_SERVER);
113 EnableStep(g_CfgData.configBak, FALSE);
117 // Enable this in case it was disabled the last time
118 EnableStep(g_CfgData.configBak);
120 if (g_CfgData.configBak == CS_DONT_CONFIGURE)
121 SetCheck(hDlg, IDC_DONT_CONFIG_BACKUP_SERVER);
122 else if (g_CfgData.configBak == CS_CONFIGURE)
123 SetCheck(hDlg, IDC_CONFIG_BACKUP_SERVER);
128 * Utility Functions _________________________________________________________________
131 static void CantBackup(UINT nMsgID)
133 TCHAR szMsg[cchRESOURCE];
135 GetString(szMsg, nMsgID);
137 ShowWnd(hDlg, IDC_BACKUP_SERVER_QUESTION, FALSE);
138 ShowWnd(hDlg, IDC_CONFIG_BACKUP_SERVER, FALSE);
139 ShowWnd(hDlg, IDC_DONT_CONFIG_BACKUP_SERVER, FALSE);
141 ShowWnd(hDlg, IDC_CANT_BACKUP_MSG);
142 SetWndText(hDlg, IDC_CANT_BACKUP_MSG, szMsg);
145 static void CalcOptionButtonSeparationHeight()
147 RECT rectOB1, rectOB2;
149 GetWindowRect(GetDlgItem(hDlg, IDC_CONFIG_BACKUP_SERVER), &rectOB1);
150 GetWindowRect(GetDlgItem(hDlg, IDC_DONT_CONFIG_BACKUP_SERVER), &rectOB2);
152 nOptionButtonSeparationHeight = rectOB2.top - rectOB1.top;