ssg: advanced config BuildPublishPanel: attributes, loading
This commit is contained in:
parent
506e9a3638
commit
e8af31e41c
|
@ -26,6 +26,8 @@ namespace OpenLiveWriter.BlogClient.Clients.StaticSite
|
||||||
private const string CONFIG_CMD_TIMEOUT_MS = "SSGCmdTimeoutMs";
|
private const string CONFIG_CMD_TIMEOUT_MS = "SSGCmdTimeoutMs";
|
||||||
private const string CONFIG_INITIALISED = "SSGInitialised";
|
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.
|
// 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.
|
// 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;
|
public bool ShowCmdWindows { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Timeout for commands. Default is 30k MS (30 seconds).
|
/// Timeout for commands. Default is 60k MS (60 seconds).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int CmdTimeoutMs { get; set; } = 60000;
|
public int CmdTimeoutMs { get; set; } = DEFAULT_CMD_TIMEOUT;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Used to determine if parameter detection has occurred, default false.
|
/// Used to determine if parameter detection has occurred, default false.
|
||||||
|
|
|
@ -17,6 +17,7 @@ using OpenLiveWriter.BlogClient;
|
||||||
using OpenLiveWriter.PostEditor;
|
using OpenLiveWriter.PostEditor;
|
||||||
using OpenLiveWriter.ApplicationFramework.Preferences;
|
using OpenLiveWriter.ApplicationFramework.Preferences;
|
||||||
using OpenLiveWriter.PostEditor.Configuration.Wizard;
|
using OpenLiveWriter.PostEditor.Configuration.Wizard;
|
||||||
|
using OpenLiveWriter.BlogClient.Clients.StaticSite;
|
||||||
|
|
||||||
namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced
|
namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced
|
||||||
{
|
{
|
||||||
|
@ -62,6 +63,61 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced
|
||||||
protected override void OnLoad(EventArgs e)
|
protected override void OnLoad(EventArgs e)
|
||||||
{
|
{
|
||||||
base.OnLoad(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
|
#region Component Designer generated code
|
||||||
|
|
|
@ -71,25 +71,33 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced
|
||||||
return ssgConfig;
|
return ssgConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LoadFromStaticSiteConfig(StaticSiteConfig ssgConfig)
|
private void LoadFromStaticSiteConfig(StaticSiteConfig config)
|
||||||
{
|
{
|
||||||
// General
|
// General
|
||||||
panelGeneral.SiteTitle = ssgConfig.SiteTitle;
|
panelGeneral.SiteTitle = config.SiteTitle;
|
||||||
panelGeneral.SiteUrl = ssgConfig.SiteUrl;
|
panelGeneral.SiteUrl = config.SiteUrl;
|
||||||
panelGeneral.LocalSitePath = ssgConfig.LocalSitePath;
|
panelGeneral.LocalSitePath = config.LocalSitePath;
|
||||||
|
|
||||||
// Authoring
|
// Authoring
|
||||||
panelAuthoring.PostsPath = ssgConfig.PostsPath;
|
panelAuthoring.PostsPath = config.PostsPath;
|
||||||
panelAuthoring.DraftsEnabled = ssgConfig.DraftsEnabled;
|
panelAuthoring.DraftsEnabled = config.DraftsEnabled;
|
||||||
panelAuthoring.DraftsPath = ssgConfig.DraftsPath;
|
panelAuthoring.DraftsPath = config.DraftsPath;
|
||||||
panelAuthoring.PagesEnabled = ssgConfig.PagesEnabled;
|
panelAuthoring.PagesEnabled = config.PagesEnabled;
|
||||||
panelAuthoring.PagesPath = ssgConfig.PagesPath;
|
panelAuthoring.PagesPath = config.PagesPath;
|
||||||
panelAuthoring.PagesStoredInRoot = ssgConfig.PagesPath == ".";
|
panelAuthoring.PagesStoredInRoot = config.PagesPath == ".";
|
||||||
panelAuthoring.ImagesEnabled = ssgConfig.ImagesEnabled;
|
panelAuthoring.ImagesEnabled = config.ImagesEnabled;
|
||||||
panelAuthoring.ImagesPath = ssgConfig.ImagesPath;
|
panelAuthoring.ImagesPath = config.ImagesPath;
|
||||||
|
|
||||||
// Front Matter
|
// 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()
|
public void GeneralPanel_RunAccountWizard()
|
||||||
|
|
Loading…
Reference in New Issue