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.

106 lines
2.0 KiB

  1. // Copyright (c) 1997-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. #include "state.h"
  13. static PCWSTR INDEXING_PAGE_HELP = L"cys.chm::/cys_configuring_file_server.htm";
  14. IndexingPage::IndexingPage()
  15. :
  16. CYSWizardPage(
  17. IDD_INDEXING_PAGE,
  18. IDS_INDEXING_TITLE,
  19. IDS_INDEXING_SUBTITLE,
  20. INDEXING_PAGE_HELP)
  21. {
  22. LOG_CTOR(IndexingPage);
  23. }
  24. IndexingPage::~IndexingPage()
  25. {
  26. LOG_DTOR(IndexingPage);
  27. }
  28. void
  29. IndexingPage::OnInit()
  30. {
  31. LOG_FUNCTION(IndexingPage::OnInit);
  32. String staticText = String::load(IDS_INDEX_PAGE_STATIC_INSTALLED);
  33. if (!IsIndexingServiceOn())
  34. {
  35. // The text is changed if the indexing service is off
  36. String yesRadioText = String::load(IDS_INDEXING_SERVICE_OFF_YES_RADIO);
  37. String noRadioText = String::load(IDS_INDEXING_SERVICE_OFF_NO_RADIO);
  38. staticText = String::load(IDS_INDEX_PAGE_STATIC_NOT_INSTALLED);
  39. Win::SetWindowText(
  40. Win::GetDlgItem(hwnd, IDC_YES_RADIO),
  41. yesRadioText);
  42. Win::SetWindowText(
  43. Win::GetDlgItem(hwnd, IDC_NO_RADIO),
  44. noRadioText);
  45. }
  46. Win::SetWindowText(
  47. Win::GetDlgItem(hwnd, IDC_INDEX_STATIC),
  48. staticText);
  49. // No is always the default button
  50. Win::Button_SetCheck(GetDlgItem(hwnd, IDC_NO_RADIO), BST_CHECKED);
  51. }
  52. bool
  53. IndexingPage::OnSetActive()
  54. {
  55. LOG_FUNCTION(IndexingPage::OnSetActive);
  56. Win::PropSheet_SetWizButtons(
  57. Win::GetParent(hwnd),
  58. PSWIZB_NEXT | PSWIZB_BACK);
  59. return true;
  60. }
  61. int
  62. IndexingPage::Validate()
  63. {
  64. LOG_FUNCTION(IndexingPage::Validate);
  65. int nextPage = -1;
  66. InstallationUnitProvider::GetInstance().GetFileInstallationUnit().SetInstallIndexingService(
  67. Win::Button_GetCheck(
  68. Win::GetDlgItem(hwnd, IDC_YES_RADIO)));
  69. nextPage = IDD_FINISH_PAGE;
  70. return nextPage;
  71. }