From cfc8143d6d00f0e9cfbd3e35f215f03a10fd0f8a Mon Sep 17 00:00:00 2001 From: Nick Vella Date: Fri, 5 Jul 2019 22:10:16 +1000 Subject: [PATCH] ssg: WizardController: integrate Paths2 panel --- .../WeblogConfigurationWizardController.cs | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardController.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardController.cs index 9d208308..c34e743b 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardController.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/Wizard/WeblogConfigurationWizardController.cs @@ -534,22 +534,13 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard addWizardSubStep( new WizardSubStep(new WeblogConfigurationWizardPanelStaticSitePaths1(), null, - new DisplayCallback(OnStaticSitePaths1Displayed), + new DisplayCallback(OnStaticSiteConfigProviderDisplayed), new VerifyStepCallback(OnValidatePanel), new NextCallback(OnStaticSitePaths1Completed), null, new BackCallback(OnStaticSiteBack))); } - private void OnStaticSitePaths1Displayed(Object stepControl) - { - // Populate data - var panel = (stepControl as WeblogConfigurationWizardPanelStaticSitePaths1); - - // Load panel values from config - panel.LoadFromConfig(staticSiteConfig); - } - private void OnStaticSitePaths1Completed(Object stepControl) { var panel = (stepControl as WeblogConfigurationWizardPanelStaticSitePaths1); @@ -557,6 +548,29 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard // Save panel values into config panel.SaveToConfig(staticSiteConfig); + // Go to next step + AddStaticSitePaths2SubStep(); + } + + private void AddStaticSitePaths2SubStep() + { + addWizardSubStep( + new WizardSubStep(new WeblogConfigurationWizardPanelStaticSitePaths2(), + null, + new DisplayCallback(OnStaticSiteConfigProviderDisplayed), + new VerifyStepCallback(OnValidatePanel), + new NextCallback(OnStaticSitePaths2Completed), + null, + new BackCallback(OnStaticSiteBack))); + } + + private void OnStaticSitePaths2Completed(Object stepControl) + { + var panel = (stepControl as WeblogConfigurationWizardPanelStaticSitePaths2); + + // Save panel values into config + panel.SaveToConfig(staticSiteConfig); + // Go to next step PerformStaticSiteWizardCompletion(); } @@ -583,6 +597,15 @@ namespace OpenLiveWriter.PostEditor.Configuration.Wizard staticSiteConfig.SaveToCredentials(_temporarySettings.Credentials); } + private void OnStaticSiteConfigProviderDisplayed(Object stepControl) + { + // Populate data + var panel = (stepControl as IWizardPanelStaticSiteConfigProvider); + + // Load panel values from config + panel.LoadFromConfig(staticSiteConfig); + } + #endregion #region Weblog and Settings Auto Detection