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 <afs/param.h>
27 * DEFINITIONS _________________________________________________________________
31 int nOptionButtonSeparationHeight
; // This is used by sys_control_page.cpp
35 * PROTOTYPES _________________________________________________________________
38 static void OnInitDialog(HWND hwndDlg
);
39 static void CantBackup(UINT nMsgID
);
40 static void CalcOptionButtonSeparationHeight();
44 * EXPORTED FUNCTIONS _________________________________________________________________
49 * Dialog Proc _________________________________________________________________
52 BOOL CALLBACK
BackupPageDlgProc(HWND hwndDlg
, UINT msg
, WPARAM wp
, LPARAM lp
)
54 if (WizStep_Common_DlgProc (hwndDlg
, msg
, wp
, lp
))
59 OnInitDialog(hwndDlg
);
65 g_pWiz
->SetState(sidSTEP_EIGHT
);
69 g_pWiz
->SetState(sidSTEP_SIX
);
72 case IDC_DONT_CONFIG_BACKUP_SERVER
:
73 g_CfgData
.configBak
= CS_DONT_CONFIGURE
;
76 case IDC_CONFIG_BACKUP_SERVER
:
77 g_CfgData
.configBak
= CS_CONFIGURE
;
89 * STATIC FUNCTIONS _________________________________________________________________
94 * Event Handler Functions _________________________________________________________________
97 static void OnInitDialog(HWND hwndDlg
)
101 CalcOptionButtonSeparationHeight();
103 g_pWiz
->EnableButtons(BACK_BUTTON
| NEXT_BUTTON
);
104 g_pWiz
->SetButtonText(IDNEXT
, IDS_NEXT
);
105 g_pWiz
->SetDefaultControl(IDNEXT
);
107 if (g_CfgData
.configBak
== CS_ALREADY_CONFIGURED
) {
108 CantBackup(IDS_ALREADY_A_BACKUP_SERVER
);
112 // Should this step be disabled? Yes, if this machine
113 // is not configured as a database server.
114 if (!ConfiguredOrConfiguring(g_CfgData
.configDB
)) {
115 CantBackup(IDS_NOT_A_DB_SERVER
);
116 EnableStep(g_CfgData
.configBak
, FALSE
);
120 // Enable this in case it was disabled the last time
121 EnableStep(g_CfgData
.configBak
);
123 if (g_CfgData
.configBak
== CS_DONT_CONFIGURE
)
124 SetCheck(hDlg
, IDC_DONT_CONFIG_BACKUP_SERVER
);
125 else if (g_CfgData
.configBak
== CS_CONFIGURE
)
126 SetCheck(hDlg
, IDC_CONFIG_BACKUP_SERVER
);
131 * Utility Functions _________________________________________________________________
134 static void CantBackup(UINT nMsgID
)
136 TCHAR szMsg
[cchRESOURCE
];
138 GetString(szMsg
, nMsgID
);
140 ShowWnd(hDlg
, IDC_BACKUP_SERVER_QUESTION
, FALSE
);
141 ShowWnd(hDlg
, IDC_CONFIG_BACKUP_SERVER
, FALSE
);
142 ShowWnd(hDlg
, IDC_DONT_CONFIG_BACKUP_SERVER
, FALSE
);
144 ShowWnd(hDlg
, IDC_CANT_BACKUP_MSG
);
145 SetWndText(hDlg
, IDC_CANT_BACKUP_MSG
, szMsg
);
148 static void CalcOptionButtonSeparationHeight()
150 RECT rectOB1
, rectOB2
;
152 GetWindowRect(GetDlgItem(hDlg
, IDC_CONFIG_BACKUP_SERVER
), &rectOB1
);
153 GetWindowRect(GetDlgItem(hDlg
, IDC_DONT_CONFIG_BACKUP_SERVER
), &rectOB2
);
155 nOptionButtonSeparationHeight
= rectOB2
.top
- rectOB1
.top
;