diff --git a/src/managed/OpenLiveWriter.BlogClient/Clients/StaticSite/StaticSiteConfig.cs b/src/managed/OpenLiveWriter.BlogClient/Clients/StaticSite/StaticSiteConfig.cs index a06fc7f1..5f0f4145 100644 --- a/src/managed/OpenLiveWriter.BlogClient/Clients/StaticSite/StaticSiteConfig.cs +++ b/src/managed/OpenLiveWriter.BlogClient/Clients/StaticSite/StaticSiteConfig.cs @@ -26,6 +26,8 @@ namespace OpenLiveWriter.BlogClient.Clients.StaticSite private const string CONFIG_CMD_TIMEOUT_MS = "SSGCmdTimeoutMs"; private const string CONFIG_INITIALISED = "SSGInitialised"; + public static int DEFAULT_CMD_TIMEOUT = 60000; + // Public Site Url is stored in the blog's BlogConfig. Loading is handled in this class, but saving is handled from the WizardController. // This is done to avoid referencing PostEditor from this project. @@ -114,9 +116,9 @@ namespace OpenLiveWriter.BlogClient.Clients.StaticSite public bool ShowCmdWindows { get; set; } = false; /// - /// Timeout for commands. Default is 30k MS (30 seconds). + /// Timeout for commands. Default is 60k MS (60 seconds). /// - public int CmdTimeoutMs { get; set; } = 60000; + public int CmdTimeoutMs { get; set; } = DEFAULT_CMD_TIMEOUT; /// /// Used to determine if parameter detection has occurred, default false. diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/BuildPublishPanel.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/BuildPublishPanel.cs index 3acdefd5..8df954ee 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/BuildPublishPanel.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/BuildPublishPanel.cs @@ -17,6 +17,7 @@ using OpenLiveWriter.BlogClient; using OpenLiveWriter.PostEditor; using OpenLiveWriter.ApplicationFramework.Preferences; using OpenLiveWriter.PostEditor.Configuration.Wizard; +using OpenLiveWriter.BlogClient.Clients.StaticSite; namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced { @@ -62,6 +63,61 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced protected override void OnLoad(EventArgs e) { base.OnLoad(e); + RecomputeEnabledStates(); + } + + public bool ShowCmdWindows + { + get => checkBoxShowCommandWindows.Checked; + set => checkBoxShowCommandWindows.Checked = value; + } + + public int CmdTimeoutMs + { + get + { + if (checkBoxEnableCmdTimeout.Checked) + return Convert.ToInt32(numericUpDownCmdTimeout.Value); + + return StaticSiteConfig.DEFAULT_CMD_TIMEOUT; + } + + set + { + if (value >= 0) + { + checkBoxEnableCmdTimeout.Checked = true; + numericUpDownCmdTimeout.Value = value; + } + else + checkBoxEnableCmdTimeout.Checked = false; + + RecomputeEnabledStates(); + } + } + + public bool BuildingEnabled + { + get => checkBoxBuildingEnabled.Checked; + set => checkBoxBuildingEnabled.Checked = value; + } + + public string BuildCommand + { + get => textBoxBuildCommand.Text; + set => textBoxBuildCommand.Text = value; + } + + public string OutputPath + { + get => textBoxOutputPath.Text; + set => textBoxOutputPath.Text = value; + } + + public string PublishCommand + { + get => textBoxPublishCommand.Text; + set => textBoxPublishCommand.Text = value; } #region Component Designer generated code diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/PreferencesController.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/PreferencesController.cs index 304a0517..32cc6f08 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/PreferencesController.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/PreferencesController.cs @@ -71,25 +71,33 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced return ssgConfig; } - private void LoadFromStaticSiteConfig(StaticSiteConfig ssgConfig) + private void LoadFromStaticSiteConfig(StaticSiteConfig config) { // General - panelGeneral.SiteTitle = ssgConfig.SiteTitle; - panelGeneral.SiteUrl = ssgConfig.SiteUrl; - panelGeneral.LocalSitePath = ssgConfig.LocalSitePath; + panelGeneral.SiteTitle = config.SiteTitle; + panelGeneral.SiteUrl = config.SiteUrl; + panelGeneral.LocalSitePath = config.LocalSitePath; // Authoring - panelAuthoring.PostsPath = ssgConfig.PostsPath; - panelAuthoring.DraftsEnabled = ssgConfig.DraftsEnabled; - panelAuthoring.DraftsPath = ssgConfig.DraftsPath; - panelAuthoring.PagesEnabled = ssgConfig.PagesEnabled; - panelAuthoring.PagesPath = ssgConfig.PagesPath; - panelAuthoring.PagesStoredInRoot = ssgConfig.PagesPath == "."; - panelAuthoring.ImagesEnabled = ssgConfig.ImagesEnabled; - panelAuthoring.ImagesPath = ssgConfig.ImagesPath; + panelAuthoring.PostsPath = config.PostsPath; + panelAuthoring.DraftsEnabled = config.DraftsEnabled; + panelAuthoring.DraftsPath = config.DraftsPath; + panelAuthoring.PagesEnabled = config.PagesEnabled; + panelAuthoring.PagesPath = config.PagesPath; + panelAuthoring.PagesStoredInRoot = config.PagesPath == "."; + panelAuthoring.ImagesEnabled = config.ImagesEnabled; + panelAuthoring.ImagesPath = config.ImagesPath; // Front Matter - panelFrontMatter.Keys = ssgConfig.FrontMatterKeys; + panelFrontMatter.Keys = config.FrontMatterKeys; + + // Building and Publishing + panelBuildPublish.ShowCmdWindows = config.ShowCmdWindows; + panelBuildPublish.CmdTimeoutMs = config.CmdTimeoutMs; + panelBuildPublish.BuildingEnabled = config.BuildingEnabled; + panelBuildPublish.BuildCommand = config.BuildCommand; + panelBuildPublish.OutputPath = config.OutputPath; + panelBuildPublish.PublishCommand = config.PublishCommand; } public void GeneralPanel_RunAccountWizard()