From 109cbae4df09e57fb1c475c807b8e60ac2ba17a3 Mon Sep 17 00:00:00 2001
From: Scrub <72096833+ScrubN@users.noreply.github.com>
Date: Tue, 28 Nov 2023 19:39:49 -0500
Subject: [PATCH] Add Save/Cancel/Reset buttons to settings window (#902)
* Regenerate WPF settings files with VS2022
* Add reset, save, and cancel buttons to settings window
* Use translations
* Use translations for buttons
* Update margin
* Minor nitpicks
* Fix typo
* Update some default settings
---
TwitchDownloaderWPF/App.config | 25 +--
.../Properties/Settings.Designer.cs | 6 +-
.../Properties/Settings.settings | 6 +-
.../Translations/Strings.Designer.cs | 63 +++++++
.../Translations/Strings.es.resx | 21 +++
.../Translations/Strings.fr.resx | 21 +++
.../Translations/Strings.pl.resx | 21 +++
TwitchDownloaderWPF/Translations/Strings.resx | 21 +++
.../Translations/Strings.ru.resx | 21 +++
.../Translations/Strings.tr.resx | 21 +++
.../Translations/Strings.uk.resx | 21 +++
.../Translations/Strings.zh.resx | 21 +++
TwitchDownloaderWPF/WindowSettings.xaml | 46 +++--
TwitchDownloaderWPF/WindowSettings.xaml.cs | 178 ++++++++++++++----
14 files changed, 409 insertions(+), 83 deletions(-)
diff --git a/TwitchDownloaderWPF/App.config b/TwitchDownloaderWPF/App.config
index 1493b5c6..c8f358de 100644
--- a/TwitchDownloaderWPF/App.config
+++ b/TwitchDownloaderWPF/App.config
@@ -5,32 +5,13 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
4
- Arial
+ Inter Embedded
24
@@ -48,7 +29,7 @@
700
- 0.5
+ 0.2
True
@@ -216,7 +197,7 @@
1
- False
+ True
en-US
diff --git a/TwitchDownloaderWPF/Properties/Settings.Designer.cs b/TwitchDownloaderWPF/Properties/Settings.Designer.cs
index 66d5e122..0cda5f22 100644
--- a/TwitchDownloaderWPF/Properties/Settings.Designer.cs
+++ b/TwitchDownloaderWPF/Properties/Settings.Designer.cs
@@ -36,7 +36,7 @@ public int VodDownloadThreads {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("Arial")]
+ [global::System.Configuration.DefaultSettingValueAttribute("Inter Embedded")]
public string Font {
get {
return ((string)(this["Font"]));
@@ -108,7 +108,7 @@ public int Width {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0.5")]
+ [global::System.Configuration.DefaultSettingValueAttribute("0.1")]
public double UpdateTime {
get {
return ((double)(this["UpdateTime"]));
@@ -780,7 +780,7 @@ public double AccentIndentScale {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool DisperseCommentOffsets {
get {
return ((bool)(this["DisperseCommentOffsets"]));
diff --git a/TwitchDownloaderWPF/Properties/Settings.settings b/TwitchDownloaderWPF/Properties/Settings.settings
index 39ca35c0..42c4492d 100644
--- a/TwitchDownloaderWPF/Properties/Settings.settings
+++ b/TwitchDownloaderWPF/Properties/Settings.settings
@@ -6,7 +6,7 @@
4
- Arial
+ Inter Embedded
24
@@ -24,7 +24,7 @@
700
- 0.5
+ 0.1
True
@@ -192,7 +192,7 @@
1
- False
+ True
en-US
diff --git a/TwitchDownloaderWPF/Translations/Strings.Designer.cs b/TwitchDownloaderWPF/Translations/Strings.Designer.cs
index e41a9ea0..029c7994 100644
--- a/TwitchDownloaderWPF/Translations/Strings.Designer.cs
+++ b/TwitchDownloaderWPF/Translations/Strings.Designer.cs
@@ -212,6 +212,33 @@ public static string BttvEmotes {
}
}
+ ///
+ /// Looks up a localized string similar to Cancel.
+ ///
+ public static string ButtonCancelSettingsChanges {
+ get {
+ return ResourceManager.GetString("ButtonCancelSettingsChanges", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Restore Defaults.
+ ///
+ public static string ButtonRestoreDefaultSettings {
+ get {
+ return ResourceManager.GetString("ButtonRestoreDefaultSettings", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Save.
+ ///
+ public static string ButtonSaveSettings {
+ get {
+ return ResourceManager.GetString("ButtonSaveSettings", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Cache Folder:.
///
@@ -1301,6 +1328,33 @@ public static string ReplaceEmbedsTooltip {
}
}
+ ///
+ /// Looks up a localized string similar to Restore Settings Confirmation.
+ ///
+ public static string ResetSettingsConfirmation {
+ get {
+ return ResourceManager.GetString("ResetSettingsConfirmation", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to reset all settings to their default values?.
+ ///
+ public static string ResetSettingsConfirmationMessage {
+ get {
+ return ResourceManager.GetString("ResetSettingsConfirmationMessage", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Please restart {0}.
+ ///
+ public static string RestartTheApplication {
+ get {
+ return ResourceManager.GetString("RestartTheApplication", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Search Clips.
///
@@ -1553,6 +1607,15 @@ public static string TemplateVods {
}
}
+ ///
+ /// Looks up a localized string similar to The application must be restarted for changes to take effect..
+ ///
+ public static string TheApplicationMustBeRestartedMessage {
+ get {
+ return ResourceManager.GetString("TheApplicationMustBeRestartedMessage", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Theme not found.
///
diff --git a/TwitchDownloaderWPF/Translations/Strings.es.resx b/TwitchDownloaderWPF/Translations/Strings.es.resx
index d40389e1..568f48d1 100644
--- a/TwitchDownloaderWPF/Translations/Strings.es.resx
+++ b/TwitchDownloaderWPF/Translations/Strings.es.resx
@@ -787,4 +787,25 @@
Open in browser
+
+ Are you sure you want to reset all settings to their default values?
+
+
+ Restore Settings Confirmation
+
+
+ The application must be restarted for changes to take effect.
+
+
+ Please restart {0}{0} is the name of the application.
+
+
+ Restore Defaults
+
+
+ Save
+
+
+ Cancel
+
\ No newline at end of file
diff --git a/TwitchDownloaderWPF/Translations/Strings.fr.resx b/TwitchDownloaderWPF/Translations/Strings.fr.resx
index a416e24e..45f8f118 100644
--- a/TwitchDownloaderWPF/Translations/Strings.fr.resx
+++ b/TwitchDownloaderWPF/Translations/Strings.fr.resx
@@ -786,4 +786,25 @@
Ouvrir dans un navigateur web
+
+ Are you sure you want to reset all settings to their default values?
+
+
+ Restore Settings Confirmation
+
+
+ The application must be restarted for changes to take effect.
+
+
+ Please restart {0}{0} is the name of the application.
+
+
+ Restore Defaults
+
+
+ Save
+
+
+ Cancel
+
\ No newline at end of file
diff --git a/TwitchDownloaderWPF/Translations/Strings.pl.resx b/TwitchDownloaderWPF/Translations/Strings.pl.resx
index 858d3e5d..4f9dc0eb 100644
--- a/TwitchDownloaderWPF/Translations/Strings.pl.resx
+++ b/TwitchDownloaderWPF/Translations/Strings.pl.resx
@@ -786,4 +786,25 @@
Open in browser
+
+ Are you sure you want to reset all settings to their default values?
+
+
+ Restore Settings Confirmation
+
+
+ The application must be restarted for changes to take effect.
+
+
+ Please restart {0}{0} is the name of the application.
+
+
+ Restore Defaults
+
+
+ Save
+
+
+ Cancel
+
\ No newline at end of file
diff --git a/TwitchDownloaderWPF/Translations/Strings.resx b/TwitchDownloaderWPF/Translations/Strings.resx
index 709896f7..1a02f8dd 100644
--- a/TwitchDownloaderWPF/Translations/Strings.resx
+++ b/TwitchDownloaderWPF/Translations/Strings.resx
@@ -785,4 +785,25 @@
Open in browser
+
+ Are you sure you want to reset all settings to their default values?
+
+
+ Restore Settings Confirmation
+
+
+ The application must be restarted for changes to take effect.
+
+
+ Please restart {0}{0} is the name of the application.
+
+
+ Restore Defaults
+
+
+ Save
+
+
+ Cancel
+
\ No newline at end of file
diff --git a/TwitchDownloaderWPF/Translations/Strings.ru.resx b/TwitchDownloaderWPF/Translations/Strings.ru.resx
index a627640d..8ed83776 100644
--- a/TwitchDownloaderWPF/Translations/Strings.ru.resx
+++ b/TwitchDownloaderWPF/Translations/Strings.ru.resx
@@ -786,4 +786,25 @@
Open in browser
+
+ Are you sure you want to reset all settings to their default values?
+
+
+ Restore Settings Confirmation
+
+
+ The application must be restarted for changes to take effect.
+
+
+ Please restart {0}{0} is the name of the application.
+
+
+ Restore Defaults
+
+
+ Save
+
+
+ Cancel
+
\ No newline at end of file
diff --git a/TwitchDownloaderWPF/Translations/Strings.tr.resx b/TwitchDownloaderWPF/Translations/Strings.tr.resx
index a2b08a71..dc891514 100644
--- a/TwitchDownloaderWPF/Translations/Strings.tr.resx
+++ b/TwitchDownloaderWPF/Translations/Strings.tr.resx
@@ -787,4 +787,25 @@
Open in browser
+
+ Are you sure you want to reset all settings to their default values?
+
+
+ Restore Settings Confirmation
+
+
+ The application must be restarted for changes to take effect.
+
+
+ Please restart {0}{0} is the name of the application.
+
+
+ Restore Defaults
+
+
+ Save
+
+
+ Cancel
+
\ No newline at end of file
diff --git a/TwitchDownloaderWPF/Translations/Strings.uk.resx b/TwitchDownloaderWPF/Translations/Strings.uk.resx
index d7bce07f..b5da2fec 100644
--- a/TwitchDownloaderWPF/Translations/Strings.uk.resx
+++ b/TwitchDownloaderWPF/Translations/Strings.uk.resx
@@ -786,4 +786,25 @@
Open in browser
+
+ Are you sure you want to reset all settings to their default values?
+
+
+ Restore Settings Confirmation
+
+
+ The application must be restarted for changes to take effect.
+
+
+ Please restart {0}{0} is the name of the application.
+
+
+ Restore Defaults
+
+
+ Save
+
+
+ Cancel
+
\ No newline at end of file
diff --git a/TwitchDownloaderWPF/Translations/Strings.zh.resx b/TwitchDownloaderWPF/Translations/Strings.zh.resx
index fe1a87c8..f21e381d 100644
--- a/TwitchDownloaderWPF/Translations/Strings.zh.resx
+++ b/TwitchDownloaderWPF/Translations/Strings.zh.resx
@@ -785,4 +785,25 @@
Open in browser
+
+ Are you sure you want to reset all settings to their default values?
+
+
+ Restore Settings Confirmation
+
+
+ The application must be restarted for changes to take effect.
+
+
+ Please restart {0}{0} is the name of the application.
+
+
+ Restore Defaults
+
+
+ Save
+
+
+ Cancel
+
\ No newline at end of file
diff --git a/TwitchDownloaderWPF/WindowSettings.xaml b/TwitchDownloaderWPF/WindowSettings.xaml
index fb18ece7..67b9c24a 100644
--- a/TwitchDownloaderWPF/WindowSettings.xaml
+++ b/TwitchDownloaderWPF/WindowSettings.xaml
@@ -12,7 +12,7 @@
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:fa="http://schemas.fontawesome.com/icons/"
mc:Ignorable="d"
- Title="Global Settings" MinWidth="400" MinHeight="460" Width="500" Height="547" Initialized="Window_Initialized" Closing="Window_Closing">
+ Title="Global Settings" MinWidth="400" MinHeight="500" Width="500" Height="592" Initialized="Window_Initialized" Closing="Window_Closing" Loaded="Window_Loaded">