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 _________________________________________________________________
31 * PROTOTYPES _________________________________________________________________
34 static void OnInitDialog(HWND hwndDlg);
35 static void ShowStatusMsg(UINT nMsgID);
39 * EXPORTED FUNCTIONS _________________________________________________________________
44 * Dialog Proc _________________________________________________________________
47 BOOL CALLBACK ReplicationPageDlgProc(HWND hwndDlg, UINT msg, WPARAM wp, LPARAM lp)
49 if (WizStep_Common_DlgProc (hwndDlg, msg, wp, lp))
54 OnInitDialog(hwndDlg);
60 g_pWiz->SetState(sidSTEP_ELEVEN);
64 g_pWiz->SetState(sidSTEP_NINE);
67 case IDC_DONT_REPLICATE:
68 g_CfgData.configRep = CS_DONT_CONFIGURE;
72 g_CfgData.configRep = CS_CONFIGURE;
85 * STATIC FUNCTIONS _________________________________________________________________
90 * Event Handler Functions _________________________________________________________________
93 static void OnInitDialog(HWND hwndDlg)
97 g_pWiz->EnableButtons(BACK_BUTTON | NEXT_BUTTON);
98 g_pWiz->SetButtonText(IDNEXT, IDS_NEXT);
99 g_pWiz->SetDefaultControl(IDNEXT);
101 if (g_CfgData.bFirstServer) {
102 ShowStatusMsg(IDS_MUST_REPLICATE);
103 g_CfgData.configRep = CS_CONFIGURE;
107 if (g_CfgData.configRep == CS_ALREADY_CONFIGURED) {
108 ShowStatusMsg(IDS_ALREADY_REPLICATED);
112 // If the replication of the root volumes could not be determined, we'll
113 // ask the user if they want to create them if they don't already exist.
114 if (!g_CfgData.bRootVolumesReplicationKnown) {
115 SetWndText(hDlg, IDC_REPLICATE_QUESTION, IDS_REP_ROOT_VOLUMES_IF_NECESSARY_PROMPT);
116 g_CfgData.configRep = CS_CONFIGURE;
117 SetCheck(hDlg, IDC_REPLICATE);
121 // Should this step be disabled? Yes, if this machine does
122 // not have a root.afs volume.
123 if (!ConfiguredOrConfiguring(g_CfgData.configRootVolumes)) {
124 ShowStatusMsg(IDS_ROOT_AFS_DOESNT_EXIST);
125 EnableStep(g_CfgData.configRep, FALSE);
129 // Must do this in case it was disabled on the last run through
130 EnableStep(g_CfgData.configRep);
132 if (g_CfgData.configRep == CS_DONT_CONFIGURE)
133 SetCheck(hDlg, IDC_DONT_REPLICATE);
134 else if (g_CfgData.configRep == CS_CONFIGURE)
135 SetCheck(hDlg, IDC_REPLICATE);
140 * Utility Functions _________________________________________________________________
143 static void ShowStatusMsg(UINT nMsgID)
145 TCHAR szMsg[cchRESOURCE];
147 GetString(szMsg, nMsgID);
149 ShowWnd(hDlg, IDC_REPLICATE_QUESTION, FALSE);
150 ShowWnd(hDlg, IDC_REPLICATE, FALSE);
151 ShowWnd(hDlg, IDC_DONT_REPLICATE, FALSE);
153 ShowWnd(hDlg, IDC_CANT_REPLICATE_MSG);
154 SetWndText(hDlg, IDC_CANT_REPLICATE_MSG, szMsg);