From 6087ea40fb68864bf072b07d9c9abaf07e204b0d Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 30 Sep 2016 13:07:48 +0300 Subject: [PATCH] If personal path is modified in application settings window then show message box to tell users that ShareX must be reopened for changes to take effect --- ShareX/Forms/ApplicationSettingsForm.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ShareX/Forms/ApplicationSettingsForm.cs b/ShareX/Forms/ApplicationSettingsForm.cs index bfc1ddea3..d19598cd3 100644 --- a/ShareX/Forms/ApplicationSettingsForm.cs +++ b/ShareX/Forms/ApplicationSettingsForm.cs @@ -38,6 +38,7 @@ public partial class ApplicationSettingsForm : Form private const int MaxBufferSizePower = 14; private bool ready; + private string lastPersonalPath; public ApplicationSettingsForm() { @@ -57,7 +58,14 @@ private void SettingsForm_Resize(object sender, EventArgs e) private void SettingsForm_FormClosed(object sender, FormClosedEventArgs e) { - Program.WritePersonalPathConfig(txtPersonalFolderPath.Text); + string currentPersonalPath = txtPersonalFolderPath.Text; + + if (!currentPersonalPath.Equals(lastPersonalPath, StringComparison.InvariantCultureIgnoreCase)) + { + Program.WritePersonalPathConfig(currentPersonalPath); + + MessageBox.Show("You must reopen ShareX for personal folder changes to take effect.", "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information); + } } private void InitializeControls() @@ -123,7 +131,8 @@ private void UpdateControls() #endif // Paths - txtPersonalFolderPath.Text = Program.ReadPersonalPathConfig(); + lastPersonalPath = Program.ReadPersonalPathConfig(); + txtPersonalFolderPath.Text = lastPersonalPath; UpdatePersonalFolderPathPreview(); cbUseCustomScreenshotsPath.Checked = Program.Settings.UseCustomScreenshotsPath; txtCustomScreenshotsPath.Text = Program.Settings.CustomScreenshotsPath;