From 8da8bda3689beac1b75726a5c45b3042e99c4a5c Mon Sep 17 00:00:00 2001 From: Anthony Purchase Date: Mon, 22 Jan 2018 12:16:05 +0000 Subject: [PATCH] Add setting to control conversion delay --- LarkatorGUI/MainWindow.xaml.cs | 8 ++++++++ LarkatorGUI/Properties/Settings.Designer.cs | 12 ++++++++++++ LarkatorGUI/Properties/Settings.settings | 3 +++ LarkatorGUI/SettingsWindow.xaml | 4 ++++ LarkatorGUI/app.config | 3 +++ 5 files changed, 30 insertions(+) diff --git a/LarkatorGUI/MainWindow.xaml.cs b/LarkatorGUI/MainWindow.xaml.cs index 43c8571..7b36b3e 100644 --- a/LarkatorGUI/MainWindow.xaml.cs +++ b/LarkatorGUI/MainWindow.xaml.cs @@ -142,6 +142,7 @@ public MainWindow() fileWatcher = new FileSystemWatcher(Path.GetDirectoryName(Properties.Settings.Default.SaveFile)); fileWatcher.Renamed += FileWatcher_Changed; fileWatcher.EnableRaisingEvents = true; + reloadTimer.Interval = TimeSpan.FromMilliseconds(Properties.Settings.Default.ConvertDelay); reloadTimer.Tick += ReloadTimer_Tick; // Sort the results @@ -560,7 +561,14 @@ private void Settings_Click(object sender, MouseButtonEventArgs e) var settings = new SettingsWindow(); settings.ShowDialog(); + OnSettingsChanged(); + } + + private void OnSettingsChanged() + { EnsureOutputDirectory(); + + reloadTimer.Interval = TimeSpan.FromMilliseconds(Properties.Settings.Default.ConvertDelay); } } } diff --git a/LarkatorGUI/Properties/Settings.Designer.cs b/LarkatorGUI/Properties/Settings.Designer.cs index 8ee145a..5e9a65c 100644 --- a/LarkatorGUI/Properties/Settings.Designer.cs +++ b/LarkatorGUI/Properties/Settings.Designer.cs @@ -164,5 +164,17 @@ public double MainWindowHeight { this["MainWindowHeight"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("2000")] + public int ConvertDelay { + get { + return ((int)(this["ConvertDelay"])); + } + set { + this["ConvertDelay"] = value; + } + } } } diff --git a/LarkatorGUI/Properties/Settings.settings b/LarkatorGUI/Properties/Settings.settings index b3c282f..1bbcfa2 100644 --- a/LarkatorGUI/Properties/Settings.settings +++ b/LarkatorGUI/Properties/Settings.settings @@ -32,5 +32,8 @@ 800 + + 2000 + \ No newline at end of file diff --git a/LarkatorGUI/SettingsWindow.xaml b/LarkatorGUI/SettingsWindow.xaml index e2f19fc..3ed1d88 100644 --- a/LarkatorGUI/SettingsWindow.xaml +++ b/LarkatorGUI/SettingsWindow.xaml @@ -63,6 +63,10 @@ + Conversion Delay (ms) + diff --git a/LarkatorGUI/app.config b/LarkatorGUI/app.config index 678fbe8..679dbaa 100644 --- a/LarkatorGUI/app.config +++ b/LarkatorGUI/app.config @@ -37,6 +37,9 @@ 800 + + 2000 + \ No newline at end of file