Skip to content

Commit

Permalink
Add setting to control conversion delay
Browse files Browse the repository at this point in the history
  • Loading branch information
coldino committed Jan 22, 2018
1 parent 3ecceef commit 8da8bda
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
8 changes: 8 additions & 0 deletions LarkatorGUI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
}
}
12 changes: 12 additions & 0 deletions LarkatorGUI/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions LarkatorGUI/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
<Setting Name="MainWindowHeight" Type="System.Double" Scope="User">
<Value Profile="(Default)">800</Value>
</Setting>
<Setting Name="ConvertDelay" Type="System.Int32" Scope="User">
<Value Profile="(Default)">2000</Value>
</Setting>
</Settings>
</SettingsFile>
4 changes: 4 additions & 0 deletions LarkatorGUI/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
<local:NumericEntryControl Grid.Row="1" Grid.Column="1" ToolTip="The step between levels, typically 4 for 120 or 5 for 150 (only affects filter adjustments)"
Value="{Binding Source={StaticResource Model}, Path=Settings.LevelStep, Mode=TwoWay}" MaxWidth="90" HorizontalAlignment="Right"
MaxValue="100" MinValue="1" Increment="1" LargeIncrement="1"/>
<TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,4,0">Conversion Delay (ms)</TextBlock>
<local:NumericEntryControl Grid.Row="2" Grid.Column="1" ToolTip="The delay between detecting a change to the saved ark and running the conversion process (in milliseconds)"
Value="{Binding Source={StaticResource Model}, Path=Settings.ConvertDelay, Mode=TwoWay}" MaxWidth="110" HorizontalAlignment="Right"
MaxValue="10000" MinValue="200" Increment="100" LargeIncrement="500"/>
</Grid>
</TabItem>
</TabControl>
Expand Down
3 changes: 3 additions & 0 deletions LarkatorGUI/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
<setting name="MainWindowHeight" serializeAs="String">
<value>800</value>
</setting>
<setting name="ConvertDelay" serializeAs="String">
<value>2000</value>
</setting>
</LarkatorGUI.Properties.Settings>
</userSettings>
</configuration>

0 comments on commit 8da8bda

Please sign in to comment.