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 _________________________________________________________________
34 * PROTOTYPES _________________________________________________________________
37 static void OnInitDialog(HWND hwndDlg
);
38 static void ShowStatusMsg(UINT nMsgID
);
42 * EXPORTED FUNCTIONS _________________________________________________________________
47 * Dialog Proc _________________________________________________________________
50 BOOL CALLBACK
ReplicationPageDlgProc(HWND hwndDlg
, UINT msg
, WPARAM wp
, LPARAM lp
)
52 if (WizStep_Common_DlgProc (hwndDlg
, msg
, wp
, lp
))
57 OnInitDialog(hwndDlg
);
63 g_pWiz
->SetState(sidSTEP_ELEVEN
);
67 g_pWiz
->SetState(sidSTEP_NINE
);
70 case IDC_DONT_REPLICATE
:
71 g_CfgData
.configRep
= CS_DONT_CONFIGURE
;
75 g_CfgData
.configRep
= CS_CONFIGURE
;
88 * STATIC FUNCTIONS _________________________________________________________________
93 * Event Handler Functions _________________________________________________________________
96 static void OnInitDialog(HWND hwndDlg
)
100 g_pWiz
->EnableButtons(BACK_BUTTON
| NEXT_BUTTON
);
101 g_pWiz
->SetButtonText(IDNEXT
, IDS_NEXT
);
102 g_pWiz
->SetDefaultControl(IDNEXT
);
104 if (g_CfgData
.bFirstServer
) {
105 ShowStatusMsg(IDS_MUST_REPLICATE
);
106 g_CfgData
.configRep
= CS_CONFIGURE
;
110 if (g_CfgData
.configRep
== CS_ALREADY_CONFIGURED
) {
111 ShowStatusMsg(IDS_ALREADY_REPLICATED
);
115 // If the replication of the root volumes could not be determined, we'll
116 // ask the user if they want to create them if they don't already exist.
117 if (!g_CfgData
.bRootVolumesReplicationKnown
) {
118 SetWndText(hDlg
, IDC_REPLICATE_QUESTION
, IDS_REP_ROOT_VOLUMES_IF_NECESSARY_PROMPT
);
119 g_CfgData
.configRep
= CS_CONFIGURE
;
120 SetCheck(hDlg
, IDC_REPLICATE
);
124 // Should this step be disabled? Yes, if this machine does
125 // not have a root.afs volume.
126 if (!ConfiguredOrConfiguring(g_CfgData
.configRootVolumes
)) {
127 ShowStatusMsg(IDS_ROOT_AFS_DOESNT_EXIST
);
128 EnableStep(g_CfgData
.configRep
, FALSE
);
132 // Must do this in case it was disabled on the last run through
133 EnableStep(g_CfgData
.configRep
);
135 if (g_CfgData
.configRep
== CS_DONT_CONFIGURE
)
136 SetCheck(hDlg
, IDC_DONT_REPLICATE
);
137 else if (g_CfgData
.configRep
== CS_CONFIGURE
)
138 SetCheck(hDlg
, IDC_REPLICATE
);
143 * Utility Functions _________________________________________________________________
146 static void ShowStatusMsg(UINT nMsgID
)
148 TCHAR szMsg
[cchRESOURCE
];
150 GetString(szMsg
, nMsgID
);
152 ShowWnd(hDlg
, IDC_REPLICATE_QUESTION
, FALSE
);
153 ShowWnd(hDlg
, IDC_REPLICATE
, FALSE
);
154 ShowWnd(hDlg
, IDC_DONT_REPLICATE
, FALSE
);
156 ShowWnd(hDlg
, IDC_CANT_REPLICATE_MSG
);
157 SetWndText(hDlg
, IDC_CANT_REPLICATE_MSG
, szMsg
);