Skip to content

Commit

Permalink
Add Reset settings button
Browse files Browse the repository at this point in the history
Fixes #253
  • Loading branch information
TheJoeFin committed Jan 21, 2023
1 parent cbf75c7 commit e4a57ce
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Text-Grab/Views/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,17 @@
Try to read barcodes (Disabling may speed up results)
</TextBlock>
</CheckBox>

<TextBlock Margin="0,12,0,0" Style="{StaticResource TextBodyNormal}">
Reset All settings to default settings.
</TextBlock>
<controls:CollapsibleButton
x:Name="ResetSettingsButton"
HorizontalAlignment="Left"
Background="DarkRed"
ButtonText="Reset All Settings"
Click="ResetSettingsButton_Click"
SymbolText="" />
</StackPanel>
<StackPanel
Grid.Row="1"
Expand Down
11 changes: 11 additions & 0 deletions Text-Grab/Views/SettingsWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -336,5 +336,16 @@ private bool HotKeysAllDifferent()

return true;
}

private void ResetSettingsButton_Click(object sender, RoutedEventArgs e)
{
MessageBoxResult areYouSure = MessageBox.Show("Are you sure you want to reset all settings to default?", "Reset Settings to Default", MessageBoxButton.YesNo);

if (areYouSure != MessageBoxResult.Yes)
return;

Settings.Default.Reset();
this.Close();
}
}

0 comments on commit e4a57ce

Please sign in to comment.