From 01e7e63abed83840ed6a481331526ce089b4aaa5 Mon Sep 17 00:00:00 2001 From: Nick Vella Date: Wed, 24 Jul 2019 22:52:38 +1000 Subject: [PATCH] ssg: advanced settings General panel: select folder button for local site path --- .../StaticSiteAdvanced/GeneralPanel.cs | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/GeneralPanel.cs b/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/GeneralPanel.cs index 57ab3f91..84db51e2 100644 --- a/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/GeneralPanel.cs +++ b/src/managed/OpenLiveWriter.PostEditor/Configuration/StaticSiteAdvanced/GeneralPanel.cs @@ -37,6 +37,8 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced private Button buttonRunAutoDetect; private Label labelRunWizardAgain; private Label labelSiteUrl; + private Button buttonBrowseLocalSitePath; + /// /// Required designer variable. /// @@ -111,12 +113,14 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced this.labelAutoDetect = new System.Windows.Forms.Label(); this.buttonRunAutoDetect = new System.Windows.Forms.Button(); this.labelRunWizardAgain = new System.Windows.Forms.Label(); + this.buttonBrowseLocalSitePath = new System.Windows.Forms.Button(); this.groupBoxSetup.SuspendLayout(); this.groupBoxOptions.SuspendLayout(); this.SuspendLayout(); // // groupBoxSetup // + this.groupBoxSetup.Controls.Add(this.buttonBrowseLocalSitePath); this.groupBoxSetup.Controls.Add(this.textBoxLocalSitePath); this.groupBoxSetup.Controls.Add(this.labelLocalSitePath); this.groupBoxSetup.Controls.Add(this.textBoxSiteUrl); @@ -135,7 +139,7 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced // this.textBoxLocalSitePath.Location = new System.Drawing.Point(16, 126); this.textBoxLocalSitePath.Name = "textBoxLocalSitePath"; - this.textBoxLocalSitePath.Size = new System.Drawing.Size(316, 23); + this.textBoxLocalSitePath.Size = new System.Drawing.Size(286, 23); this.textBoxLocalSitePath.TabIndex = 5; // // labelLocalSitePath @@ -231,6 +235,16 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced this.labelRunWizardAgain.TabIndex = 11; this.labelRunWizardAgain.Text = "You can chose to run the Account Wizard again if you wish to be guided through th" + "e core static site configuration options interactively."; + // + // buttonBrowseLocalSitePath + // + this.buttonBrowseLocalSitePath.Location = new System.Drawing.Point(308, 125); + this.buttonBrowseLocalSitePath.Name = "buttonBrowseLocalSitePath"; + this.buttonBrowseLocalSitePath.Size = new System.Drawing.Size(24, 24); + this.buttonBrowseLocalSitePath.TabIndex = 6; + this.buttonBrowseLocalSitePath.Text = "..."; + this.buttonBrowseLocalSitePath.UseVisualStyleBackColor = true; + this.buttonBrowseLocalSitePath.Click += new System.EventHandler(this.ButtonBrowseLocalSitePath_Click); // // GeneralPanel // @@ -255,5 +269,18 @@ namespace OpenLiveWriter.PostEditor.Configuration.StaticSiteAdvanced private void ButtonRunAutoDetect_Click(object sender, EventArgs e) => _controller.GeneralPanel_RunAutoDetect(); + + private void ButtonBrowseLocalSitePath_Click(object sender, EventArgs e) + { + var folderBrowserDialog = new FolderBrowserDialog(); + folderBrowserDialog.ShowNewFolderButton = false; + folderBrowserDialog.Description = Res.Get(StringId.CWStaticSiteLocalSiteFolderPicker); + var result = folderBrowserDialog.ShowDialog(); + + if (result == DialogResult.OK) + { + textBoxLocalSitePath.Text = folderBrowserDialog.SelectedPath; + } + } } }