Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.5 KiB

  1. // Copyright (c) 1997-2001 Microsoft Corporation
  2. //
  3. // File: DecisionPage.cpp
  4. //
  5. // Synopsis: Defines Decision Page for the CYS
  6. // Wizard. This page lets the user choose
  7. // between the custom and express paths
  8. //
  9. // History: 02/08/2001 JeffJon Created
  10. #include "pch.h"
  11. #include "resource.h"
  12. #include "InstallationUnitProvider.h"
  13. #include "DecisionPage.h"
  14. #include "state.h"
  15. static PCWSTR DECISION_PAGE_HELP = L"cys.chm::/cys_topnode.htm";
  16. DecisionPage::DecisionPage()
  17. :
  18. CYSWizardPage(IDD_DECISION_PAGE, IDS_DECISION_TITLE, IDS_DECISION_SUBTITLE, DECISION_PAGE_HELP)
  19. {
  20. LOG_CTOR(DecisionPage);
  21. }
  22. DecisionPage::~DecisionPage()
  23. {
  24. LOG_DTOR(DecisionPage);
  25. }
  26. void
  27. DecisionPage::OnInit()
  28. {
  29. LOG_FUNCTION(DecisionPage::OnInit);
  30. String text = String::load(IDS_DECISION_PAGE_TEXT);
  31. Win::SetWindowText(Win::GetDlgItem(hwnd, IDC_DESC_STATIC), text);
  32. Win::Button_SetCheck(Win::GetDlgItem(hwnd, IDC_EXPRESS_RADIO), BST_CHECKED);
  33. }
  34. bool
  35. DecisionPage::OnSetActive()
  36. {
  37. LOG_FUNCTION(DecisionPage::OnSetActive);
  38. Win::PropSheet_SetWizButtons(
  39. Win::GetParent(hwnd),
  40. PSWIZB_NEXT | PSWIZB_BACK);
  41. return true;
  42. }
  43. int
  44. DecisionPage::Validate()
  45. {
  46. LOG_FUNCTION(DecisionPage::Validate);
  47. int nextPage = -1;
  48. if (Win::Button_GetCheck(Win::GetDlgItem(hwnd, IDC_EXPRESS_RADIO)))
  49. {
  50. nextPage = IDD_AD_DOMAIN_NAME_PAGE;
  51. InstallationUnitProvider::GetInstance().SetCurrentInstallationUnit(EXPRESS_INSTALL);
  52. // Make sure all the delegated installation units know we are in the
  53. // express path
  54. InstallationUnitProvider::GetInstance().GetDHCPInstallationUnit().SetExpressPathInstall(true);
  55. InstallationUnitProvider::GetInstance().GetDNSInstallationUnit().SetExpressPathInstall(true);
  56. InstallationUnitProvider::GetInstance().GetADInstallationUnit().SetExpressPathInstall(true);
  57. }
  58. else if (Win::Button_GetCheck(Win::GetDlgItem(hwnd, IDC_CUSTOM_RADIO)))
  59. {
  60. // Make sure all the delegated installation units know we are no longer
  61. // in the express path (if we once were)
  62. InstallationUnitProvider::GetInstance().GetDHCPInstallationUnit().SetExpressPathInstall(false);
  63. InstallationUnitProvider::GetInstance().GetDNSInstallationUnit().SetExpressPathInstall(false);
  64. InstallationUnitProvider::GetInstance().GetADInstallationUnit().SetExpressPathInstall(false);
  65. nextPage = IDD_CUSTOM_SERVER_PAGE;
  66. }
  67. else
  68. {
  69. ASSERT(false);
  70. }
  71. LOG(String::format(
  72. L"nextPage = %1!d!",
  73. nextPage));
  74. return nextPage;
  75. }