Leaked source code of windows server 2003
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.

114 lines
2.3 KiB

  1. // Copyright (c) 2001 Microsoft Corporation
  2. //
  3. // File: IndexingPage.cpp
  4. //
  5. // Synopsis: Defines the Indexing page of the CYS wizard
  6. //
  7. // History: 02/09/2001 JeffJon Created
  8. #include "pch.h"
  9. #include "resource.h"
  10. #include "InstallationUnitProvider.h"
  11. #include "IndexingPage.h"
  12. static PCWSTR INDEXING_PAGE_HELP = L"cys.chm::/file_server_role.htm#filesrvindexing";
  13. IndexingPage::IndexingPage()
  14. :
  15. CYSWizardPage(
  16. IDD_INDEXING_PAGE,
  17. IDS_INDEXING_TITLE,
  18. IDS_INDEXING_SUBTITLE,
  19. INDEXING_PAGE_HELP)
  20. {
  21. LOG_CTOR(IndexingPage);
  22. }
  23. IndexingPage::~IndexingPage()
  24. {
  25. LOG_DTOR(IndexingPage);
  26. }
  27. void
  28. IndexingPage::OnInit()
  29. {
  30. LOG_FUNCTION(IndexingPage::OnInit);
  31. CYSWizardPage::OnInit();
  32. String staticText = String::load(IDS_INDEX_PAGE_STATIC_SERVERED);
  33. IndexingInstallationUnit& indexingInstallationUnit =
  34. InstallationUnitProvider::GetInstance().GetIndexingInstallationUnit();
  35. if (!indexingInstallationUnit.IsServiceOn())
  36. {
  37. // The text is changed if the indexing service is off
  38. String yesRadioText = String::load(IDS_INDEXING_SERVICE_OFF_YES_RADIO);
  39. String noRadioText = String::load(IDS_INDEXING_SERVICE_OFF_NO_RADIO);
  40. staticText = String::load(IDS_INDEX_PAGE_STATIC_NOT_SERVERED);
  41. Win::SetWindowText(
  42. Win::GetDlgItem(hwnd, IDC_YES_RADIO),
  43. yesRadioText);
  44. Win::SetWindowText(
  45. Win::GetDlgItem(hwnd, IDC_NO_RADIO),
  46. noRadioText);
  47. }
  48. Win::SetWindowText(
  49. Win::GetDlgItem(hwnd, IDC_INDEX_STATIC),
  50. staticText);
  51. // No is always the default button
  52. Win::Button_SetCheck(GetDlgItem(hwnd, IDC_NO_RADIO), BST_CHECKED);
  53. }
  54. bool
  55. IndexingPage::OnSetActive()
  56. {
  57. LOG_FUNCTION(IndexingPage::OnSetActive);
  58. Win::PropSheet_SetWizButtons(
  59. Win::GetParent(hwnd),
  60. PSWIZB_NEXT | PSWIZB_BACK);
  61. return true;
  62. }
  63. int
  64. IndexingPage::Validate()
  65. {
  66. LOG_FUNCTION(IndexingPage::Validate);
  67. int nextPage = -1;
  68. InstallationUnitProvider::GetInstance().GetFileInstallationUnit().SetInstallIndexingService(
  69. Win::Button_GetCheck(
  70. Win::GetDlgItem(hwnd, IDC_YES_RADIO)));
  71. nextPage = IDD_MILESTONE_PAGE;
  72. LOG(String::format(
  73. L"nextPage = %1!d!",
  74. nextPage));
  75. return nextPage;
  76. }