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 _________________________________________________________________
18 #include <afsconfig.h>
19 #include <afs/param.h>
29 * DEFINITIONS _________________________________________________________________
33 int nOptionButtonSeparationHeight; // This is used by sys_control_page.cpp
37 * PROTOTYPES _________________________________________________________________
40 static void OnInitDialog(HWND hwndDlg);
41 static void CantBackup(UINT nMsgID);
42 static void CalcOptionButtonSeparationHeight();
46 * EXPORTED FUNCTIONS _________________________________________________________________
51 * Dialog Proc _________________________________________________________________
54 BOOL CALLBACK BackupPageDlgProc(HWND hwndDlg, UINT msg, WPARAM wp, LPARAM lp)
56 if (WizStep_Common_DlgProc (hwndDlg, msg, wp, lp))
61 OnInitDialog(hwndDlg);
67 g_pWiz->SetState(sidSTEP_EIGHT);
71 g_pWiz->SetState(sidSTEP_SIX);
74 case IDC_DONT_CONFIG_BACKUP_SERVER:
75 g_CfgData.configBak = CS_DONT_CONFIGURE;
78 case IDC_CONFIG_BACKUP_SERVER:
79 g_CfgData.configBak = CS_CONFIGURE;
91 * STATIC FUNCTIONS _________________________________________________________________
96 * Event Handler Functions _________________________________________________________________
99 static void OnInitDialog(HWND hwndDlg)
103 CalcOptionButtonSeparationHeight();
105 g_pWiz->EnableButtons(BACK_BUTTON | NEXT_BUTTON);
106 g_pWiz->SetButtonText(IDNEXT, IDS_NEXT);
107 g_pWiz->SetDefaultControl(IDNEXT);
109 if (g_CfgData.configBak == CS_ALREADY_CONFIGURED) {
110 CantBackup(IDS_ALREADY_A_BACKUP_SERVER);
114 // Should this step be disabled? Yes, if this machine
115 // is not configured as a database server.
116 if (!ConfiguredOrConfiguring(g_CfgData.configDB)) {
117 CantBackup(IDS_NOT_A_DB_SERVER);
118 EnableStep(g_CfgData.configBak, FALSE);
122 // Enable this in case it was disabled the last time
123 EnableStep(g_CfgData.configBak);
125 if (g_CfgData.configBak == CS_DONT_CONFIGURE)
126 SetCheck(hDlg, IDC_DONT_CONFIG_BACKUP_SERVER);
127 else if (g_CfgData.configBak == CS_CONFIGURE)
128 SetCheck(hDlg, IDC_CONFIG_BACKUP_SERVER);
133 * Utility Functions _________________________________________________________________
136 static void CantBackup(UINT nMsgID)
138 TCHAR szMsg[cchRESOURCE];
140 GetString(szMsg, nMsgID);
142 ShowWnd(hDlg, IDC_BACKUP_SERVER_QUESTION, FALSE);
143 ShowWnd(hDlg, IDC_CONFIG_BACKUP_SERVER, FALSE);
144 ShowWnd(hDlg, IDC_DONT_CONFIG_BACKUP_SERVER, FALSE);
146 ShowWnd(hDlg, IDC_CANT_BACKUP_MSG);
147 SetWndText(hDlg, IDC_CANT_BACKUP_MSG, szMsg);
150 static void CalcOptionButtonSeparationHeight()
152 RECT rectOB1, rectOB2;
154 GetWindowRect(GetDlgItem(hDlg, IDC_CONFIG_BACKUP_SERVER), &rectOB1);
155 GetWindowRect(GetDlgItem(hDlg, IDC_DONT_CONFIG_BACKUP_SERVER), &rectOB2);
157 nOptionButtonSeparationHeight = rectOB2.top - rectOB1.top;