From 95fb51845d39a1bd58068680a31b30aaa0129d1a Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:39:02 -0400 Subject: [PATCH 01/14] Allow clicking template parameters to insert into template text boxes --- .../Extensions/TextBoxExtensions.cs | 26 +++++++++++ TwitchDownloaderWPF/WindowSettings.xaml | 43 ++++++++++++++++++- TwitchDownloaderWPF/WindowSettings.xaml.cs | 32 ++++++++++++++ 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 TwitchDownloaderWPF/Extensions/TextBoxExtensions.cs diff --git a/TwitchDownloaderWPF/Extensions/TextBoxExtensions.cs b/TwitchDownloaderWPF/Extensions/TextBoxExtensions.cs new file mode 100644 index 00000000..664e7efc --- /dev/null +++ b/TwitchDownloaderWPF/Extensions/TextBoxExtensions.cs @@ -0,0 +1,26 @@ +using System.Diagnostics.CodeAnalysis; +using System.Windows.Controls; + +namespace TwitchDownloaderWPF.Extensions +{ + public static class TextBoxExtensions + { + public static bool TryInsertAtCaret([AllowNull] this TextBox textBox, string textToInsert) + { + if (textBox is null || string.IsNullOrEmpty(textToInsert)) + { + return false; + } + + var caretPos = textBox.CaretIndex; + if (caretPos < 0) + { + return false; + } + + textBox.Text = textBox.Text.Insert(caretPos, textToInsert); + textBox.CaretIndex = caretPos + textToInsert.Length; + return true; + } + } +} \ No newline at end of file diff --git a/TwitchDownloaderWPF/WindowSettings.xaml b/TwitchDownloaderWPF/WindowSettings.xaml index 1306345f..888bf5a7 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml +++ b/TwitchDownloaderWPF/WindowSettings.xaml @@ -86,7 +86,48 @@ - + + {title} + + + {id} + + + {date} + + + {channel} + + + {date_custom=""} + + + {random_string} + + + {trim_start} + + + {trim_end} + + + {trim_start_custom=""} + + + {trim_end_custom=""} + + + {length} + + + {length_custom=""} + + + {views} + + + {game} + diff --git a/TwitchDownloaderWPF/WindowSettings.xaml.cs b/TwitchDownloaderWPF/WindowSettings.xaml.cs index 6cfc8ecf..0a715269 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml.cs +++ b/TwitchDownloaderWPF/WindowSettings.xaml.cs @@ -1,10 +1,14 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Windows; using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; using HandyControl.Data; +using TwitchDownloaderWPF.Extensions; using TwitchDownloaderWPF.Models; using TwitchDownloaderWPF.Properties; using TwitchDownloaderWPF.Services; @@ -322,5 +326,33 @@ private void ComboLogLevels_OnSelectionChanged(object sender, SelectionChangedEv .Sum(item => (int)item.Tag); Settings.Default.LogLevels = newLogLevel; } + + private void FileNameParameter_MouseDown(object sender, MouseButtonEventArgs e) + { + if (!IsInitialized || sender is not Run { Text: var parameter }) + return; + + var focusedElement = Keyboard.FocusedElement; + var textBox = GetTemplateTextBox(focusedElement); + if (textBox.TryInsertAtCaret(parameter)) + { + e.Handled = true; + } + } + + [return: MaybeNull] + private TextBox GetTemplateTextBox(IInputElement inputElement) + { + if (ReferenceEquals(inputElement, TextVodTemplate)) + return TextVodTemplate; + + if (ReferenceEquals(inputElement, TextClipTemplate)) + return TextClipTemplate; + + if (ReferenceEquals(inputElement, TextChatTemplate)) + return TextChatTemplate; + + return null; + } } } From 4f48b2c08f6d922be91622655cbab36117b2dfe2 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 19:40:48 -0400 Subject: [PATCH 02/14] Replace text selection if present --- TwitchDownloaderWPF/Extensions/TextBoxExtensions.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TwitchDownloaderWPF/Extensions/TextBoxExtensions.cs b/TwitchDownloaderWPF/Extensions/TextBoxExtensions.cs index 664e7efc..152bab62 100644 --- a/TwitchDownloaderWPF/Extensions/TextBoxExtensions.cs +++ b/TwitchDownloaderWPF/Extensions/TextBoxExtensions.cs @@ -18,6 +18,11 @@ public static bool TryInsertAtCaret([AllowNull] this TextBox textBox, string tex return false; } + if (textBox.IsSelectionActive) + { + textBox.Text = textBox.Text.Remove(caretPos, textBox.SelectionLength); + } + textBox.Text = textBox.Text.Insert(caretPos, textToInsert); textBox.CaretIndex = caretPos + textToInsert.Length; return true; From 37007b006102d4ac46b85bd95c6af3fec6c1878e Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:13:40 -0400 Subject: [PATCH 03/14] Remove FilenameTemplateParameters translation --- TwitchDownloaderWPF/Translations/Strings.Designer.cs | 9 --------- TwitchDownloaderWPF/Translations/Strings.es.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.fr.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.it.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.ja.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.pl.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.pt-br.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.ru.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.tr.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.uk.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.zh-cn.resx | 4 ---- 12 files changed, 53 deletions(-) diff --git a/TwitchDownloaderWPF/Translations/Strings.Designer.cs b/TwitchDownloaderWPF/Translations/Strings.Designer.cs index 636cddb2..d41fec0a 100644 --- a/TwitchDownloaderWPF/Translations/Strings.Designer.cs +++ b/TwitchDownloaderWPF/Translations/Strings.Designer.cs @@ -977,15 +977,6 @@ public static string FileAlreadyExistsRenameDescription { } } - /// - /// Looks up a localized string similar to {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game}. - /// - public static string FilenameTemplateParameters { - get { - return ResourceManager.GetString("FilenameTemplateParameters", resourceCulture); - } - } - /// /// Looks up a localized string similar to File Not Found: . /// diff --git a/TwitchDownloaderWPF/Translations/Strings.es.resx b/TwitchDownloaderWPF/Translations/Strings.es.resx index b3fa70f2..506f5a66 100644 --- a/TwitchDownloaderWPF/Translations/Strings.es.resx +++ b/TwitchDownloaderWPF/Translations/Strings.es.resx @@ -297,10 +297,6 @@ Emotes FFZ: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - No traducir - Color letra: diff --git a/TwitchDownloaderWPF/Translations/Strings.fr.resx b/TwitchDownloaderWPF/Translations/Strings.fr.resx index 756abdc0..09f33608 100644 --- a/TwitchDownloaderWPF/Translations/Strings.fr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.fr.resx @@ -297,10 +297,6 @@ Emoticônes FFZ: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Do not translate - Couleur de la police: diff --git a/TwitchDownloaderWPF/Translations/Strings.it.resx b/TwitchDownloaderWPF/Translations/Strings.it.resx index 6895f1ff..08e8c824 100644 --- a/TwitchDownloaderWPF/Translations/Strings.it.resx +++ b/TwitchDownloaderWPF/Translations/Strings.it.resx @@ -297,10 +297,6 @@ Emotes FFZ: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Non tradurre - Colore del font: diff --git a/TwitchDownloaderWPF/Translations/Strings.ja.resx b/TwitchDownloaderWPF/Translations/Strings.ja.resx index 56df0a40..71b41477 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ja.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ja.resx @@ -297,10 +297,6 @@ FFZ スタンプ: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Do not translate - フォントカラー: diff --git a/TwitchDownloaderWPF/Translations/Strings.pl.resx b/TwitchDownloaderWPF/Translations/Strings.pl.resx index 4de9dfa3..1c7134ee 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pl.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pl.resx @@ -297,10 +297,6 @@ Emotki FFZ: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Do not translate - Kolor Czcionki: diff --git a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx index e13a9000..0dab9221 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx @@ -297,10 +297,6 @@ Emotes do FFZ: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Não traduza - Cor da Fonte: diff --git a/TwitchDownloaderWPF/Translations/Strings.resx b/TwitchDownloaderWPF/Translations/Strings.resx index 765e5982..8e9f76d9 100644 --- a/TwitchDownloaderWPF/Translations/Strings.resx +++ b/TwitchDownloaderWPF/Translations/Strings.resx @@ -297,10 +297,6 @@ FFZ Emotes: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Do not translate - Font Color: diff --git a/TwitchDownloaderWPF/Translations/Strings.ru.resx b/TwitchDownloaderWPF/Translations/Strings.ru.resx index d5e04d12..5b215198 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ru.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ru.resx @@ -297,10 +297,6 @@ FFZ Эмодзи: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Do not translate - Цвет шрифта: diff --git a/TwitchDownloaderWPF/Translations/Strings.tr.resx b/TwitchDownloaderWPF/Translations/Strings.tr.resx index 9bdb7792..622d9a29 100644 --- a/TwitchDownloaderWPF/Translations/Strings.tr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.tr.resx @@ -298,10 +298,6 @@ FFZ Emojileri: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Do not translate - Font Rengi: diff --git a/TwitchDownloaderWPF/Translations/Strings.uk.resx b/TwitchDownloaderWPF/Translations/Strings.uk.resx index e9572367..6ff0f288 100644 --- a/TwitchDownloaderWPF/Translations/Strings.uk.resx +++ b/TwitchDownloaderWPF/Translations/Strings.uk.resx @@ -297,10 +297,6 @@ FFZ смайлики: - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Do not translate - Колір шрифту: diff --git a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx index 5d6530d1..acf35aa7 100644 --- a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx +++ b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx @@ -297,10 +297,6 @@ FFZ 表情(Emote): - - {title} {id} {date} {channel} {date_custom=""} {random_string} {trim_start} {trim_end} {trim_start_custom=""} {trim_end_custom=""} {length} {length_custom=""} {views} {game} - Do not translate - 字体颜色: From 3cdf80c42a47eb26815f25dca29f28d23ba74dc1 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:14:38 -0400 Subject: [PATCH 04/14] Remove redundant style --- TwitchDownloaderWPF/WindowSettings.xaml | 28 ++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/TwitchDownloaderWPF/WindowSettings.xaml b/TwitchDownloaderWPF/WindowSettings.xaml index 888bf5a7..f308b6ed 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml +++ b/TwitchDownloaderWPF/WindowSettings.xaml @@ -86,46 +86,46 @@ - + {title} - + {id} - + {date} - + {channel} - + {date_custom=""} - + {random_string} - + {trim_start} - + {trim_end} - + {trim_start_custom=""} - + {trim_end_custom=""} - + {length} - + {length_custom=""} - + {views} - + {game} From ee626a45508b225d2d9115d8a22da6eea0a466bd Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:38:11 -0400 Subject: [PATCH 05/14] Allow clicking ffmpeg templates --- TwitchDownloaderWPF/PageChatRender.xaml | 19 ++++++++++-- TwitchDownloaderWPF/PageChatRender.xaml.cs | 34 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/TwitchDownloaderWPF/PageChatRender.xaml b/TwitchDownloaderWPF/PageChatRender.xaml index 0e74fc1c..0f975709 100644 --- a/TwitchDownloaderWPF/PageChatRender.xaml +++ b/TwitchDownloaderWPF/PageChatRender.xaml @@ -193,8 +193,23 @@ - - + + + + {fps} + + + {height} + + + {width} + + + {max_int} + + + {save_path} + diff --git a/TwitchDownloaderWPF/PageChatRender.xaml.cs b/TwitchDownloaderWPF/PageChatRender.xaml.cs index 3beb9adb..de31fa85 100644 --- a/TwitchDownloaderWPF/PageChatRender.xaml.cs +++ b/TwitchDownloaderWPF/PageChatRender.xaml.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; @@ -12,17 +13,21 @@ using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; using System.Windows.Media.Imaging; using System.Windows.Navigation; using TwitchDownloaderCore; using TwitchDownloaderCore.Chat; using TwitchDownloaderCore.Options; using TwitchDownloaderCore.TwitchObjects; +using TwitchDownloaderWPF.Extensions; using TwitchDownloaderWPF.Models; using TwitchDownloaderWPF.Properties; using TwitchDownloaderWPF.Utils; using WpfAnimatedGif; using MessageBox = System.Windows.MessageBox; +using TextBox = System.Windows.Controls.TextBox; namespace TwitchDownloaderWPF { @@ -741,6 +746,35 @@ private void TextJson_TextChanged(object sender, TextChangedEventArgs e) FileNames = textJson.Text.Split("&&", StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries); UpdateActionButtons(false); } + + private void FfmpegParameter_MouseDown(object sender, MouseButtonEventArgs e) + { + if (!IsInitialized || sender is not Run { Text: var parameter }) + return; + + var focusedElement = Keyboard.FocusedElement; + var textBox = GetFfmpegTemplateTextBox(focusedElement); + + if (textBox is null) + return; + + if (textBox.TryInsertAtCaret(parameter)) + { + e.Handled = true; + } + } + + [return: MaybeNull] + private TextBox GetFfmpegTemplateTextBox(IInputElement inputElement) + { + if (ReferenceEquals(inputElement, textFfmpegInput)) + return textFfmpegInput; + + if (ReferenceEquals(inputElement, textFfmpegOutput)) + return textFfmpegOutput; + + return null; + } } public class VideoContainer From 3d1ddc1aa83d608ba3c3333a694cc961fe76314c Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:40:27 -0400 Subject: [PATCH 06/14] Remove FfmpegParameters translation --- TwitchDownloaderWPF/Translations/Strings.Designer.cs | 9 --------- TwitchDownloaderWPF/Translations/Strings.es.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.fr.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.it.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.ja.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.pl.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.ru.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.tr.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.uk.resx | 4 ---- TwitchDownloaderWPF/Translations/Strings.zh-cn.resx | 4 ---- 11 files changed, 49 deletions(-) diff --git a/TwitchDownloaderWPF/Translations/Strings.Designer.cs b/TwitchDownloaderWPF/Translations/Strings.Designer.cs index d41fec0a..5cc92661 100644 --- a/TwitchDownloaderWPF/Translations/Strings.Designer.cs +++ b/TwitchDownloaderWPF/Translations/Strings.Designer.cs @@ -851,15 +851,6 @@ public static string FfmpegOutputArguments { } } - /// - /// Looks up a localized string similar to {fps} {height} {width} {max_int} {save_path}. - /// - public static string FfmpegParameters { - get { - return ResourceManager.GetString("FfmpegParameters", resourceCulture); - } - } - /// /// Looks up a localized string similar to Reset To Defaults. /// diff --git a/TwitchDownloaderWPF/Translations/Strings.es.resx b/TwitchDownloaderWPF/Translations/Strings.es.resx index 506f5a66..19003eda 100644 --- a/TwitchDownloaderWPF/Translations/Strings.es.resx +++ b/TwitchDownloaderWPF/Translations/Strings.es.resx @@ -287,10 +287,6 @@ Argumentos de salida: - - {fps} {height} {width} {max_int} {save_path} - No traducir - Restablecer valores por defecto diff --git a/TwitchDownloaderWPF/Translations/Strings.fr.resx b/TwitchDownloaderWPF/Translations/Strings.fr.resx index 09f33608..99c6699b 100644 --- a/TwitchDownloaderWPF/Translations/Strings.fr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.fr.resx @@ -287,10 +287,6 @@ Output Arguments: - - {fps} {height} {width} {max_int} {save_path} - Do not translate - Réinitialiser diff --git a/TwitchDownloaderWPF/Translations/Strings.it.resx b/TwitchDownloaderWPF/Translations/Strings.it.resx index 08e8c824..095a6b97 100644 --- a/TwitchDownloaderWPF/Translations/Strings.it.resx +++ b/TwitchDownloaderWPF/Translations/Strings.it.resx @@ -287,10 +287,6 @@ Argomenti di uscita: - - {fps} {height} {width} {max_int} {save_path} - Non tradurre - Ripristina i valori di default diff --git a/TwitchDownloaderWPF/Translations/Strings.ja.resx b/TwitchDownloaderWPF/Translations/Strings.ja.resx index 71b41477..3dcf91fb 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ja.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ja.resx @@ -287,10 +287,6 @@ 出力引数: - - {fps} {height} {width} {max_int} {save_path} - Do not translate - デフォルトにリセット diff --git a/TwitchDownloaderWPF/Translations/Strings.pl.resx b/TwitchDownloaderWPF/Translations/Strings.pl.resx index 1c7134ee..07bd2ace 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pl.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pl.resx @@ -287,10 +287,6 @@ Argumenty Wejścia: - - {fps} {height} {width} {max_int} {save_path} - Do not translate - Przywróć Domyślne diff --git a/TwitchDownloaderWPF/Translations/Strings.resx b/TwitchDownloaderWPF/Translations/Strings.resx index 8e9f76d9..b3b9c9b5 100644 --- a/TwitchDownloaderWPF/Translations/Strings.resx +++ b/TwitchDownloaderWPF/Translations/Strings.resx @@ -287,10 +287,6 @@ Output Arguments: - - {fps} {height} {width} {max_int} {save_path} - Do not translate - Reset To Defaults diff --git a/TwitchDownloaderWPF/Translations/Strings.ru.resx b/TwitchDownloaderWPF/Translations/Strings.ru.resx index 5b215198..7a2ff6c1 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ru.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ru.resx @@ -287,10 +287,6 @@ Output Arguments: - - {fps} {height} {width} {max_int} {save_path} - Do not translate - Сбросить diff --git a/TwitchDownloaderWPF/Translations/Strings.tr.resx b/TwitchDownloaderWPF/Translations/Strings.tr.resx index 622d9a29..82985475 100644 --- a/TwitchDownloaderWPF/Translations/Strings.tr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.tr.resx @@ -288,10 +288,6 @@ Çıktı Argümanları: - - {fps} {height} {width} {max_int} {save_path} - Do not translate - Varsayılanlara dön diff --git a/TwitchDownloaderWPF/Translations/Strings.uk.resx b/TwitchDownloaderWPF/Translations/Strings.uk.resx index 6ff0f288..45e819ac 100644 --- a/TwitchDownloaderWPF/Translations/Strings.uk.resx +++ b/TwitchDownloaderWPF/Translations/Strings.uk.resx @@ -287,10 +287,6 @@ Вихідні аргументи: - - {fps} {height} {width} {max_int} {save_path} - Do not translate - Скинути до типових diff --git a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx index acf35aa7..6f13246e 100644 --- a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx +++ b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx @@ -287,10 +287,6 @@ 输出参数: - - {fps} {height} {width} {max_int} {save_path} - Do not translate - 重置为默认值 From 93e1fd3ebd387e92d9ba649ba8c6e36f284f0036 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:39:23 -0400 Subject: [PATCH 07/14] Return early if null --- TwitchDownloaderWPF/WindowSettings.xaml.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TwitchDownloaderWPF/WindowSettings.xaml.cs b/TwitchDownloaderWPF/WindowSettings.xaml.cs index 0a715269..4c735718 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml.cs +++ b/TwitchDownloaderWPF/WindowSettings.xaml.cs @@ -334,6 +334,10 @@ private void FileNameParameter_MouseDown(object sender, MouseButtonEventArgs e) var focusedElement = Keyboard.FocusedElement; var textBox = GetTemplateTextBox(focusedElement); + + if (textBox is null) + return; + if (textBox.TryInsertAtCaret(parameter)) { e.Handled = true; From 2e345f73a1c5495b796bbe0f36e163e44654bbb6 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:39:56 -0400 Subject: [PATCH 08/14] Add missing initialization check --- TwitchDownloaderWPF/PageChatRender.xaml.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/TwitchDownloaderWPF/PageChatRender.xaml.cs b/TwitchDownloaderWPF/PageChatRender.xaml.cs index de31fa85..e117e8be 100644 --- a/TwitchDownloaderWPF/PageChatRender.xaml.cs +++ b/TwitchDownloaderWPF/PageChatRender.xaml.cs @@ -743,6 +743,9 @@ private void MenuItemPartialRender_Click(object sender, RoutedEventArgs e) private void TextJson_TextChanged(object sender, TextChangedEventArgs e) { + if (!IsInitialized) + return; + FileNames = textJson.Text.Split("&&", StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries); UpdateActionButtons(false); } From 3f7fc35037b9004101a997487b30602d3c2c58da Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 22:04:21 -0400 Subject: [PATCH 09/14] Reorder date_custom --- TwitchDownloaderWPF/WindowSettings.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TwitchDownloaderWPF/WindowSettings.xaml b/TwitchDownloaderWPF/WindowSettings.xaml index f308b6ed..2bc7382a 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml +++ b/TwitchDownloaderWPF/WindowSettings.xaml @@ -96,10 +96,10 @@ {date} - {channel} + {date_custom=""} - {date_custom=""} + {channel} {random_string} From b7e7258866adf72c1bbf82423430a4eb0953098d Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 22:05:31 -0400 Subject: [PATCH 10/14] Reorder trim_start_custom --- TwitchDownloaderWPF/WindowSettings.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TwitchDownloaderWPF/WindowSettings.xaml b/TwitchDownloaderWPF/WindowSettings.xaml index 2bc7382a..eba68b30 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml +++ b/TwitchDownloaderWPF/WindowSettings.xaml @@ -108,10 +108,10 @@ {trim_start} - {trim_end} + {trim_start_custom=""} - {trim_start_custom=""} + {trim_end} {trim_end_custom=""} From 8ebe73ddb811736421c86d83e2a24593c61af1c1 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 22:12:08 -0400 Subject: [PATCH 11/14] Add tooltips to filename parameters --- .../Translations/Strings.Designer.cs | 126 ++++++++++++++++++ .../Translations/Strings.es.resx | 42 ++++++ .../Translations/Strings.fr.resx | 42 ++++++ .../Translations/Strings.it.resx | 42 ++++++ .../Translations/Strings.ja.resx | 42 ++++++ .../Translations/Strings.pl.resx | 42 ++++++ .../Translations/Strings.pt-br.resx | 42 ++++++ TwitchDownloaderWPF/Translations/Strings.resx | 42 ++++++ .../Translations/Strings.ru.resx | 42 ++++++ .../Translations/Strings.tr.resx | 42 ++++++ .../Translations/Strings.uk.resx | 42 ++++++ .../Translations/Strings.zh-cn.resx | 42 ++++++ TwitchDownloaderWPF/WindowSettings.xaml | 28 ++-- 13 files changed, 602 insertions(+), 14 deletions(-) diff --git a/TwitchDownloaderWPF/Translations/Strings.Designer.cs b/TwitchDownloaderWPF/Translations/Strings.Designer.cs index 5cc92661..8b49411c 100644 --- a/TwitchDownloaderWPF/Translations/Strings.Designer.cs +++ b/TwitchDownloaderWPF/Translations/Strings.Designer.cs @@ -968,6 +968,132 @@ public static string FileAlreadyExistsRenameDescription { } } + /// + /// Looks up a localized string similar to The display name of the channel which owns the video/clip/chat.. + /// + public static string FileNameParameterChannelTooltip { + get { + return ResourceManager.GetString("FileNameParameterChannelTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The date that the video/clip was created in a customizable format.. + /// + public static string FileNameParameterDateCustomTooltip { + get { + return ResourceManager.GetString("FileNameParameterDateCustomTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The date that the video/clip was created in the format M-d-yy.. + /// + public static string FileNameParameterDateTooltip { + get { + return ResourceManager.GetString("FileNameParameterDateTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The display name of the primary game/category in the video/clip/chat.. + /// + public static string FileNameParameterGameTooltip { + get { + return ResourceManager.GetString("FileNameParameterGameTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The ID of the video/clip.. + /// + public static string FileNameParameterIdTooltip { + get { + return ResourceManager.GetString("FileNameParameterIdTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The length (including trim) of the video/clip/chat in a customizable format.. + /// + public static string FileNameParameterLengthCustomTooltip { + get { + return ResourceManager.GetString("FileNameParameterLengthCustomTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The length (including trim) of the video/clip/chat in the format hh-mm-ss.. + /// + public static string FileNameParameterLengthTooltip { + get { + return ResourceManager.GetString("FileNameParameterLengthTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A string of 11 random characters.. + /// + public static string FileNameParameterRandomStringTooltip { + get { + return ResourceManager.GetString("FileNameParameterRandomStringTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The title of the video/clip.. + /// + public static string FileNameParameterTitleTooltip { + get { + return ResourceManager.GetString("FileNameParameterTitleTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The end trim of the video/chat in a customizable format.. + /// + public static string FileNameParameterTrimEndCustomTooltip { + get { + return ResourceManager.GetString("FileNameParameterTrimEndCustomTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The end trim of the video/chat in the format hh-mm-ss.. + /// + public static string FileNameParameterTrimEndTooltip { + get { + return ResourceManager.GetString("FileNameParameterTrimEndTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The start trim of the video/chat in a customizable format.. + /// + public static string FileNameParameterTrimStartCustomTooltip { + get { + return ResourceManager.GetString("FileNameParameterTrimStartCustomTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The start trim of the video/chat in the format hh-mm-ss.. + /// + public static string FileNameParameterTrimStartTooltip { + get { + return ResourceManager.GetString("FileNameParameterTrimStartTooltip", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The amount of views the video/clip has.. + /// + public static string FileNameParameterViewsTooltip { + get { + return ResourceManager.GetString("FileNameParameterViewsTooltip", resourceCulture); + } + } + /// /// Looks up a localized string similar to File Not Found: . /// diff --git a/TwitchDownloaderWPF/Translations/Strings.es.resx b/TwitchDownloaderWPF/Translations/Strings.es.resx index 19003eda..6a416a10 100644 --- a/TwitchDownloaderWPF/Translations/Strings.es.resx +++ b/TwitchDownloaderWPF/Translations/Strings.es.resx @@ -941,4 +941,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + diff --git a/TwitchDownloaderWPF/Translations/Strings.fr.resx b/TwitchDownloaderWPF/Translations/Strings.fr.resx index 99c6699b..ba4cbcf2 100644 --- a/TwitchDownloaderWPF/Translations/Strings.fr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.fr.resx @@ -940,4 +940,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.it.resx b/TwitchDownloaderWPF/Translations/Strings.it.resx index 095a6b97..84edec10 100644 --- a/TwitchDownloaderWPF/Translations/Strings.it.resx +++ b/TwitchDownloaderWPF/Translations/Strings.it.resx @@ -941,4 +941,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + diff --git a/TwitchDownloaderWPF/Translations/Strings.ja.resx b/TwitchDownloaderWPF/Translations/Strings.ja.resx index 3dcf91fb..d557115b 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ja.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ja.resx @@ -939,4 +939,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.pl.resx b/TwitchDownloaderWPF/Translations/Strings.pl.resx index 07bd2ace..4cf5322e 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pl.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pl.resx @@ -940,4 +940,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx index 0dab9221..31def1ad 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx @@ -943,4 +943,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.resx b/TwitchDownloaderWPF/Translations/Strings.resx index b3b9c9b5..4f6128cf 100644 --- a/TwitchDownloaderWPF/Translations/Strings.resx +++ b/TwitchDownloaderWPF/Translations/Strings.resx @@ -939,4 +939,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.ru.resx b/TwitchDownloaderWPF/Translations/Strings.ru.resx index 7a2ff6c1..4188b0e2 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ru.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ru.resx @@ -940,4 +940,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.tr.resx b/TwitchDownloaderWPF/Translations/Strings.tr.resx index 82985475..07cfea0c 100644 --- a/TwitchDownloaderWPF/Translations/Strings.tr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.tr.resx @@ -941,4 +941,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.uk.resx b/TwitchDownloaderWPF/Translations/Strings.uk.resx index 45e819ac..2b2f1559 100644 --- a/TwitchDownloaderWPF/Translations/Strings.uk.resx +++ b/TwitchDownloaderWPF/Translations/Strings.uk.resx @@ -940,4 +940,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + diff --git a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx index 6f13246e..0bbbfae8 100644 --- a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx +++ b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx @@ -942,4 +942,46 @@ Unable to get channel clips: {0} + + The title of the video/clip. + + + The ID of the video/clip. + + + The date that the video/clip was created in the format M-d-yy. + + + The date that the video/clip was created in a customizable format. + + + The display name of the channel which owns the video/clip/chat. + + + A string of 11 random characters. + + + The start trim of the video/chat in the format hh-mm-ss. + + + The start trim of the video/chat in a customizable format. + + + The end trim of the video/chat in the format hh-mm-ss. + + + The end trim of the video/chat in a customizable format. + + + The length (including trim) of the video/clip/chat in the format hh-mm-ss. + + + The length (including trim) of the video/clip/chat in a customizable format. + + + The amount of views the video/clip has. + + + The display name of the primary game/category in the video/clip/chat. + diff --git a/TwitchDownloaderWPF/WindowSettings.xaml b/TwitchDownloaderWPF/WindowSettings.xaml index eba68b30..41468018 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml +++ b/TwitchDownloaderWPF/WindowSettings.xaml @@ -86,46 +86,46 @@ - + {title} - + {id} - + {date} - + {date_custom=""} - + {channel} - + {random_string} - + {trim_start} - + {trim_start_custom=""} - + {trim_end} - + {trim_end_custom=""} - + {length} - + {length_custom=""} - + {views} - + {game} From a7b85a913a5bbe4b084a4e733d82acaf2a47c5dd Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 22:37:57 -0400 Subject: [PATCH 12/14] Only allow left and middle mouse click --- TwitchDownloaderWPF/PageChatRender.xaml.cs | 3 +++ TwitchDownloaderWPF/WindowSettings.xaml.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/TwitchDownloaderWPF/PageChatRender.xaml.cs b/TwitchDownloaderWPF/PageChatRender.xaml.cs index e117e8be..26a1cd97 100644 --- a/TwitchDownloaderWPF/PageChatRender.xaml.cs +++ b/TwitchDownloaderWPF/PageChatRender.xaml.cs @@ -755,6 +755,9 @@ private void FfmpegParameter_MouseDown(object sender, MouseButtonEventArgs e) if (!IsInitialized || sender is not Run { Text: var parameter }) return; + if (e.ChangedButton is not MouseButton.Left and not MouseButton.Middle) + return; + var focusedElement = Keyboard.FocusedElement; var textBox = GetFfmpegTemplateTextBox(focusedElement); diff --git a/TwitchDownloaderWPF/WindowSettings.xaml.cs b/TwitchDownloaderWPF/WindowSettings.xaml.cs index 4c735718..91bc0c32 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml.cs +++ b/TwitchDownloaderWPF/WindowSettings.xaml.cs @@ -332,6 +332,9 @@ private void FileNameParameter_MouseDown(object sender, MouseButtonEventArgs e) if (!IsInitialized || sender is not Run { Text: var parameter }) return; + if (e.ChangedButton is not MouseButton.Left and not MouseButton.Middle) + return; + var focusedElement = Keyboard.FocusedElement; var textBox = GetTemplateTextBox(focusedElement); From 521fdf6e5626eb6cf0d639ae45612a4b7a6cd288 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 22:46:36 -0400 Subject: [PATCH 13/14] Focus inside *_custom parameter quotation marks when adding with middle mouse click --- TwitchDownloaderWPF/WindowSettings.xaml.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/TwitchDownloaderWPF/WindowSettings.xaml.cs b/TwitchDownloaderWPF/WindowSettings.xaml.cs index 91bc0c32..26a2fe9c 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml.cs +++ b/TwitchDownloaderWPF/WindowSettings.xaml.cs @@ -341,10 +341,21 @@ private void FileNameParameter_MouseDown(object sender, MouseButtonEventArgs e) if (textBox is null) return; - if (textBox.TryInsertAtCaret(parameter)) + var oldCaretPos = textBox.CaretIndex; + if (!textBox.TryInsertAtCaret(parameter)) + return; + + if (e.ChangedButton is MouseButton.Middle && oldCaretPos != -1) { - e.Handled = true; + // If we inserted a *_custom template, we can focus inside the quotation marks + var quoteIndex = parameter.LastIndexOf('"'); + if (quoteIndex != -1) + { + textBox.CaretIndex = oldCaretPos + quoteIndex; + } } + + e.Handled = true; } [return: MaybeNull] From fc528f77acf9e15d378729b15d5c65d2c3071695 Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Tue, 27 Aug 2024 23:50:47 -0400 Subject: [PATCH 14/14] FileName -> Filename --- .../Translations/Strings.Designer.cs | 56 +++++++++---------- .../Translations/Strings.es.resx | 28 +++++----- .../Translations/Strings.fr.resx | 28 +++++----- .../Translations/Strings.it.resx | 28 +++++----- .../Translations/Strings.ja.resx | 28 +++++----- .../Translations/Strings.pl.resx | 28 +++++----- .../Translations/Strings.pt-br.resx | 28 +++++----- TwitchDownloaderWPF/Translations/Strings.resx | 28 +++++----- .../Translations/Strings.ru.resx | 28 +++++----- .../Translations/Strings.tr.resx | 28 +++++----- .../Translations/Strings.uk.resx | 28 +++++----- .../Translations/Strings.zh-cn.resx | 28 +++++----- TwitchDownloaderWPF/WindowSettings.xaml | 28 +++++----- TwitchDownloaderWPF/WindowSettings.xaml.cs | 6 +- 14 files changed, 199 insertions(+), 199 deletions(-) diff --git a/TwitchDownloaderWPF/Translations/Strings.Designer.cs b/TwitchDownloaderWPF/Translations/Strings.Designer.cs index 8b49411c..0cdf2a03 100644 --- a/TwitchDownloaderWPF/Translations/Strings.Designer.cs +++ b/TwitchDownloaderWPF/Translations/Strings.Designer.cs @@ -971,126 +971,126 @@ public static string FileAlreadyExistsRenameDescription { /// /// Looks up a localized string similar to The display name of the channel which owns the video/clip/chat.. /// - public static string FileNameParameterChannelTooltip { + public static string FilenameParameterChannelTooltip { get { - return ResourceManager.GetString("FileNameParameterChannelTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterChannelTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The date that the video/clip was created in a customizable format.. /// - public static string FileNameParameterDateCustomTooltip { + public static string FilenameParameterDateCustomTooltip { get { - return ResourceManager.GetString("FileNameParameterDateCustomTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterDateCustomTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The date that the video/clip was created in the format M-d-yy.. /// - public static string FileNameParameterDateTooltip { + public static string FilenameParameterDateTooltip { get { - return ResourceManager.GetString("FileNameParameterDateTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterDateTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The display name of the primary game/category in the video/clip/chat.. /// - public static string FileNameParameterGameTooltip { + public static string FilenameParameterGameTooltip { get { - return ResourceManager.GetString("FileNameParameterGameTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterGameTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The ID of the video/clip.. /// - public static string FileNameParameterIdTooltip { + public static string FilenameParameterIdTooltip { get { - return ResourceManager.GetString("FileNameParameterIdTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterIdTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The length (including trim) of the video/clip/chat in a customizable format.. /// - public static string FileNameParameterLengthCustomTooltip { + public static string FilenameParameterLengthCustomTooltip { get { - return ResourceManager.GetString("FileNameParameterLengthCustomTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterLengthCustomTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The length (including trim) of the video/clip/chat in the format hh-mm-ss.. /// - public static string FileNameParameterLengthTooltip { + public static string FilenameParameterLengthTooltip { get { - return ResourceManager.GetString("FileNameParameterLengthTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterLengthTooltip", resourceCulture); } } /// /// Looks up a localized string similar to A string of 11 random characters.. /// - public static string FileNameParameterRandomStringTooltip { + public static string FilenameParameterRandomStringTooltip { get { - return ResourceManager.GetString("FileNameParameterRandomStringTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterRandomStringTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The title of the video/clip.. /// - public static string FileNameParameterTitleTooltip { + public static string FilenameParameterTitleTooltip { get { - return ResourceManager.GetString("FileNameParameterTitleTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterTitleTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The end trim of the video/chat in a customizable format.. /// - public static string FileNameParameterTrimEndCustomTooltip { + public static string FilenameParameterTrimEndCustomTooltip { get { - return ResourceManager.GetString("FileNameParameterTrimEndCustomTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterTrimEndCustomTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The end trim of the video/chat in the format hh-mm-ss.. /// - public static string FileNameParameterTrimEndTooltip { + public static string FilenameParameterTrimEndTooltip { get { - return ResourceManager.GetString("FileNameParameterTrimEndTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterTrimEndTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The start trim of the video/chat in a customizable format.. /// - public static string FileNameParameterTrimStartCustomTooltip { + public static string FilenameParameterTrimStartCustomTooltip { get { - return ResourceManager.GetString("FileNameParameterTrimStartCustomTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterTrimStartCustomTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The start trim of the video/chat in the format hh-mm-ss.. /// - public static string FileNameParameterTrimStartTooltip { + public static string FilenameParameterTrimStartTooltip { get { - return ResourceManager.GetString("FileNameParameterTrimStartTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterTrimStartTooltip", resourceCulture); } } /// /// Looks up a localized string similar to The amount of views the video/clip has.. /// - public static string FileNameParameterViewsTooltip { + public static string FilenameParameterViewsTooltip { get { - return ResourceManager.GetString("FileNameParameterViewsTooltip", resourceCulture); + return ResourceManager.GetString("FilenameParameterViewsTooltip", resourceCulture); } } diff --git a/TwitchDownloaderWPF/Translations/Strings.es.resx b/TwitchDownloaderWPF/Translations/Strings.es.resx index 6a416a10..76d4435a 100644 --- a/TwitchDownloaderWPF/Translations/Strings.es.resx +++ b/TwitchDownloaderWPF/Translations/Strings.es.resx @@ -941,46 +941,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. diff --git a/TwitchDownloaderWPF/Translations/Strings.fr.resx b/TwitchDownloaderWPF/Translations/Strings.fr.resx index ba4cbcf2..62fe5311 100644 --- a/TwitchDownloaderWPF/Translations/Strings.fr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.fr.resx @@ -940,46 +940,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.it.resx b/TwitchDownloaderWPF/Translations/Strings.it.resx index 84edec10..12090831 100644 --- a/TwitchDownloaderWPF/Translations/Strings.it.resx +++ b/TwitchDownloaderWPF/Translations/Strings.it.resx @@ -941,46 +941,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. diff --git a/TwitchDownloaderWPF/Translations/Strings.ja.resx b/TwitchDownloaderWPF/Translations/Strings.ja.resx index d557115b..a189c11f 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ja.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ja.resx @@ -939,46 +939,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.pl.resx b/TwitchDownloaderWPF/Translations/Strings.pl.resx index 4cf5322e..b16dde91 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pl.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pl.resx @@ -940,46 +940,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx index 31def1ad..aed41fe5 100644 --- a/TwitchDownloaderWPF/Translations/Strings.pt-br.resx +++ b/TwitchDownloaderWPF/Translations/Strings.pt-br.resx @@ -943,46 +943,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.resx b/TwitchDownloaderWPF/Translations/Strings.resx index 4f6128cf..d757bd1e 100644 --- a/TwitchDownloaderWPF/Translations/Strings.resx +++ b/TwitchDownloaderWPF/Translations/Strings.resx @@ -939,46 +939,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.ru.resx b/TwitchDownloaderWPF/Translations/Strings.ru.resx index 4188b0e2..45e28e77 100644 --- a/TwitchDownloaderWPF/Translations/Strings.ru.resx +++ b/TwitchDownloaderWPF/Translations/Strings.ru.resx @@ -940,46 +940,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.tr.resx b/TwitchDownloaderWPF/Translations/Strings.tr.resx index 07cfea0c..0281f9e8 100644 --- a/TwitchDownloaderWPF/Translations/Strings.tr.resx +++ b/TwitchDownloaderWPF/Translations/Strings.tr.resx @@ -941,46 +941,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. \ No newline at end of file diff --git a/TwitchDownloaderWPF/Translations/Strings.uk.resx b/TwitchDownloaderWPF/Translations/Strings.uk.resx index 2b2f1559..5c714a07 100644 --- a/TwitchDownloaderWPF/Translations/Strings.uk.resx +++ b/TwitchDownloaderWPF/Translations/Strings.uk.resx @@ -940,46 +940,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. diff --git a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx index 0bbbfae8..4d67682f 100644 --- a/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx +++ b/TwitchDownloaderWPF/Translations/Strings.zh-cn.resx @@ -942,46 +942,46 @@ Unable to get channel clips: {0} - + The title of the video/clip. - + The ID of the video/clip. - + The date that the video/clip was created in the format M-d-yy. - + The date that the video/clip was created in a customizable format. - + The display name of the channel which owns the video/clip/chat. - + A string of 11 random characters. - + The start trim of the video/chat in the format hh-mm-ss. - + The start trim of the video/chat in a customizable format. - + The end trim of the video/chat in the format hh-mm-ss. - + The end trim of the video/chat in a customizable format. - + The length (including trim) of the video/clip/chat in the format hh-mm-ss. - + The length (including trim) of the video/clip/chat in a customizable format. - + The amount of views the video/clip has. - + The display name of the primary game/category in the video/clip/chat. diff --git a/TwitchDownloaderWPF/WindowSettings.xaml b/TwitchDownloaderWPF/WindowSettings.xaml index 41468018..d2b06501 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml +++ b/TwitchDownloaderWPF/WindowSettings.xaml @@ -86,46 +86,46 @@ - + {title} - + {id} - + {date} - + {date_custom=""} - + {channel} - + {random_string} - + {trim_start} - + {trim_start_custom=""} - + {trim_end} - + {trim_end_custom=""} - + {length} - + {length_custom=""} - + {views} - + {game} diff --git a/TwitchDownloaderWPF/WindowSettings.xaml.cs b/TwitchDownloaderWPF/WindowSettings.xaml.cs index 26a2fe9c..930e0963 100644 --- a/TwitchDownloaderWPF/WindowSettings.xaml.cs +++ b/TwitchDownloaderWPF/WindowSettings.xaml.cs @@ -327,7 +327,7 @@ private void ComboLogLevels_OnSelectionChanged(object sender, SelectionChangedEv Settings.Default.LogLevels = newLogLevel; } - private void FileNameParameter_MouseDown(object sender, MouseButtonEventArgs e) + private void FilenameParameter_MouseDown(object sender, MouseButtonEventArgs e) { if (!IsInitialized || sender is not Run { Text: var parameter }) return; @@ -336,7 +336,7 @@ private void FileNameParameter_MouseDown(object sender, MouseButtonEventArgs e) return; var focusedElement = Keyboard.FocusedElement; - var textBox = GetTemplateTextBox(focusedElement); + var textBox = GetFilenameTemplateTextBox(focusedElement); if (textBox is null) return; @@ -359,7 +359,7 @@ private void FileNameParameter_MouseDown(object sender, MouseButtonEventArgs e) } [return: MaybeNull] - private TextBox GetTemplateTextBox(IInputElement inputElement) + private TextBox GetFilenameTemplateTextBox(IInputElement inputElement) { if (ReferenceEquals(inputElement, TextVodTemplate)) return TextVodTemplate;