From 2b16e86c7b6318e564dc2f5dfc38aa0733d3654b Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Tue, 13 Dec 2022 16:33:37 -0700 Subject: [PATCH 1/6] Fix character replacement for non-windows platforms. --- Source/FileManager/ReplacementCharacters.cs | 156 +++++++++++------- .../Dialogs/EditReplacementChars.axaml.cs | 4 +- .../Dialogs/EditReplacementChars.cs | 2 +- 3 files changed, 101 insertions(+), 61 deletions(-) diff --git a/Source/FileManager/ReplacementCharacters.cs b/Source/FileManager/ReplacementCharacters.cs index cc93451b..8c11b10d 100644 --- a/Source/FileManager/ReplacementCharacters.cs +++ b/Source/FileManager/ReplacementCharacters.cs @@ -61,59 +61,97 @@ namespace FileManager [JsonConverter(typeof(ReplacementCharactersConverter))] public class ReplacementCharacters { - public static readonly ReplacementCharacters Default = new() + static ReplacementCharacters() { - Replacements = new List() - { - Replacement.OtherInvalid("_"), - Replacement.FilenameForwardSlash("∕"), - Replacement.FilenameBackSlash(""), - Replacement.OpenQuote("“"), - Replacement.CloseQuote("”"), - Replacement.OtherQuote("""), - Replacement.OpenAngleBracket("<"), - Replacement.CloseAngleBracket(">"), - Replacement.Colon("꞉"), - Replacement.Asterisk("✱"), - Replacement.QuestionMark("?"), - Replacement.Pipe("⏐"), - } - }; - public static readonly ReplacementCharacters LoFiDefault = new() - { - Replacements = new List() + } + public static readonly ReplacementCharacters Default + = IsWindows + ? new() { - Replacement.OtherInvalid("_"), - Replacement.FilenameForwardSlash("_"), - Replacement.FilenameBackSlash("_"), - Replacement.OpenQuote("'"), - Replacement.CloseQuote("'"), - Replacement.OtherQuote("'"), - Replacement.OpenAngleBracket("{"), - Replacement.CloseAngleBracket("}"), - Replacement.Colon("-"), + Replacements = new List() + { + Replacement.OtherInvalid("_"), + Replacement.FilenameForwardSlash("∕"), + Replacement.FilenameBackSlash(""), + Replacement.OpenQuote("“"), + Replacement.CloseQuote("”"), + Replacement.OtherQuote("""), + Replacement.OpenAngleBracket("<"), + Replacement.CloseAngleBracket(">"), + Replacement.Colon("꞉"), + Replacement.Asterisk("✱"), + Replacement.QuestionMark("?"), + Replacement.Pipe("⏐"), + } } - }; - - public static readonly ReplacementCharacters Barebones = new() - { - Replacements = new List() + : new() { - Replacement.OtherInvalid("_"), - Replacement.FilenameForwardSlash("_"), - Replacement.FilenameBackSlash("_"), - Replacement.OpenQuote("_"), - Replacement.CloseQuote("_"), - Replacement.OtherQuote("_"), - } - }; + Replacements = new List() + { + Replacement.OtherInvalid("_"), + Replacement.FilenameForwardSlash("∕"), + Replacement.FilenameBackSlash(""), + Replacement.OpenQuote("“"), + Replacement.CloseQuote("”"), + Replacement.OtherQuote(""") + } + }; - private static readonly char[] invalidChars = Path.GetInvalidPathChars().Union(new[] { - '*', '?', ':', - // these are weird. If you run Path.GetInvalidPathChars() in Visual Studio's "C# Interactive", then these characters are included. - // In live code, Path.GetInvalidPathChars() does not include them - '"', '<', '>' + public static readonly ReplacementCharacters LoFiDefault + = IsWindows + ? new() + { + Replacements = new List() + { + Replacement.OtherInvalid("_"), + Replacement.FilenameForwardSlash("_"), + Replacement.FilenameBackSlash("_"), + Replacement.OpenQuote("'"), + Replacement.CloseQuote("'"), + Replacement.OtherQuote("'"), + Replacement.OpenAngleBracket("{"), + Replacement.CloseAngleBracket("}"), + Replacement.Colon("-"), + } + } + : Barebones; + + public static readonly ReplacementCharacters Barebones + = IsWindows + ? new () + { + Replacements = new List() + { + Replacement.OtherInvalid("_"), + Replacement.FilenameForwardSlash("_"), + Replacement.FilenameBackSlash("_"), + Replacement.OpenQuote("_"), + Replacement.CloseQuote("_"), + Replacement.OtherQuote("_") + } + } + : new () + { + Replacements = new List() + { + Replacement.OtherInvalid("_"), + Replacement.FilenameForwardSlash("_"), + Replacement.FilenameBackSlash("\\"), + Replacement.OpenQuote("\""), + Replacement.CloseQuote("\""), + Replacement.OtherQuote("\"") + } + }; + + private static bool IsWindows => Environment.OSVersion.Platform is PlatformID.Win32NT; + + private static readonly char[] invalidPathChars = Path.GetInvalidFileNameChars().Except(new[] { + '\\', '/' + }).ToArray(); + + private static readonly char[] invalidSlashes = Path.GetInvalidFileNameChars().Intersect(new[] { + '\\', '/' }).ToArray(); public IReadOnlyList Replacements { get; init; } @@ -126,10 +164,13 @@ namespace FileManager private string GetFilenameCharReplacement(char toReplace, char preceding, char succeding) { - if (toReplace == ForwardSlash.CharacterToReplace) - return ForwardSlash.ReplacementString; - else if (toReplace == BackSlash.CharacterToReplace) - return BackSlash.ReplacementString; + if (invalidSlashes.Contains(toReplace)) + { + if (toReplace == ForwardSlash.CharacterToReplace) + return ForwardSlash.ReplacementString; + else + return BackSlash.ReplacementString; + } else return GetPathCharReplacement(toReplace, preceding, succeding); } private string GetPathCharReplacement(char toReplace, char preceding, char succeding) @@ -158,6 +199,7 @@ namespace FileManager return OtherQuote; } + //Replace any other non-mandatory characters for (int i = Replacement.FIXED_COUNT; i < Replacements.Count; i++) { var r = Replacements[i]; @@ -167,11 +209,10 @@ namespace FileManager return DefaultReplacement; } - public static bool ContainsInvalidPathChar(string path) - => path.Any(c => invalidChars?.Contains(c) == true); + => path.Any(c => invalidPathChars.Contains(c)); public static bool ContainsInvalidFilenameChar(string path) - => path.Any(c => invalidChars?.Concat(new char[] { '\\', '/' })?.Contains(c) == true); + => ContainsInvalidPathChar(path) || path.Any(c => invalidSlashes.Contains(c)); public string ReplaceInvalidFilenameChars(string fileName) { @@ -181,7 +222,7 @@ namespace FileManager { var c = fileName[i]; - if (invalidChars.Contains(c) || c == ForwardSlash.CharacterToReplace || c == BackSlash.CharacterToReplace) + if (invalidPathChars.Contains(c) || invalidSlashes.Contains(c)) { char preceding = i > 0 ? fileName[i - 1] : default; char succeeding = i < fileName.Length - 1 ? fileName[i + 1] : default; @@ -204,7 +245,7 @@ namespace FileManager { var c = pathStr[i]; - if (!invalidChars.Contains(c) || (c == ':' && i == 1 && Path.IsPathRooted(pathStr))) + if (!invalidPathChars.Contains(c) || (c == ':' && i == 1 && Path.IsPathRooted(pathStr))) builder.Append(c); else { @@ -212,7 +253,6 @@ namespace FileManager char succeeding = i < pathStr.Length - 1 ? pathStr[i + 1] : default; builder.Append(GetPathCharReplacement(c, preceding, succeeding)); } - } return builder.ToString(); } @@ -248,7 +288,7 @@ namespace FileManager dict[3].CharacterToReplace != default3.CharacterToReplace || dict[3].Description != default3.Description || dict[4].CharacterToReplace != default4.CharacterToReplace || dict[4].Description != default4.Description || dict[5].CharacterToReplace != default5.CharacterToReplace || dict[5].Description != default5.Description || - dict.Any(r => ReplacementCharacters.ContainsInvalidPathChar(r.ReplacementString)) + dict.Any(r => ReplacementCharacters.ContainsInvalidFilenameChar(r.ReplacementString)) ) { dict = ReplacementCharacters.Default.Replacements; diff --git a/Source/LibationAvalonia/Dialogs/EditReplacementChars.axaml.cs b/Source/LibationAvalonia/Dialogs/EditReplacementChars.axaml.cs index 5524678e..d6905e9e 100644 --- a/Source/LibationAvalonia/Dialogs/EditReplacementChars.axaml.cs +++ b/Source/LibationAvalonia/Dialogs/EditReplacementChars.axaml.cs @@ -143,7 +143,7 @@ namespace LibationAvalonia.Dialogs get => _replacementText; set { - if (ReplacementCharacters.ContainsInvalidPathChar(value)) + if (ReplacementCharacters.ContainsInvalidFilenameChar(value)) this.RaisePropertyChanged(nameof(ReplacementText)); else this.RaiseAndSetIfChanged(ref _replacementText, value); @@ -158,7 +158,7 @@ namespace LibationAvalonia.Dialogs set { - if (value?.Length != 1 || !ReplacementCharacters.ContainsInvalidPathChar(value)) + if (value?.Length != 1 || !ReplacementCharacters.ContainsInvalidFilenameChar(value)) this.RaisePropertyChanged(nameof(CharacterToReplace)); else { diff --git a/Source/LibationWinForms/Dialogs/EditReplacementChars.cs b/Source/LibationWinForms/Dialogs/EditReplacementChars.cs index a24b4371..75762a90 100644 --- a/Source/LibationWinForms/Dialogs/EditReplacementChars.cs +++ b/Source/LibationWinForms/Dialogs/EditReplacementChars.cs @@ -101,7 +101,7 @@ namespace LibationWinForms.Dialogs { dataGridView1.Rows[e.RowIndex].ErrorText = $"The {charToReplaceStr[0]} character is already being replaced"; } - else if (ReplacementCharacters.ContainsInvalidPathChar(replacement)) + else if (ReplacementCharacters.ContainsInvalidFilenameChar(replacement)) { dataGridView1.Rows[e.RowIndex].ErrorText = $"Your {replacementStringCol.HeaderText} contains illegal characters"; } From a0dd2ccad6cb60837fd156894a244844849a3787 Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Thu, 15 Dec 2022 15:50:48 -0700 Subject: [PATCH 2/6] Make filename character replacement more xplat and allow replacing any char, not just illegal. --- .../AudibleUtilities/AudibleUtilities.csproj | 2 +- Source/FileManager/FileNamingTemplate.cs | 2 +- Source/FileManager/FileUtility.cs | 2 +- Source/FileManager/ReplacementCharacters.cs | 84 +- .../Dialogs/EditReplacementChars.axaml.cs | 2 +- .../Configuration.Logging.cs | 2 + .../Configuration.PersistentSettings.cs | 2 +- .../Dialogs/SettingsDialog.Designer.cs | 2172 ++++++++--------- .../FileManager.Tests/FileUtilityTests.cs | 6 +- 9 files changed, 1141 insertions(+), 1133 deletions(-) diff --git a/Source/AudibleUtilities/AudibleUtilities.csproj b/Source/AudibleUtilities/AudibleUtilities.csproj index 48c77309..963084fd 100644 --- a/Source/AudibleUtilities/AudibleUtilities.csproj +++ b/Source/AudibleUtilities/AudibleUtilities.csproj @@ -5,7 +5,7 @@ - + diff --git a/Source/FileManager/FileNamingTemplate.cs b/Source/FileManager/FileNamingTemplate.cs index 7b98b5e9..203b9acf 100644 --- a/Source/FileManager/FileNamingTemplate.cs +++ b/Source/FileManager/FileNamingTemplate.cs @@ -105,7 +105,7 @@ namespace FileManager // Other illegal characters will be taken care of later. Must take care of slashes now so params can't introduce new folders. // Esp important for file templates. - return replacements.ReplaceInvalidFilenameChars(value.ToString()); + return replacements.ReplaceFilenameChars(value.ToString()); } } } diff --git a/Source/FileManager/FileUtility.cs b/Source/FileManager/FileUtility.cs index c5476258..03c4f872 100644 --- a/Source/FileManager/FileUtility.cs +++ b/Source/FileManager/FileUtility.cs @@ -84,7 +84,7 @@ namespace FileManager var pathNoPrefix = path.PathWithoutPrefix; - pathNoPrefix = replacements.ReplaceInvalidPathChars(pathNoPrefix); + pathNoPrefix = replacements.ReplacePathChars(pathNoPrefix); pathNoPrefix = removeDoubleSlashes(pathNoPrefix); return pathNoPrefix; diff --git a/Source/FileManager/ReplacementCharacters.cs b/Source/FileManager/ReplacementCharacters.cs index 8c11b10d..6c228411 100644 --- a/Source/FileManager/ReplacementCharacters.cs +++ b/Source/FileManager/ReplacementCharacters.cs @@ -69,7 +69,7 @@ namespace FileManager = IsWindows ? new() { - Replacements = new List() + Replacements = new Replacement[] { Replacement.OtherInvalid("_"), Replacement.FilenameForwardSlash("∕"), @@ -87,7 +87,7 @@ namespace FileManager } : new() { - Replacements = new List() + Replacements = new Replacement[] { Replacement.OtherInvalid("_"), Replacement.FilenameForwardSlash("∕"), @@ -102,7 +102,7 @@ namespace FileManager = IsWindows ? new() { - Replacements = new List() + Replacements = new Replacement[] { Replacement.OtherInvalid("_"), Replacement.FilenameForwardSlash("_"), @@ -121,7 +121,7 @@ namespace FileManager = IsWindows ? new () { - Replacements = new List() + Replacements = new Replacement[] { Replacement.OtherInvalid("_"), Replacement.FilenameForwardSlash("_"), @@ -133,7 +133,7 @@ namespace FileManager } : new () { - Replacements = new List() + Replacements = new Replacement[] { Replacement.OtherInvalid("_"), Replacement.FilenameForwardSlash("_"), @@ -147,11 +147,11 @@ namespace FileManager private static bool IsWindows => Environment.OSVersion.Platform is PlatformID.Win32NT; private static readonly char[] invalidPathChars = Path.GetInvalidFileNameChars().Except(new[] { - '\\', '/' + Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }).ToArray(); private static readonly char[] invalidSlashes = Path.GetInvalidFileNameChars().Intersect(new[] { - '\\', '/' + Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }).ToArray(); public IReadOnlyList Replacements { get; init; } @@ -214,7 +214,7 @@ namespace FileManager public static bool ContainsInvalidFilenameChar(string path) => ContainsInvalidPathChar(path) || path.Any(c => invalidSlashes.Contains(c)); - public string ReplaceInvalidFilenameChars(string fileName) + public string ReplaceFilenameChars(string fileName) { if (string.IsNullOrEmpty(fileName)) return string.Empty; var builder = new System.Text.StringBuilder(); @@ -222,7 +222,9 @@ namespace FileManager { var c = fileName[i]; - if (invalidPathChars.Contains(c) || invalidSlashes.Contains(c)) + if (invalidPathChars.Contains(c) + || invalidSlashes.Contains(c) + || Replacements.Any(r => r.CharacterToReplace == c) /* Replace any other legal characters that they user wants. */ ) { char preceding = i > 0 ? fileName[i - 1] : default; char succeeding = i < fileName.Length - 1 ? fileName[i + 1] : default; @@ -230,29 +232,42 @@ namespace FileManager } else builder.Append(c); - } return builder.ToString(); } - public string ReplaceInvalidPathChars(string pathStr) + public string ReplacePathChars(string pathStr) { if (string.IsNullOrEmpty(pathStr)) return string.Empty; - // replace all colons except within the first 2 chars var builder = new System.Text.StringBuilder(); for (var i = 0; i < pathStr.Length; i++) { var c = pathStr[i]; - if (!invalidPathChars.Contains(c) || (c == ':' && i == 1 && Path.IsPathRooted(pathStr))) - builder.Append(c); - else + if ( + ( + invalidPathChars.Contains(c) + || ( // Replace any other legal characters that they user wants. + c != Path.DirectorySeparatorChar + && c != Path.AltDirectorySeparatorChar + && Replacements.Any(r => r.CharacterToReplace == c) + ) + ) + && !( // replace all colons except drive letter designator on Windows + c == ':' + && i == 1 + && Path.IsPathRooted(pathStr) + && IsWindows + ) + ) { - char preceding = i > 0 ? pathStr[i - 1] : default; - char succeeding = i < pathStr.Length - 1 ? pathStr[i + 1] : default; - builder.Append(GetPathCharReplacement(c, preceding, succeeding)); + char preceding = i > 0 ? pathStr[i - 1] : default; + char succeeding = i < pathStr.Length - 1 ? pathStr[i + 1] : default; + builder.Append(GetPathCharReplacement(c, preceding, succeeding)); } + else + builder.Append(c); } return builder.ToString(); } @@ -274,28 +289,19 @@ namespace FileManager //Ensure that the first 6 replacements are for the expected chars and that all replacement strings are valid. //If not, reset to default. - var default0 = Replacement.OtherInvalid(""); - var default1 = Replacement.FilenameForwardSlash(""); - var default2 = Replacement.FilenameBackSlash(""); - var default3 = Replacement.OpenQuote(""); - var default4 = Replacement.CloseQuote(""); - var default5 = Replacement.OtherQuote(""); - - if (dict.Count < Replacement.FIXED_COUNT || - dict[0].CharacterToReplace != default0.CharacterToReplace || dict[0].Description != default0.Description || - dict[1].CharacterToReplace != default1.CharacterToReplace || dict[1].Description != default1.Description || - dict[2].CharacterToReplace != default2.CharacterToReplace || dict[2].Description != default2.Description || - dict[3].CharacterToReplace != default3.CharacterToReplace || dict[3].Description != default3.Description || - dict[4].CharacterToReplace != default4.CharacterToReplace || dict[4].Description != default4.Description || - dict[5].CharacterToReplace != default5.CharacterToReplace || dict[5].Description != default5.Description || - dict.Any(r => ReplacementCharacters.ContainsInvalidFilenameChar(r.ReplacementString)) - ) - { - dict = ReplacementCharacters.Default.Replacements; - } - //First FIXED_COUNT are mandatory for (int i = 0; i < Replacement.FIXED_COUNT; i++) + { + if (dict.Count < Replacement.FIXED_COUNT + || dict[i].CharacterToReplace != ReplacementCharacters.Barebones.Replacements[i].CharacterToReplace + || dict[i].Description != ReplacementCharacters.Barebones.Replacements[i].Description) + { + dict = ReplacementCharacters.Default.Replacements; + break; + } + + //First FIXED_COUNT are mandatory dict[i].Mandatory = true; + } return new ReplacementCharacters { Replacements = dict }; } @@ -305,7 +311,7 @@ namespace FileManager ReplacementCharacters replacements = (ReplacementCharacters)value; var propertyNames = replacements.Replacements - .Select(c => JObject.FromObject(c)).ToList(); + .Select(JObject.FromObject).ToList(); var prop = new JProperty(nameof(Replacement), new JArray(propertyNames)); diff --git a/Source/LibationAvalonia/Dialogs/EditReplacementChars.axaml.cs b/Source/LibationAvalonia/Dialogs/EditReplacementChars.axaml.cs index d6905e9e..9c48d6f4 100644 --- a/Source/LibationAvalonia/Dialogs/EditReplacementChars.axaml.cs +++ b/Source/LibationAvalonia/Dialogs/EditReplacementChars.axaml.cs @@ -158,7 +158,7 @@ namespace LibationAvalonia.Dialogs set { - if (value?.Length != 1 || !ReplacementCharacters.ContainsInvalidFilenameChar(value)) + if (value?.Length != 1) this.RaisePropertyChanged(nameof(CharacterToReplace)); else { diff --git a/Source/LibationFileManager/Configuration.Logging.cs b/Source/LibationFileManager/Configuration.Logging.cs index aa0fae3e..9cde9b62 100644 --- a/Source/LibationFileManager/Configuration.Logging.cs +++ b/Source/LibationFileManager/Configuration.Logging.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using System.Linq; using Dinah.Core; using Dinah.Core.Logging; +using FileManager; using Microsoft.Extensions.Configuration; using Serilog; using Serilog.Events; @@ -21,6 +22,7 @@ namespace LibationFileManager .Build(); Log.Logger = new LoggerConfiguration() .ReadFrom.Configuration(configuration) + .Destructure.ByTransforming(lp => lp.Path) .CreateLogger(); } diff --git a/Source/LibationFileManager/Configuration.PersistentSettings.cs b/Source/LibationFileManager/Configuration.PersistentSettings.cs index fe931968..4b48d05e 100644 --- a/Source/LibationFileManager/Configuration.PersistentSettings.cs +++ b/Source/LibationFileManager/Configuration.PersistentSettings.cs @@ -276,7 +276,7 @@ namespace LibationFileManager #region templates: custom file naming - [Description("Edit how illegal filename characters are replaced")] + [Description("Edit how filename characters are replaced")] public ReplacementCharacters ReplacementCharacters { get => persistentDictionary.GetNonString(nameof(ReplacementCharacters)); diff --git a/Source/LibationWinForms/Dialogs/SettingsDialog.Designer.cs b/Source/LibationWinForms/Dialogs/SettingsDialog.Designer.cs index fa724771..233155c6 100644 --- a/Source/LibationWinForms/Dialogs/SettingsDialog.Designer.cs +++ b/Source/LibationWinForms/Dialogs/SettingsDialog.Designer.cs @@ -28,1104 +28,1104 @@ /// private void InitializeComponent() { - this.booksLocationDescLbl = new System.Windows.Forms.Label(); - this.inProgressDescLbl = new System.Windows.Forms.Label(); - this.saveBtn = new System.Windows.Forms.Button(); - this.cancelBtn = new System.Windows.Forms.Button(); - this.importEpisodesCb = new System.Windows.Forms.CheckBox(); - this.downloadEpisodesCb = new System.Windows.Forms.CheckBox(); - this.badBookGb = new System.Windows.Forms.GroupBox(); - this.badBookIgnoreRb = new System.Windows.Forms.RadioButton(); - this.badBookRetryRb = new System.Windows.Forms.RadioButton(); - this.badBookAbortRb = new System.Windows.Forms.RadioButton(); - this.badBookAskRb = new System.Windows.Forms.RadioButton(); - this.stripAudibleBrandingCbox = new System.Windows.Forms.CheckBox(); - this.splitFilesByChapterCbox = new System.Windows.Forms.CheckBox(); - this.allowLibationFixupCbox = new System.Windows.Forms.CheckBox(); - this.convertLossyRb = new System.Windows.Forms.RadioButton(); - this.convertLosslessRb = new System.Windows.Forms.RadioButton(); - this.inProgressSelectControl = new LibationWinForms.Dialogs.DirectorySelectControl(); - this.logsBtn = new System.Windows.Forms.Button(); - this.booksSelectControl = new LibationWinForms.Dialogs.DirectoryOrCustomSelectControl(); - this.loggingLevelLbl = new System.Windows.Forms.Label(); - this.loggingLevelCb = new System.Windows.Forms.ComboBox(); - this.tabControl = new System.Windows.Forms.TabControl(); - this.tab1ImportantSettings = new System.Windows.Forms.TabPage(); - this.betaOptInCbox = new System.Windows.Forms.CheckBox(); - this.booksGb = new System.Windows.Forms.GroupBox(); - this.saveEpisodesToSeriesFolderCbox = new System.Windows.Forms.CheckBox(); - this.tab2ImportLibrary = new System.Windows.Forms.TabPage(); - this.autoDownloadEpisodesCb = new System.Windows.Forms.CheckBox(); - this.autoScanCb = new System.Windows.Forms.CheckBox(); - this.showImportedStatsCb = new System.Windows.Forms.CheckBox(); - this.tab3DownloadDecrypt = new System.Windows.Forms.TabPage(); - this.useCoverAsFolderIconCb = new System.Windows.Forms.CheckBox(); - this.inProgressFilesGb = new System.Windows.Forms.GroupBox(); - this.customFileNamingGb = new System.Windows.Forms.GroupBox(); - this.editCharreplacementBtn = new System.Windows.Forms.Button(); - this.chapterFileTemplateBtn = new System.Windows.Forms.Button(); - this.chapterFileTemplateTb = new System.Windows.Forms.TextBox(); - this.chapterFileTemplateLbl = new System.Windows.Forms.Label(); - this.fileTemplateBtn = new System.Windows.Forms.Button(); - this.fileTemplateTb = new System.Windows.Forms.TextBox(); - this.fileTemplateLbl = new System.Windows.Forms.Label(); - this.folderTemplateBtn = new System.Windows.Forms.Button(); - this.folderTemplateTb = new System.Windows.Forms.TextBox(); - this.folderTemplateLbl = new System.Windows.Forms.Label(); - this.tab4AudioFileOptions = new System.Windows.Forms.TabPage(); - this.audiobookFixupsGb = new System.Windows.Forms.GroupBox(); - this.stripUnabridgedCbox = new System.Windows.Forms.CheckBox(); - this.chapterTitleTemplateGb = new System.Windows.Forms.GroupBox(); - this.chapterTitleTemplateBtn = new System.Windows.Forms.Button(); - this.chapterTitleTemplateTb = new System.Windows.Forms.TextBox(); - this.lameOptionsGb = new System.Windows.Forms.GroupBox(); - this.lameDownsampleMonoCbox = new System.Windows.Forms.CheckBox(); - this.lameBitrateGb = new System.Windows.Forms.GroupBox(); - this.LameMatchSourceBRCbox = new System.Windows.Forms.CheckBox(); - this.lameConstantBitrateCbox = new System.Windows.Forms.CheckBox(); - this.label7 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.lameBitrateTb = new System.Windows.Forms.TrackBar(); - this.label1 = new System.Windows.Forms.Label(); - this.lameQualityGb = new System.Windows.Forms.GroupBox(); - this.label19 = new System.Windows.Forms.Label(); - this.label18 = new System.Windows.Forms.Label(); - this.label17 = new System.Windows.Forms.Label(); - this.label16 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.label15 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label13 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.lameVBRQualityTb = new System.Windows.Forms.TrackBar(); - this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.lameTargetQualityRb = new System.Windows.Forms.RadioButton(); - this.lameTargetBitrateRb = new System.Windows.Forms.RadioButton(); - this.mergeOpeningEndCreditsCbox = new System.Windows.Forms.CheckBox(); - this.retainAaxFileCbox = new System.Windows.Forms.CheckBox(); - this.downloadCoverArtCbox = new System.Windows.Forms.CheckBox(); - this.createCueSheetCbox = new System.Windows.Forms.CheckBox(); - this.badBookGb.SuspendLayout(); - this.tabControl.SuspendLayout(); - this.tab1ImportantSettings.SuspendLayout(); - this.booksGb.SuspendLayout(); - this.tab2ImportLibrary.SuspendLayout(); - this.tab3DownloadDecrypt.SuspendLayout(); - this.inProgressFilesGb.SuspendLayout(); - this.customFileNamingGb.SuspendLayout(); - this.tab4AudioFileOptions.SuspendLayout(); - this.audiobookFixupsGb.SuspendLayout(); - this.chapterTitleTemplateGb.SuspendLayout(); - this.lameOptionsGb.SuspendLayout(); - this.lameBitrateGb.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.lameBitrateTb)).BeginInit(); - this.lameQualityGb.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).BeginInit(); - this.groupBox2.SuspendLayout(); - this.SuspendLayout(); - // - // booksLocationDescLbl - // - this.booksLocationDescLbl.AutoSize = true; - this.booksLocationDescLbl.Location = new System.Drawing.Point(7, 19); - this.booksLocationDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.booksLocationDescLbl.Name = "booksLocationDescLbl"; - this.booksLocationDescLbl.Size = new System.Drawing.Size(69, 15); - this.booksLocationDescLbl.TabIndex = 1; - this.booksLocationDescLbl.Text = "[book desc]"; - // - // inProgressDescLbl - // - this.inProgressDescLbl.AutoSize = true; - this.inProgressDescLbl.Location = new System.Drawing.Point(7, 19); - this.inProgressDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.inProgressDescLbl.Name = "inProgressDescLbl"; - this.inProgressDescLbl.Size = new System.Drawing.Size(100, 45); - this.inProgressDescLbl.TabIndex = 18; - this.inProgressDescLbl.Text = "[in progress desc]\r\n[line 2]\r\n[line 3]"; - // - // saveBtn - // - this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.saveBtn.Location = new System.Drawing.Point(667, 491); - this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.saveBtn.Name = "saveBtn"; - this.saveBtn.Size = new System.Drawing.Size(88, 27); - this.saveBtn.TabIndex = 98; - this.saveBtn.Text = "Save"; - this.saveBtn.UseVisualStyleBackColor = true; - this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click); - // - // cancelBtn - // - this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.cancelBtn.Location = new System.Drawing.Point(785, 491); - this.cancelBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.cancelBtn.Name = "cancelBtn"; - this.cancelBtn.Size = new System.Drawing.Size(88, 27); - this.cancelBtn.TabIndex = 99; - this.cancelBtn.Text = "Cancel"; - this.cancelBtn.UseVisualStyleBackColor = true; - this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); - // - // importEpisodesCb - // - this.importEpisodesCb.AutoSize = true; - this.importEpisodesCb.Location = new System.Drawing.Point(6, 56); - this.importEpisodesCb.Name = "importEpisodesCb"; - this.importEpisodesCb.Size = new System.Drawing.Size(146, 19); - this.importEpisodesCb.TabIndex = 3; - this.importEpisodesCb.Text = "[import episodes desc]"; - this.importEpisodesCb.UseVisualStyleBackColor = true; - // - // downloadEpisodesCb - // - this.downloadEpisodesCb.AutoSize = true; - this.downloadEpisodesCb.Location = new System.Drawing.Point(6, 81); - this.downloadEpisodesCb.Name = "downloadEpisodesCb"; - this.downloadEpisodesCb.Size = new System.Drawing.Size(163, 19); - this.downloadEpisodesCb.TabIndex = 4; - this.downloadEpisodesCb.Text = "[download episodes desc]"; - this.downloadEpisodesCb.UseVisualStyleBackColor = true; - // - // badBookGb - // - this.badBookGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.booksLocationDescLbl = new System.Windows.Forms.Label(); + this.inProgressDescLbl = new System.Windows.Forms.Label(); + this.saveBtn = new System.Windows.Forms.Button(); + this.cancelBtn = new System.Windows.Forms.Button(); + this.importEpisodesCb = new System.Windows.Forms.CheckBox(); + this.downloadEpisodesCb = new System.Windows.Forms.CheckBox(); + this.badBookGb = new System.Windows.Forms.GroupBox(); + this.badBookIgnoreRb = new System.Windows.Forms.RadioButton(); + this.badBookRetryRb = new System.Windows.Forms.RadioButton(); + this.badBookAbortRb = new System.Windows.Forms.RadioButton(); + this.badBookAskRb = new System.Windows.Forms.RadioButton(); + this.stripAudibleBrandingCbox = new System.Windows.Forms.CheckBox(); + this.splitFilesByChapterCbox = new System.Windows.Forms.CheckBox(); + this.allowLibationFixupCbox = new System.Windows.Forms.CheckBox(); + this.convertLossyRb = new System.Windows.Forms.RadioButton(); + this.convertLosslessRb = new System.Windows.Forms.RadioButton(); + this.inProgressSelectControl = new LibationWinForms.Dialogs.DirectorySelectControl(); + this.logsBtn = new System.Windows.Forms.Button(); + this.booksSelectControl = new LibationWinForms.Dialogs.DirectoryOrCustomSelectControl(); + this.loggingLevelLbl = new System.Windows.Forms.Label(); + this.loggingLevelCb = new System.Windows.Forms.ComboBox(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.tab1ImportantSettings = new System.Windows.Forms.TabPage(); + this.betaOptInCbox = new System.Windows.Forms.CheckBox(); + this.booksGb = new System.Windows.Forms.GroupBox(); + this.saveEpisodesToSeriesFolderCbox = new System.Windows.Forms.CheckBox(); + this.tab2ImportLibrary = new System.Windows.Forms.TabPage(); + this.autoDownloadEpisodesCb = new System.Windows.Forms.CheckBox(); + this.autoScanCb = new System.Windows.Forms.CheckBox(); + this.showImportedStatsCb = new System.Windows.Forms.CheckBox(); + this.tab3DownloadDecrypt = new System.Windows.Forms.TabPage(); + this.useCoverAsFolderIconCb = new System.Windows.Forms.CheckBox(); + this.inProgressFilesGb = new System.Windows.Forms.GroupBox(); + this.customFileNamingGb = new System.Windows.Forms.GroupBox(); + this.editCharreplacementBtn = new System.Windows.Forms.Button(); + this.chapterFileTemplateBtn = new System.Windows.Forms.Button(); + this.chapterFileTemplateTb = new System.Windows.Forms.TextBox(); + this.chapterFileTemplateLbl = new System.Windows.Forms.Label(); + this.fileTemplateBtn = new System.Windows.Forms.Button(); + this.fileTemplateTb = new System.Windows.Forms.TextBox(); + this.fileTemplateLbl = new System.Windows.Forms.Label(); + this.folderTemplateBtn = new System.Windows.Forms.Button(); + this.folderTemplateTb = new System.Windows.Forms.TextBox(); + this.folderTemplateLbl = new System.Windows.Forms.Label(); + this.tab4AudioFileOptions = new System.Windows.Forms.TabPage(); + this.audiobookFixupsGb = new System.Windows.Forms.GroupBox(); + this.stripUnabridgedCbox = new System.Windows.Forms.CheckBox(); + this.chapterTitleTemplateGb = new System.Windows.Forms.GroupBox(); + this.chapterTitleTemplateBtn = new System.Windows.Forms.Button(); + this.chapterTitleTemplateTb = new System.Windows.Forms.TextBox(); + this.lameOptionsGb = new System.Windows.Forms.GroupBox(); + this.lameDownsampleMonoCbox = new System.Windows.Forms.CheckBox(); + this.lameBitrateGb = new System.Windows.Forms.GroupBox(); + this.LameMatchSourceBRCbox = new System.Windows.Forms.CheckBox(); + this.lameConstantBitrateCbox = new System.Windows.Forms.CheckBox(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.lameBitrateTb = new System.Windows.Forms.TrackBar(); + this.label1 = new System.Windows.Forms.Label(); + this.lameQualityGb = new System.Windows.Forms.GroupBox(); + this.label19 = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.lameVBRQualityTb = new System.Windows.Forms.TrackBar(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.lameTargetQualityRb = new System.Windows.Forms.RadioButton(); + this.lameTargetBitrateRb = new System.Windows.Forms.RadioButton(); + this.mergeOpeningEndCreditsCbox = new System.Windows.Forms.CheckBox(); + this.retainAaxFileCbox = new System.Windows.Forms.CheckBox(); + this.downloadCoverArtCbox = new System.Windows.Forms.CheckBox(); + this.createCueSheetCbox = new System.Windows.Forms.CheckBox(); + this.badBookGb.SuspendLayout(); + this.tabControl.SuspendLayout(); + this.tab1ImportantSettings.SuspendLayout(); + this.booksGb.SuspendLayout(); + this.tab2ImportLibrary.SuspendLayout(); + this.tab3DownloadDecrypt.SuspendLayout(); + this.inProgressFilesGb.SuspendLayout(); + this.customFileNamingGb.SuspendLayout(); + this.tab4AudioFileOptions.SuspendLayout(); + this.audiobookFixupsGb.SuspendLayout(); + this.chapterTitleTemplateGb.SuspendLayout(); + this.lameOptionsGb.SuspendLayout(); + this.lameBitrateGb.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.lameBitrateTb)).BeginInit(); + this.lameQualityGb.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).BeginInit(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // booksLocationDescLbl + // + this.booksLocationDescLbl.AutoSize = true; + this.booksLocationDescLbl.Location = new System.Drawing.Point(7, 19); + this.booksLocationDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.booksLocationDescLbl.Name = "booksLocationDescLbl"; + this.booksLocationDescLbl.Size = new System.Drawing.Size(69, 15); + this.booksLocationDescLbl.TabIndex = 1; + this.booksLocationDescLbl.Text = "[book desc]"; + // + // inProgressDescLbl + // + this.inProgressDescLbl.AutoSize = true; + this.inProgressDescLbl.Location = new System.Drawing.Point(7, 19); + this.inProgressDescLbl.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.inProgressDescLbl.Name = "inProgressDescLbl"; + this.inProgressDescLbl.Size = new System.Drawing.Size(100, 45); + this.inProgressDescLbl.TabIndex = 18; + this.inProgressDescLbl.Text = "[in progress desc]\r\n[line 2]\r\n[line 3]"; + // + // saveBtn + // + this.saveBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.saveBtn.Location = new System.Drawing.Point(667, 491); + this.saveBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.saveBtn.Name = "saveBtn"; + this.saveBtn.Size = new System.Drawing.Size(88, 27); + this.saveBtn.TabIndex = 98; + this.saveBtn.Text = "Save"; + this.saveBtn.UseVisualStyleBackColor = true; + this.saveBtn.Click += new System.EventHandler(this.saveBtn_Click); + // + // cancelBtn + // + this.cancelBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.cancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.cancelBtn.Location = new System.Drawing.Point(785, 491); + this.cancelBtn.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.cancelBtn.Name = "cancelBtn"; + this.cancelBtn.Size = new System.Drawing.Size(88, 27); + this.cancelBtn.TabIndex = 99; + this.cancelBtn.Text = "Cancel"; + this.cancelBtn.UseVisualStyleBackColor = true; + this.cancelBtn.Click += new System.EventHandler(this.cancelBtn_Click); + // + // importEpisodesCb + // + this.importEpisodesCb.AutoSize = true; + this.importEpisodesCb.Location = new System.Drawing.Point(6, 56); + this.importEpisodesCb.Name = "importEpisodesCb"; + this.importEpisodesCb.Size = new System.Drawing.Size(146, 19); + this.importEpisodesCb.TabIndex = 3; + this.importEpisodesCb.Text = "[import episodes desc]"; + this.importEpisodesCb.UseVisualStyleBackColor = true; + // + // downloadEpisodesCb + // + this.downloadEpisodesCb.AutoSize = true; + this.downloadEpisodesCb.Location = new System.Drawing.Point(6, 81); + this.downloadEpisodesCb.Name = "downloadEpisodesCb"; + this.downloadEpisodesCb.Size = new System.Drawing.Size(163, 19); + this.downloadEpisodesCb.TabIndex = 4; + this.downloadEpisodesCb.Text = "[download episodes desc]"; + this.downloadEpisodesCb.UseVisualStyleBackColor = true; + // + // badBookGb + // + this.badBookGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.badBookGb.Controls.Add(this.badBookIgnoreRb); - this.badBookGb.Controls.Add(this.badBookRetryRb); - this.badBookGb.Controls.Add(this.badBookAbortRb); - this.badBookGb.Controls.Add(this.badBookAskRb); - this.badBookGb.Location = new System.Drawing.Point(7, 6); - this.badBookGb.Name = "badBookGb"; - this.badBookGb.Size = new System.Drawing.Size(834, 76); - this.badBookGb.TabIndex = 13; - this.badBookGb.TabStop = false; - this.badBookGb.Text = "[bad book desc]"; - // - // badBookIgnoreRb - // - this.badBookIgnoreRb.AutoSize = true; - this.badBookIgnoreRb.Location = new System.Drawing.Point(384, 47); - this.badBookIgnoreRb.Name = "badBookIgnoreRb"; - this.badBookIgnoreRb.Size = new System.Drawing.Size(94, 19); - this.badBookIgnoreRb.TabIndex = 17; - this.badBookIgnoreRb.TabStop = true; - this.badBookIgnoreRb.Text = "[ignore desc]"; - this.badBookIgnoreRb.UseVisualStyleBackColor = true; - // - // badBookRetryRb - // - this.badBookRetryRb.AutoSize = true; - this.badBookRetryRb.Location = new System.Drawing.Point(5, 47); - this.badBookRetryRb.Name = "badBookRetryRb"; - this.badBookRetryRb.Size = new System.Drawing.Size(84, 19); - this.badBookRetryRb.TabIndex = 16; - this.badBookRetryRb.TabStop = true; - this.badBookRetryRb.Text = "[retry desc]"; - this.badBookRetryRb.UseVisualStyleBackColor = true; - // - // badBookAbortRb - // - this.badBookAbortRb.AutoSize = true; - this.badBookAbortRb.Location = new System.Drawing.Point(384, 22); - this.badBookAbortRb.Name = "badBookAbortRb"; - this.badBookAbortRb.Size = new System.Drawing.Size(88, 19); - this.badBookAbortRb.TabIndex = 15; - this.badBookAbortRb.TabStop = true; - this.badBookAbortRb.Text = "[abort desc]"; - this.badBookAbortRb.UseVisualStyleBackColor = true; - // - // badBookAskRb - // - this.badBookAskRb.AutoSize = true; - this.badBookAskRb.Location = new System.Drawing.Point(6, 22); - this.badBookAskRb.Name = "badBookAskRb"; - this.badBookAskRb.Size = new System.Drawing.Size(77, 19); - this.badBookAskRb.TabIndex = 14; - this.badBookAskRb.TabStop = true; - this.badBookAskRb.Text = "[ask desc]"; - this.badBookAskRb.UseVisualStyleBackColor = true; - // - // stripAudibleBrandingCbox - // - this.stripAudibleBrandingCbox.AutoSize = true; - this.stripAudibleBrandingCbox.Location = new System.Drawing.Point(13, 72); - this.stripAudibleBrandingCbox.Name = "stripAudibleBrandingCbox"; - this.stripAudibleBrandingCbox.Size = new System.Drawing.Size(143, 34); - this.stripAudibleBrandingCbox.TabIndex = 13; - this.stripAudibleBrandingCbox.Text = "[StripAudibleBranding\r\ndesc]"; - this.stripAudibleBrandingCbox.UseVisualStyleBackColor = true; - // - // splitFilesByChapterCbox - // - this.splitFilesByChapterCbox.AutoSize = true; - this.splitFilesByChapterCbox.Location = new System.Drawing.Point(13, 22); - this.splitFilesByChapterCbox.Name = "splitFilesByChapterCbox"; - this.splitFilesByChapterCbox.Size = new System.Drawing.Size(162, 19); - this.splitFilesByChapterCbox.TabIndex = 13; - this.splitFilesByChapterCbox.Text = "[SplitFilesByChapter desc]"; - this.splitFilesByChapterCbox.UseVisualStyleBackColor = true; - this.splitFilesByChapterCbox.CheckedChanged += new System.EventHandler(this.splitFilesByChapterCbox_CheckedChanged); - // - // allowLibationFixupCbox - // - this.allowLibationFixupCbox.AutoSize = true; - this.allowLibationFixupCbox.Checked = true; - this.allowLibationFixupCbox.CheckState = System.Windows.Forms.CheckState.Checked; - this.allowLibationFixupCbox.Location = new System.Drawing.Point(19, 118); - this.allowLibationFixupCbox.Name = "allowLibationFixupCbox"; - this.allowLibationFixupCbox.Size = new System.Drawing.Size(163, 19); - this.allowLibationFixupCbox.TabIndex = 10; - this.allowLibationFixupCbox.Text = "[AllowLibationFixup desc]"; - this.allowLibationFixupCbox.UseVisualStyleBackColor = true; - this.allowLibationFixupCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); - // - // convertLossyRb - // - this.convertLossyRb.AutoSize = true; - this.convertLossyRb.Location = new System.Drawing.Point(13, 136); - this.convertLossyRb.Name = "convertLossyRb"; - this.convertLossyRb.Size = new System.Drawing.Size(329, 19); - this.convertLossyRb.TabIndex = 12; - this.convertLossyRb.Text = "Download my books as .MP3 files (transcode if necessary)"; - this.convertLossyRb.UseVisualStyleBackColor = true; - this.convertLossyRb.CheckedChanged += new System.EventHandler(this.convertFormatRb_CheckedChanged); - // - // convertLosslessRb - // - this.convertLosslessRb.AutoSize = true; - this.convertLosslessRb.Checked = true; - this.convertLosslessRb.Location = new System.Drawing.Point(13, 111); - this.convertLosslessRb.Name = "convertLosslessRb"; - this.convertLosslessRb.Size = new System.Drawing.Size(335, 19); - this.convertLosslessRb.TabIndex = 11; - this.convertLosslessRb.TabStop = true; - this.convertLosslessRb.Text = "Download my books in the original audio format (Lossless)"; - this.convertLosslessRb.UseVisualStyleBackColor = true; - this.convertLosslessRb.CheckedChanged += new System.EventHandler(this.convertFormatRb_CheckedChanged); - // - // inProgressSelectControl - // - this.inProgressSelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.badBookGb.Controls.Add(this.badBookIgnoreRb); + this.badBookGb.Controls.Add(this.badBookRetryRb); + this.badBookGb.Controls.Add(this.badBookAbortRb); + this.badBookGb.Controls.Add(this.badBookAskRb); + this.badBookGb.Location = new System.Drawing.Point(7, 6); + this.badBookGb.Name = "badBookGb"; + this.badBookGb.Size = new System.Drawing.Size(834, 76); + this.badBookGb.TabIndex = 13; + this.badBookGb.TabStop = false; + this.badBookGb.Text = "[bad book desc]"; + // + // badBookIgnoreRb + // + this.badBookIgnoreRb.AutoSize = true; + this.badBookIgnoreRb.Location = new System.Drawing.Point(384, 47); + this.badBookIgnoreRb.Name = "badBookIgnoreRb"; + this.badBookIgnoreRb.Size = new System.Drawing.Size(94, 19); + this.badBookIgnoreRb.TabIndex = 17; + this.badBookIgnoreRb.TabStop = true; + this.badBookIgnoreRb.Text = "[ignore desc]"; + this.badBookIgnoreRb.UseVisualStyleBackColor = true; + // + // badBookRetryRb + // + this.badBookRetryRb.AutoSize = true; + this.badBookRetryRb.Location = new System.Drawing.Point(5, 47); + this.badBookRetryRb.Name = "badBookRetryRb"; + this.badBookRetryRb.Size = new System.Drawing.Size(84, 19); + this.badBookRetryRb.TabIndex = 16; + this.badBookRetryRb.TabStop = true; + this.badBookRetryRb.Text = "[retry desc]"; + this.badBookRetryRb.UseVisualStyleBackColor = true; + // + // badBookAbortRb + // + this.badBookAbortRb.AutoSize = true; + this.badBookAbortRb.Location = new System.Drawing.Point(384, 22); + this.badBookAbortRb.Name = "badBookAbortRb"; + this.badBookAbortRb.Size = new System.Drawing.Size(88, 19); + this.badBookAbortRb.TabIndex = 15; + this.badBookAbortRb.TabStop = true; + this.badBookAbortRb.Text = "[abort desc]"; + this.badBookAbortRb.UseVisualStyleBackColor = true; + // + // badBookAskRb + // + this.badBookAskRb.AutoSize = true; + this.badBookAskRb.Location = new System.Drawing.Point(6, 22); + this.badBookAskRb.Name = "badBookAskRb"; + this.badBookAskRb.Size = new System.Drawing.Size(77, 19); + this.badBookAskRb.TabIndex = 14; + this.badBookAskRb.TabStop = true; + this.badBookAskRb.Text = "[ask desc]"; + this.badBookAskRb.UseVisualStyleBackColor = true; + // + // stripAudibleBrandingCbox + // + this.stripAudibleBrandingCbox.AutoSize = true; + this.stripAudibleBrandingCbox.Location = new System.Drawing.Point(13, 72); + this.stripAudibleBrandingCbox.Name = "stripAudibleBrandingCbox"; + this.stripAudibleBrandingCbox.Size = new System.Drawing.Size(143, 34); + this.stripAudibleBrandingCbox.TabIndex = 13; + this.stripAudibleBrandingCbox.Text = "[StripAudibleBranding\r\ndesc]"; + this.stripAudibleBrandingCbox.UseVisualStyleBackColor = true; + // + // splitFilesByChapterCbox + // + this.splitFilesByChapterCbox.AutoSize = true; + this.splitFilesByChapterCbox.Location = new System.Drawing.Point(13, 22); + this.splitFilesByChapterCbox.Name = "splitFilesByChapterCbox"; + this.splitFilesByChapterCbox.Size = new System.Drawing.Size(162, 19); + this.splitFilesByChapterCbox.TabIndex = 13; + this.splitFilesByChapterCbox.Text = "[SplitFilesByChapter desc]"; + this.splitFilesByChapterCbox.UseVisualStyleBackColor = true; + this.splitFilesByChapterCbox.CheckedChanged += new System.EventHandler(this.splitFilesByChapterCbox_CheckedChanged); + // + // allowLibationFixupCbox + // + this.allowLibationFixupCbox.AutoSize = true; + this.allowLibationFixupCbox.Checked = true; + this.allowLibationFixupCbox.CheckState = System.Windows.Forms.CheckState.Checked; + this.allowLibationFixupCbox.Location = new System.Drawing.Point(19, 118); + this.allowLibationFixupCbox.Name = "allowLibationFixupCbox"; + this.allowLibationFixupCbox.Size = new System.Drawing.Size(163, 19); + this.allowLibationFixupCbox.TabIndex = 10; + this.allowLibationFixupCbox.Text = "[AllowLibationFixup desc]"; + this.allowLibationFixupCbox.UseVisualStyleBackColor = true; + this.allowLibationFixupCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); + // + // convertLossyRb + // + this.convertLossyRb.AutoSize = true; + this.convertLossyRb.Location = new System.Drawing.Point(13, 136); + this.convertLossyRb.Name = "convertLossyRb"; + this.convertLossyRb.Size = new System.Drawing.Size(329, 19); + this.convertLossyRb.TabIndex = 12; + this.convertLossyRb.Text = "Download my books as .MP3 files (transcode if necessary)"; + this.convertLossyRb.UseVisualStyleBackColor = true; + this.convertLossyRb.CheckedChanged += new System.EventHandler(this.convertFormatRb_CheckedChanged); + // + // convertLosslessRb + // + this.convertLosslessRb.AutoSize = true; + this.convertLosslessRb.Checked = true; + this.convertLosslessRb.Location = new System.Drawing.Point(13, 111); + this.convertLosslessRb.Name = "convertLosslessRb"; + this.convertLosslessRb.Size = new System.Drawing.Size(335, 19); + this.convertLosslessRb.TabIndex = 11; + this.convertLosslessRb.TabStop = true; + this.convertLosslessRb.Text = "Download my books in the original audio format (Lossless)"; + this.convertLosslessRb.UseVisualStyleBackColor = true; + this.convertLosslessRb.CheckedChanged += new System.EventHandler(this.convertFormatRb_CheckedChanged); + // + // inProgressSelectControl + // + this.inProgressSelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.inProgressSelectControl.Location = new System.Drawing.Point(7, 68); - this.inProgressSelectControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.inProgressSelectControl.Name = "inProgressSelectControl"; - this.inProgressSelectControl.Size = new System.Drawing.Size(828, 52); - this.inProgressSelectControl.TabIndex = 19; - // - // logsBtn - // - this.logsBtn.Location = new System.Drawing.Point(256, 198); - this.logsBtn.Name = "logsBtn"; - this.logsBtn.Size = new System.Drawing.Size(132, 23); - this.logsBtn.TabIndex = 5; - this.logsBtn.Text = "Open log folder"; - this.logsBtn.UseVisualStyleBackColor = true; - this.logsBtn.Click += new System.EventHandler(this.logsBtn_Click); - // - // booksSelectControl - // - this.booksSelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.inProgressSelectControl.Location = new System.Drawing.Point(7, 68); + this.inProgressSelectControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.inProgressSelectControl.Name = "inProgressSelectControl"; + this.inProgressSelectControl.Size = new System.Drawing.Size(828, 52); + this.inProgressSelectControl.TabIndex = 19; + // + // logsBtn + // + this.logsBtn.Location = new System.Drawing.Point(256, 198); + this.logsBtn.Name = "logsBtn"; + this.logsBtn.Size = new System.Drawing.Size(132, 23); + this.logsBtn.TabIndex = 5; + this.logsBtn.Text = "Open log folder"; + this.logsBtn.UseVisualStyleBackColor = true; + this.logsBtn.Click += new System.EventHandler(this.logsBtn_Click); + // + // booksSelectControl + // + this.booksSelectControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.booksSelectControl.Location = new System.Drawing.Point(7, 37); - this.booksSelectControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.booksSelectControl.Name = "booksSelectControl"; - this.booksSelectControl.Size = new System.Drawing.Size(829, 87); - this.booksSelectControl.TabIndex = 2; - // - // loggingLevelLbl - // - this.loggingLevelLbl.AutoSize = true; - this.loggingLevelLbl.Location = new System.Drawing.Point(6, 201); - this.loggingLevelLbl.Name = "loggingLevelLbl"; - this.loggingLevelLbl.Size = new System.Drawing.Size(78, 15); - this.loggingLevelLbl.TabIndex = 3; - this.loggingLevelLbl.Text = "Logging level"; - // - // loggingLevelCb - // - this.loggingLevelCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.loggingLevelCb.FormattingEnabled = true; - this.loggingLevelCb.Location = new System.Drawing.Point(90, 198); - this.loggingLevelCb.Name = "loggingLevelCb"; - this.loggingLevelCb.Size = new System.Drawing.Size(129, 23); - this.loggingLevelCb.TabIndex = 4; - // - // tabControl - // - this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + this.booksSelectControl.Location = new System.Drawing.Point(7, 37); + this.booksSelectControl.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.booksSelectControl.Name = "booksSelectControl"; + this.booksSelectControl.Size = new System.Drawing.Size(829, 87); + this.booksSelectControl.TabIndex = 2; + // + // loggingLevelLbl + // + this.loggingLevelLbl.AutoSize = true; + this.loggingLevelLbl.Location = new System.Drawing.Point(6, 201); + this.loggingLevelLbl.Name = "loggingLevelLbl"; + this.loggingLevelLbl.Size = new System.Drawing.Size(78, 15); + this.loggingLevelLbl.TabIndex = 3; + this.loggingLevelLbl.Text = "Logging level"; + // + // loggingLevelCb + // + this.loggingLevelCb.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.loggingLevelCb.FormattingEnabled = true; + this.loggingLevelCb.Location = new System.Drawing.Point(90, 198); + this.loggingLevelCb.Name = "loggingLevelCb"; + this.loggingLevelCb.Size = new System.Drawing.Size(129, 23); + this.loggingLevelCb.TabIndex = 4; + // + // tabControl + // + this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.tabControl.Controls.Add(this.tab1ImportantSettings); - this.tabControl.Controls.Add(this.tab2ImportLibrary); - this.tabControl.Controls.Add(this.tab3DownloadDecrypt); - this.tabControl.Controls.Add(this.tab4AudioFileOptions); - this.tabControl.Location = new System.Drawing.Point(12, 12); - this.tabControl.Name = "tabControl"; - this.tabControl.SelectedIndex = 0; - this.tabControl.Size = new System.Drawing.Size(862, 473); - this.tabControl.TabIndex = 100; - // - // tab1ImportantSettings - // - this.tab1ImportantSettings.Controls.Add(this.betaOptInCbox); - this.tab1ImportantSettings.Controls.Add(this.booksGb); - this.tab1ImportantSettings.Controls.Add(this.logsBtn); - this.tab1ImportantSettings.Controls.Add(this.loggingLevelCb); - this.tab1ImportantSettings.Controls.Add(this.loggingLevelLbl); - this.tab1ImportantSettings.Location = new System.Drawing.Point(4, 24); - this.tab1ImportantSettings.Name = "tab1ImportantSettings"; - this.tab1ImportantSettings.Padding = new System.Windows.Forms.Padding(3); - this.tab1ImportantSettings.Size = new System.Drawing.Size(854, 445); - this.tab1ImportantSettings.TabIndex = 0; - this.tab1ImportantSettings.Text = "Important settings"; - this.tab1ImportantSettings.UseVisualStyleBackColor = true; - // - // betaOptInCbox - // - this.betaOptInCbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.betaOptInCbox.AutoSize = true; - this.betaOptInCbox.Enabled = false; - this.betaOptInCbox.Location = new System.Drawing.Point(13, 399); - this.betaOptInCbox.Name = "betaOptInCbox"; - this.betaOptInCbox.Size = new System.Drawing.Size(107, 19); - this.betaOptInCbox.TabIndex = 6; - this.betaOptInCbox.Text = "[Opt in to Beta]"; - this.betaOptInCbox.UseVisualStyleBackColor = true; - // - // booksGb - // - this.booksGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.tabControl.Controls.Add(this.tab1ImportantSettings); + this.tabControl.Controls.Add(this.tab2ImportLibrary); + this.tabControl.Controls.Add(this.tab3DownloadDecrypt); + this.tabControl.Controls.Add(this.tab4AudioFileOptions); + this.tabControl.Location = new System.Drawing.Point(12, 12); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Size = new System.Drawing.Size(862, 473); + this.tabControl.TabIndex = 100; + // + // tab1ImportantSettings + // + this.tab1ImportantSettings.Controls.Add(this.betaOptInCbox); + this.tab1ImportantSettings.Controls.Add(this.booksGb); + this.tab1ImportantSettings.Controls.Add(this.logsBtn); + this.tab1ImportantSettings.Controls.Add(this.loggingLevelCb); + this.tab1ImportantSettings.Controls.Add(this.loggingLevelLbl); + this.tab1ImportantSettings.Location = new System.Drawing.Point(4, 24); + this.tab1ImportantSettings.Name = "tab1ImportantSettings"; + this.tab1ImportantSettings.Padding = new System.Windows.Forms.Padding(3); + this.tab1ImportantSettings.Size = new System.Drawing.Size(854, 445); + this.tab1ImportantSettings.TabIndex = 0; + this.tab1ImportantSettings.Text = "Important settings"; + this.tab1ImportantSettings.UseVisualStyleBackColor = true; + // + // betaOptInCbox + // + this.betaOptInCbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.betaOptInCbox.AutoSize = true; + this.betaOptInCbox.Enabled = false; + this.betaOptInCbox.Location = new System.Drawing.Point(13, 399); + this.betaOptInCbox.Name = "betaOptInCbox"; + this.betaOptInCbox.Size = new System.Drawing.Size(107, 19); + this.betaOptInCbox.TabIndex = 6; + this.betaOptInCbox.Text = "[Opt in to Beta]"; + this.betaOptInCbox.UseVisualStyleBackColor = true; + // + // booksGb + // + this.booksGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.booksGb.Controls.Add(this.saveEpisodesToSeriesFolderCbox); - this.booksGb.Controls.Add(this.booksSelectControl); - this.booksGb.Controls.Add(this.booksLocationDescLbl); - this.booksGb.Location = new System.Drawing.Point(6, 6); - this.booksGb.Name = "booksGb"; - this.booksGb.Size = new System.Drawing.Size(842, 156); - this.booksGb.TabIndex = 0; - this.booksGb.TabStop = false; - this.booksGb.Text = "Books location"; - // - // saveEpisodesToSeriesFolderCbox - // - this.saveEpisodesToSeriesFolderCbox.AutoSize = true; - this.saveEpisodesToSeriesFolderCbox.Location = new System.Drawing.Point(7, 131); - this.saveEpisodesToSeriesFolderCbox.Name = "saveEpisodesToSeriesFolderCbox"; - this.saveEpisodesToSeriesFolderCbox.Size = new System.Drawing.Size(191, 19); - this.saveEpisodesToSeriesFolderCbox.TabIndex = 3; - this.saveEpisodesToSeriesFolderCbox.Text = "[Save Episodes To Series Folder]"; - this.saveEpisodesToSeriesFolderCbox.UseVisualStyleBackColor = true; - // - // tab2ImportLibrary - // - this.tab2ImportLibrary.Controls.Add(this.autoDownloadEpisodesCb); - this.tab2ImportLibrary.Controls.Add(this.autoScanCb); - this.tab2ImportLibrary.Controls.Add(this.showImportedStatsCb); - this.tab2ImportLibrary.Controls.Add(this.importEpisodesCb); - this.tab2ImportLibrary.Controls.Add(this.downloadEpisodesCb); - this.tab2ImportLibrary.Location = new System.Drawing.Point(4, 24); - this.tab2ImportLibrary.Name = "tab2ImportLibrary"; - this.tab2ImportLibrary.Padding = new System.Windows.Forms.Padding(3); - this.tab2ImportLibrary.Size = new System.Drawing.Size(854, 445); - this.tab2ImportLibrary.TabIndex = 1; - this.tab2ImportLibrary.Text = "Import library"; - this.tab2ImportLibrary.UseVisualStyleBackColor = true; - // - // autoDownloadEpisodesCb - // - this.autoDownloadEpisodesCb.AutoSize = true; - this.autoDownloadEpisodesCb.Location = new System.Drawing.Point(6, 106); - this.autoDownloadEpisodesCb.Name = "autoDownloadEpisodesCb"; - this.autoDownloadEpisodesCb.Size = new System.Drawing.Size(190, 19); - this.autoDownloadEpisodesCb.TabIndex = 5; - this.autoDownloadEpisodesCb.Text = "[auto download episodes desc]"; - this.autoDownloadEpisodesCb.UseVisualStyleBackColor = true; - // - // autoScanCb - // - this.autoScanCb.AutoSize = true; - this.autoScanCb.Location = new System.Drawing.Point(6, 6); - this.autoScanCb.Name = "autoScanCb"; - this.autoScanCb.Size = new System.Drawing.Size(112, 19); - this.autoScanCb.TabIndex = 1; - this.autoScanCb.Text = "[auto scan desc]"; - this.autoScanCb.UseVisualStyleBackColor = true; - // - // showImportedStatsCb - // - this.showImportedStatsCb.AutoSize = true; - this.showImportedStatsCb.Location = new System.Drawing.Point(6, 31); - this.showImportedStatsCb.Name = "showImportedStatsCb"; - this.showImportedStatsCb.Size = new System.Drawing.Size(168, 19); - this.showImportedStatsCb.TabIndex = 2; - this.showImportedStatsCb.Text = "[show imported stats desc]"; - this.showImportedStatsCb.UseVisualStyleBackColor = true; - // - // tab3DownloadDecrypt - // - this.tab3DownloadDecrypt.Controls.Add(this.useCoverAsFolderIconCb); - this.tab3DownloadDecrypt.Controls.Add(this.inProgressFilesGb); - this.tab3DownloadDecrypt.Controls.Add(this.customFileNamingGb); - this.tab3DownloadDecrypt.Controls.Add(this.badBookGb); - this.tab3DownloadDecrypt.Location = new System.Drawing.Point(4, 24); - this.tab3DownloadDecrypt.Name = "tab3DownloadDecrypt"; - this.tab3DownloadDecrypt.Padding = new System.Windows.Forms.Padding(3); - this.tab3DownloadDecrypt.Size = new System.Drawing.Size(854, 445); - this.tab3DownloadDecrypt.TabIndex = 2; - this.tab3DownloadDecrypt.Text = "Download/Decrypt"; - this.tab3DownloadDecrypt.UseVisualStyleBackColor = true; - // - // useCoverAsFolderIconCb - // - this.useCoverAsFolderIconCb.AutoSize = true; - this.useCoverAsFolderIconCb.Location = new System.Drawing.Point(7, 415); - this.useCoverAsFolderIconCb.Name = "useCoverAsFolderIconCb"; - this.useCoverAsFolderIconCb.Size = new System.Drawing.Size(180, 19); - this.useCoverAsFolderIconCb.TabIndex = 22; - this.useCoverAsFolderIconCb.Text = "[UseCoverAsFolderIcon desc]"; - this.useCoverAsFolderIconCb.UseVisualStyleBackColor = true; - // - // inProgressFilesGb - // - this.inProgressFilesGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.booksGb.Controls.Add(this.saveEpisodesToSeriesFolderCbox); + this.booksGb.Controls.Add(this.booksSelectControl); + this.booksGb.Controls.Add(this.booksLocationDescLbl); + this.booksGb.Location = new System.Drawing.Point(6, 6); + this.booksGb.Name = "booksGb"; + this.booksGb.Size = new System.Drawing.Size(842, 156); + this.booksGb.TabIndex = 0; + this.booksGb.TabStop = false; + this.booksGb.Text = "Books location"; + // + // saveEpisodesToSeriesFolderCbox + // + this.saveEpisodesToSeriesFolderCbox.AutoSize = true; + this.saveEpisodesToSeriesFolderCbox.Location = new System.Drawing.Point(7, 131); + this.saveEpisodesToSeriesFolderCbox.Name = "saveEpisodesToSeriesFolderCbox"; + this.saveEpisodesToSeriesFolderCbox.Size = new System.Drawing.Size(191, 19); + this.saveEpisodesToSeriesFolderCbox.TabIndex = 3; + this.saveEpisodesToSeriesFolderCbox.Text = "[Save Episodes To Series Folder]"; + this.saveEpisodesToSeriesFolderCbox.UseVisualStyleBackColor = true; + // + // tab2ImportLibrary + // + this.tab2ImportLibrary.Controls.Add(this.autoDownloadEpisodesCb); + this.tab2ImportLibrary.Controls.Add(this.autoScanCb); + this.tab2ImportLibrary.Controls.Add(this.showImportedStatsCb); + this.tab2ImportLibrary.Controls.Add(this.importEpisodesCb); + this.tab2ImportLibrary.Controls.Add(this.downloadEpisodesCb); + this.tab2ImportLibrary.Location = new System.Drawing.Point(4, 24); + this.tab2ImportLibrary.Name = "tab2ImportLibrary"; + this.tab2ImportLibrary.Padding = new System.Windows.Forms.Padding(3); + this.tab2ImportLibrary.Size = new System.Drawing.Size(854, 445); + this.tab2ImportLibrary.TabIndex = 1; + this.tab2ImportLibrary.Text = "Import library"; + this.tab2ImportLibrary.UseVisualStyleBackColor = true; + // + // autoDownloadEpisodesCb + // + this.autoDownloadEpisodesCb.AutoSize = true; + this.autoDownloadEpisodesCb.Location = new System.Drawing.Point(6, 106); + this.autoDownloadEpisodesCb.Name = "autoDownloadEpisodesCb"; + this.autoDownloadEpisodesCb.Size = new System.Drawing.Size(190, 19); + this.autoDownloadEpisodesCb.TabIndex = 5; + this.autoDownloadEpisodesCb.Text = "[auto download episodes desc]"; + this.autoDownloadEpisodesCb.UseVisualStyleBackColor = true; + // + // autoScanCb + // + this.autoScanCb.AutoSize = true; + this.autoScanCb.Location = new System.Drawing.Point(6, 6); + this.autoScanCb.Name = "autoScanCb"; + this.autoScanCb.Size = new System.Drawing.Size(112, 19); + this.autoScanCb.TabIndex = 1; + this.autoScanCb.Text = "[auto scan desc]"; + this.autoScanCb.UseVisualStyleBackColor = true; + // + // showImportedStatsCb + // + this.showImportedStatsCb.AutoSize = true; + this.showImportedStatsCb.Location = new System.Drawing.Point(6, 31); + this.showImportedStatsCb.Name = "showImportedStatsCb"; + this.showImportedStatsCb.Size = new System.Drawing.Size(168, 19); + this.showImportedStatsCb.TabIndex = 2; + this.showImportedStatsCb.Text = "[show imported stats desc]"; + this.showImportedStatsCb.UseVisualStyleBackColor = true; + // + // tab3DownloadDecrypt + // + this.tab3DownloadDecrypt.Controls.Add(this.useCoverAsFolderIconCb); + this.tab3DownloadDecrypt.Controls.Add(this.inProgressFilesGb); + this.tab3DownloadDecrypt.Controls.Add(this.customFileNamingGb); + this.tab3DownloadDecrypt.Controls.Add(this.badBookGb); + this.tab3DownloadDecrypt.Location = new System.Drawing.Point(4, 24); + this.tab3DownloadDecrypt.Name = "tab3DownloadDecrypt"; + this.tab3DownloadDecrypt.Padding = new System.Windows.Forms.Padding(3); + this.tab3DownloadDecrypt.Size = new System.Drawing.Size(854, 445); + this.tab3DownloadDecrypt.TabIndex = 2; + this.tab3DownloadDecrypt.Text = "Download/Decrypt"; + this.tab3DownloadDecrypt.UseVisualStyleBackColor = true; + // + // useCoverAsFolderIconCb + // + this.useCoverAsFolderIconCb.AutoSize = true; + this.useCoverAsFolderIconCb.Location = new System.Drawing.Point(7, 415); + this.useCoverAsFolderIconCb.Name = "useCoverAsFolderIconCb"; + this.useCoverAsFolderIconCb.Size = new System.Drawing.Size(180, 19); + this.useCoverAsFolderIconCb.TabIndex = 22; + this.useCoverAsFolderIconCb.Text = "[UseCoverAsFolderIcon desc]"; + this.useCoverAsFolderIconCb.UseVisualStyleBackColor = true; + // + // inProgressFilesGb + // + this.inProgressFilesGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.inProgressFilesGb.Controls.Add(this.inProgressDescLbl); - this.inProgressFilesGb.Controls.Add(this.inProgressSelectControl); - this.inProgressFilesGb.Location = new System.Drawing.Point(6, 281); - this.inProgressFilesGb.Name = "inProgressFilesGb"; - this.inProgressFilesGb.Size = new System.Drawing.Size(841, 128); - this.inProgressFilesGb.TabIndex = 21; - this.inProgressFilesGb.TabStop = false; - this.inProgressFilesGb.Text = "In progress files"; - // - // customFileNamingGb - // - this.customFileNamingGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.inProgressFilesGb.Controls.Add(this.inProgressDescLbl); + this.inProgressFilesGb.Controls.Add(this.inProgressSelectControl); + this.inProgressFilesGb.Location = new System.Drawing.Point(6, 281); + this.inProgressFilesGb.Name = "inProgressFilesGb"; + this.inProgressFilesGb.Size = new System.Drawing.Size(841, 128); + this.inProgressFilesGb.TabIndex = 21; + this.inProgressFilesGb.TabStop = false; + this.inProgressFilesGb.Text = "In progress files"; + // + // customFileNamingGb + // + this.customFileNamingGb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.customFileNamingGb.Controls.Add(this.editCharreplacementBtn); - this.customFileNamingGb.Controls.Add(this.chapterFileTemplateBtn); - this.customFileNamingGb.Controls.Add(this.chapterFileTemplateTb); - this.customFileNamingGb.Controls.Add(this.chapterFileTemplateLbl); - this.customFileNamingGb.Controls.Add(this.fileTemplateBtn); - this.customFileNamingGb.Controls.Add(this.fileTemplateTb); - this.customFileNamingGb.Controls.Add(this.fileTemplateLbl); - this.customFileNamingGb.Controls.Add(this.folderTemplateBtn); - this.customFileNamingGb.Controls.Add(this.folderTemplateTb); - this.customFileNamingGb.Controls.Add(this.folderTemplateLbl); - this.customFileNamingGb.Location = new System.Drawing.Point(7, 88); - this.customFileNamingGb.Name = "customFileNamingGb"; - this.customFileNamingGb.Size = new System.Drawing.Size(841, 187); - this.customFileNamingGb.TabIndex = 20; - this.customFileNamingGb.TabStop = false; - this.customFileNamingGb.Text = "Custom file naming"; - // - // editCharreplacementBtn - // - this.editCharreplacementBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.editCharreplacementBtn.Location = new System.Drawing.Point(5, 158); - this.editCharreplacementBtn.Name = "editCharreplacementBtn"; - this.editCharreplacementBtn.Size = new System.Drawing.Size(387, 23); - this.editCharreplacementBtn.TabIndex = 8; - this.editCharreplacementBtn.Text = "[edit char replacement desc]"; - this.editCharreplacementBtn.UseVisualStyleBackColor = true; - this.editCharreplacementBtn.Click += new System.EventHandler(this.editCharreplacementBtn_Click); - // - // chapterFileTemplateBtn - // - this.chapterFileTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.chapterFileTemplateBtn.Location = new System.Drawing.Point(761, 124); - this.chapterFileTemplateBtn.Name = "chapterFileTemplateBtn"; - this.chapterFileTemplateBtn.Size = new System.Drawing.Size(75, 23); - this.chapterFileTemplateBtn.TabIndex = 8; - this.chapterFileTemplateBtn.Text = "Edit..."; - this.chapterFileTemplateBtn.UseVisualStyleBackColor = true; - this.chapterFileTemplateBtn.Click += new System.EventHandler(this.chapterFileTemplateBtn_Click); - // - // chapterFileTemplateTb - // - this.chapterFileTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.customFileNamingGb.Controls.Add(this.editCharreplacementBtn); + this.customFileNamingGb.Controls.Add(this.chapterFileTemplateBtn); + this.customFileNamingGb.Controls.Add(this.chapterFileTemplateTb); + this.customFileNamingGb.Controls.Add(this.chapterFileTemplateLbl); + this.customFileNamingGb.Controls.Add(this.fileTemplateBtn); + this.customFileNamingGb.Controls.Add(this.fileTemplateTb); + this.customFileNamingGb.Controls.Add(this.fileTemplateLbl); + this.customFileNamingGb.Controls.Add(this.folderTemplateBtn); + this.customFileNamingGb.Controls.Add(this.folderTemplateTb); + this.customFileNamingGb.Controls.Add(this.folderTemplateLbl); + this.customFileNamingGb.Location = new System.Drawing.Point(7, 88); + this.customFileNamingGb.Name = "customFileNamingGb"; + this.customFileNamingGb.Size = new System.Drawing.Size(841, 187); + this.customFileNamingGb.TabIndex = 20; + this.customFileNamingGb.TabStop = false; + this.customFileNamingGb.Text = "Custom file naming"; + // + // editCharreplacementBtn + // + this.editCharreplacementBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.editCharreplacementBtn.Location = new System.Drawing.Point(5, 158); + this.editCharreplacementBtn.Name = "editCharreplacementBtn"; + this.editCharreplacementBtn.Size = new System.Drawing.Size(281, 23); + this.editCharreplacementBtn.TabIndex = 8; + this.editCharreplacementBtn.Text = "[edit char replacement desc]"; + this.editCharreplacementBtn.UseVisualStyleBackColor = true; + this.editCharreplacementBtn.Click += new System.EventHandler(this.editCharreplacementBtn_Click); + // + // chapterFileTemplateBtn + // + this.chapterFileTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chapterFileTemplateBtn.Location = new System.Drawing.Point(761, 124); + this.chapterFileTemplateBtn.Name = "chapterFileTemplateBtn"; + this.chapterFileTemplateBtn.Size = new System.Drawing.Size(75, 23); + this.chapterFileTemplateBtn.TabIndex = 8; + this.chapterFileTemplateBtn.Text = "Edit..."; + this.chapterFileTemplateBtn.UseVisualStyleBackColor = true; + this.chapterFileTemplateBtn.Click += new System.EventHandler(this.chapterFileTemplateBtn_Click); + // + // chapterFileTemplateTb + // + this.chapterFileTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.chapterFileTemplateTb.Location = new System.Drawing.Point(6, 125); - this.chapterFileTemplateTb.Name = "chapterFileTemplateTb"; - this.chapterFileTemplateTb.ReadOnly = true; - this.chapterFileTemplateTb.Size = new System.Drawing.Size(749, 23); - this.chapterFileTemplateTb.TabIndex = 7; - // - // chapterFileTemplateLbl - // - this.chapterFileTemplateLbl.AutoSize = true; - this.chapterFileTemplateLbl.Location = new System.Drawing.Point(6, 107); - this.chapterFileTemplateLbl.Name = "chapterFileTemplateLbl"; - this.chapterFileTemplateLbl.Size = new System.Drawing.Size(132, 15); - this.chapterFileTemplateLbl.TabIndex = 6; - this.chapterFileTemplateLbl.Text = "[chapter template desc]"; - // - // fileTemplateBtn - // - this.fileTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.fileTemplateBtn.Location = new System.Drawing.Point(761, 80); - this.fileTemplateBtn.Name = "fileTemplateBtn"; - this.fileTemplateBtn.Size = new System.Drawing.Size(75, 23); - this.fileTemplateBtn.TabIndex = 5; - this.fileTemplateBtn.Text = "Edit..."; - this.fileTemplateBtn.UseVisualStyleBackColor = true; - this.fileTemplateBtn.Click += new System.EventHandler(this.fileTemplateBtn_Click); - // - // fileTemplateTb - // - this.fileTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.chapterFileTemplateTb.Location = new System.Drawing.Point(6, 125); + this.chapterFileTemplateTb.Name = "chapterFileTemplateTb"; + this.chapterFileTemplateTb.ReadOnly = true; + this.chapterFileTemplateTb.Size = new System.Drawing.Size(749, 23); + this.chapterFileTemplateTb.TabIndex = 7; + // + // chapterFileTemplateLbl + // + this.chapterFileTemplateLbl.AutoSize = true; + this.chapterFileTemplateLbl.Location = new System.Drawing.Point(6, 107); + this.chapterFileTemplateLbl.Name = "chapterFileTemplateLbl"; + this.chapterFileTemplateLbl.Size = new System.Drawing.Size(132, 15); + this.chapterFileTemplateLbl.TabIndex = 6; + this.chapterFileTemplateLbl.Text = "[chapter template desc]"; + // + // fileTemplateBtn + // + this.fileTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.fileTemplateBtn.Location = new System.Drawing.Point(761, 80); + this.fileTemplateBtn.Name = "fileTemplateBtn"; + this.fileTemplateBtn.Size = new System.Drawing.Size(75, 23); + this.fileTemplateBtn.TabIndex = 5; + this.fileTemplateBtn.Text = "Edit..."; + this.fileTemplateBtn.UseVisualStyleBackColor = true; + this.fileTemplateBtn.Click += new System.EventHandler(this.fileTemplateBtn_Click); + // + // fileTemplateTb + // + this.fileTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.fileTemplateTb.Location = new System.Drawing.Point(6, 81); - this.fileTemplateTb.Name = "fileTemplateTb"; - this.fileTemplateTb.ReadOnly = true; - this.fileTemplateTb.Size = new System.Drawing.Size(749, 23); - this.fileTemplateTb.TabIndex = 4; - // - // fileTemplateLbl - // - this.fileTemplateLbl.AutoSize = true; - this.fileTemplateLbl.Location = new System.Drawing.Point(6, 63); - this.fileTemplateLbl.Name = "fileTemplateLbl"; - this.fileTemplateLbl.Size = new System.Drawing.Size(108, 15); - this.fileTemplateLbl.TabIndex = 3; - this.fileTemplateLbl.Text = "[file template desc]"; - // - // folderTemplateBtn - // - this.folderTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.folderTemplateBtn.Location = new System.Drawing.Point(760, 36); - this.folderTemplateBtn.Name = "folderTemplateBtn"; - this.folderTemplateBtn.Size = new System.Drawing.Size(75, 23); - this.folderTemplateBtn.TabIndex = 2; - this.folderTemplateBtn.Text = "Edit..."; - this.folderTemplateBtn.UseVisualStyleBackColor = true; - this.folderTemplateBtn.Click += new System.EventHandler(this.folderTemplateBtn_Click); - // - // folderTemplateTb - // - this.folderTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.fileTemplateTb.Location = new System.Drawing.Point(6, 81); + this.fileTemplateTb.Name = "fileTemplateTb"; + this.fileTemplateTb.ReadOnly = true; + this.fileTemplateTb.Size = new System.Drawing.Size(749, 23); + this.fileTemplateTb.TabIndex = 4; + // + // fileTemplateLbl + // + this.fileTemplateLbl.AutoSize = true; + this.fileTemplateLbl.Location = new System.Drawing.Point(6, 63); + this.fileTemplateLbl.Name = "fileTemplateLbl"; + this.fileTemplateLbl.Size = new System.Drawing.Size(108, 15); + this.fileTemplateLbl.TabIndex = 3; + this.fileTemplateLbl.Text = "[file template desc]"; + // + // folderTemplateBtn + // + this.folderTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.folderTemplateBtn.Location = new System.Drawing.Point(760, 36); + this.folderTemplateBtn.Name = "folderTemplateBtn"; + this.folderTemplateBtn.Size = new System.Drawing.Size(75, 23); + this.folderTemplateBtn.TabIndex = 2; + this.folderTemplateBtn.Text = "Edit..."; + this.folderTemplateBtn.UseVisualStyleBackColor = true; + this.folderTemplateBtn.Click += new System.EventHandler(this.folderTemplateBtn_Click); + // + // folderTemplateTb + // + this.folderTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.folderTemplateTb.Location = new System.Drawing.Point(5, 37); - this.folderTemplateTb.Name = "folderTemplateTb"; - this.folderTemplateTb.ReadOnly = true; - this.folderTemplateTb.Size = new System.Drawing.Size(749, 23); - this.folderTemplateTb.TabIndex = 1; - // - // folderTemplateLbl - // - this.folderTemplateLbl.AutoSize = true; - this.folderTemplateLbl.Location = new System.Drawing.Point(5, 19); - this.folderTemplateLbl.Name = "folderTemplateLbl"; - this.folderTemplateLbl.Size = new System.Drawing.Size(123, 15); - this.folderTemplateLbl.TabIndex = 0; - this.folderTemplateLbl.Text = "[folder template desc]"; - // - // tab4AudioFileOptions - // - this.tab4AudioFileOptions.Controls.Add(this.audiobookFixupsGb); - this.tab4AudioFileOptions.Controls.Add(this.chapterTitleTemplateGb); - this.tab4AudioFileOptions.Controls.Add(this.lameOptionsGb); - this.tab4AudioFileOptions.Controls.Add(this.mergeOpeningEndCreditsCbox); - this.tab4AudioFileOptions.Controls.Add(this.retainAaxFileCbox); - this.tab4AudioFileOptions.Controls.Add(this.downloadCoverArtCbox); - this.tab4AudioFileOptions.Controls.Add(this.createCueSheetCbox); - this.tab4AudioFileOptions.Controls.Add(this.allowLibationFixupCbox); - this.tab4AudioFileOptions.Location = new System.Drawing.Point(4, 24); - this.tab4AudioFileOptions.Name = "tab4AudioFileOptions"; - this.tab4AudioFileOptions.Padding = new System.Windows.Forms.Padding(3); - this.tab4AudioFileOptions.Size = new System.Drawing.Size(854, 445); - this.tab4AudioFileOptions.TabIndex = 3; - this.tab4AudioFileOptions.Text = "Audio File Options"; - this.tab4AudioFileOptions.UseVisualStyleBackColor = true; - // - // audiobookFixupsGb - // - this.audiobookFixupsGb.Controls.Add(this.splitFilesByChapterCbox); - this.audiobookFixupsGb.Controls.Add(this.stripUnabridgedCbox); - this.audiobookFixupsGb.Controls.Add(this.convertLosslessRb); - this.audiobookFixupsGb.Controls.Add(this.convertLossyRb); - this.audiobookFixupsGb.Controls.Add(this.stripAudibleBrandingCbox); - this.audiobookFixupsGb.Location = new System.Drawing.Point(6, 143); - this.audiobookFixupsGb.Name = "audiobookFixupsGb"; - this.audiobookFixupsGb.Size = new System.Drawing.Size(403, 160); - this.audiobookFixupsGb.TabIndex = 19; - this.audiobookFixupsGb.TabStop = false; - this.audiobookFixupsGb.Text = "Audiobook Fix-ups"; - // - // stripUnabridgedCbox - // - this.stripUnabridgedCbox.AutoSize = true; - this.stripUnabridgedCbox.Location = new System.Drawing.Point(13, 47); - this.stripUnabridgedCbox.Name = "stripUnabridgedCbox"; - this.stripUnabridgedCbox.Size = new System.Drawing.Size(147, 19); - this.stripUnabridgedCbox.TabIndex = 13; - this.stripUnabridgedCbox.Text = "[StripUnabridged desc]"; - this.stripUnabridgedCbox.UseVisualStyleBackColor = true; - // - // chapterTitleTemplateGb - // - this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateBtn); - this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateTb); - this.chapterTitleTemplateGb.Location = new System.Drawing.Point(6, 335); - this.chapterTitleTemplateGb.Name = "chapterTitleTemplateGb"; - this.chapterTitleTemplateGb.Size = new System.Drawing.Size(842, 54); - this.chapterTitleTemplateGb.TabIndex = 18; - this.chapterTitleTemplateGb.TabStop = false; - this.chapterTitleTemplateGb.Text = "[chapter title template desc]"; - // - // chapterTitleTemplateBtn - // - this.chapterTitleTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.chapterTitleTemplateBtn.Location = new System.Drawing.Point(764, 22); - this.chapterTitleTemplateBtn.Name = "chapterTitleTemplateBtn"; - this.chapterTitleTemplateBtn.Size = new System.Drawing.Size(75, 23); - this.chapterTitleTemplateBtn.TabIndex = 17; - this.chapterTitleTemplateBtn.Text = "Edit..."; - this.chapterTitleTemplateBtn.UseVisualStyleBackColor = true; - this.chapterTitleTemplateBtn.Click += new System.EventHandler(this.chapterTitleTemplateBtn_Click); - // - // chapterTitleTemplateTb - // - this.chapterTitleTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.folderTemplateTb.Location = new System.Drawing.Point(5, 37); + this.folderTemplateTb.Name = "folderTemplateTb"; + this.folderTemplateTb.ReadOnly = true; + this.folderTemplateTb.Size = new System.Drawing.Size(749, 23); + this.folderTemplateTb.TabIndex = 1; + // + // folderTemplateLbl + // + this.folderTemplateLbl.AutoSize = true; + this.folderTemplateLbl.Location = new System.Drawing.Point(5, 19); + this.folderTemplateLbl.Name = "folderTemplateLbl"; + this.folderTemplateLbl.Size = new System.Drawing.Size(123, 15); + this.folderTemplateLbl.TabIndex = 0; + this.folderTemplateLbl.Text = "[folder template desc]"; + // + // tab4AudioFileOptions + // + this.tab4AudioFileOptions.Controls.Add(this.audiobookFixupsGb); + this.tab4AudioFileOptions.Controls.Add(this.chapterTitleTemplateGb); + this.tab4AudioFileOptions.Controls.Add(this.lameOptionsGb); + this.tab4AudioFileOptions.Controls.Add(this.mergeOpeningEndCreditsCbox); + this.tab4AudioFileOptions.Controls.Add(this.retainAaxFileCbox); + this.tab4AudioFileOptions.Controls.Add(this.downloadCoverArtCbox); + this.tab4AudioFileOptions.Controls.Add(this.createCueSheetCbox); + this.tab4AudioFileOptions.Controls.Add(this.allowLibationFixupCbox); + this.tab4AudioFileOptions.Location = new System.Drawing.Point(4, 24); + this.tab4AudioFileOptions.Name = "tab4AudioFileOptions"; + this.tab4AudioFileOptions.Padding = new System.Windows.Forms.Padding(3); + this.tab4AudioFileOptions.Size = new System.Drawing.Size(854, 445); + this.tab4AudioFileOptions.TabIndex = 3; + this.tab4AudioFileOptions.Text = "Audio File Options"; + this.tab4AudioFileOptions.UseVisualStyleBackColor = true; + // + // audiobookFixupsGb + // + this.audiobookFixupsGb.Controls.Add(this.splitFilesByChapterCbox); + this.audiobookFixupsGb.Controls.Add(this.stripUnabridgedCbox); + this.audiobookFixupsGb.Controls.Add(this.convertLosslessRb); + this.audiobookFixupsGb.Controls.Add(this.convertLossyRb); + this.audiobookFixupsGb.Controls.Add(this.stripAudibleBrandingCbox); + this.audiobookFixupsGb.Location = new System.Drawing.Point(6, 143); + this.audiobookFixupsGb.Name = "audiobookFixupsGb"; + this.audiobookFixupsGb.Size = new System.Drawing.Size(403, 160); + this.audiobookFixupsGb.TabIndex = 19; + this.audiobookFixupsGb.TabStop = false; + this.audiobookFixupsGb.Text = "Audiobook Fix-ups"; + // + // stripUnabridgedCbox + // + this.stripUnabridgedCbox.AutoSize = true; + this.stripUnabridgedCbox.Location = new System.Drawing.Point(13, 47); + this.stripUnabridgedCbox.Name = "stripUnabridgedCbox"; + this.stripUnabridgedCbox.Size = new System.Drawing.Size(147, 19); + this.stripUnabridgedCbox.TabIndex = 13; + this.stripUnabridgedCbox.Text = "[StripUnabridged desc]"; + this.stripUnabridgedCbox.UseVisualStyleBackColor = true; + // + // chapterTitleTemplateGb + // + this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateBtn); + this.chapterTitleTemplateGb.Controls.Add(this.chapterTitleTemplateTb); + this.chapterTitleTemplateGb.Location = new System.Drawing.Point(6, 335); + this.chapterTitleTemplateGb.Name = "chapterTitleTemplateGb"; + this.chapterTitleTemplateGb.Size = new System.Drawing.Size(842, 54); + this.chapterTitleTemplateGb.TabIndex = 18; + this.chapterTitleTemplateGb.TabStop = false; + this.chapterTitleTemplateGb.Text = "[chapter title template desc]"; + // + // chapterTitleTemplateBtn + // + this.chapterTitleTemplateBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chapterTitleTemplateBtn.Location = new System.Drawing.Point(764, 22); + this.chapterTitleTemplateBtn.Name = "chapterTitleTemplateBtn"; + this.chapterTitleTemplateBtn.Size = new System.Drawing.Size(75, 23); + this.chapterTitleTemplateBtn.TabIndex = 17; + this.chapterTitleTemplateBtn.Text = "Edit..."; + this.chapterTitleTemplateBtn.UseVisualStyleBackColor = true; + this.chapterTitleTemplateBtn.Click += new System.EventHandler(this.chapterTitleTemplateBtn_Click); + // + // chapterTitleTemplateTb + // + this.chapterTitleTemplateTb.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.chapterTitleTemplateTb.Location = new System.Drawing.Point(6, 22); - this.chapterTitleTemplateTb.Name = "chapterTitleTemplateTb"; - this.chapterTitleTemplateTb.ReadOnly = true; - this.chapterTitleTemplateTb.Size = new System.Drawing.Size(752, 23); - this.chapterTitleTemplateTb.TabIndex = 16; - // - // lameOptionsGb - // - this.lameOptionsGb.Controls.Add(this.lameDownsampleMonoCbox); - this.lameOptionsGb.Controls.Add(this.lameBitrateGb); - this.lameOptionsGb.Controls.Add(this.label1); - this.lameOptionsGb.Controls.Add(this.lameQualityGb); - this.lameOptionsGb.Controls.Add(this.groupBox2); - this.lameOptionsGb.Location = new System.Drawing.Point(415, 6); - this.lameOptionsGb.Name = "lameOptionsGb"; - this.lameOptionsGb.Size = new System.Drawing.Size(433, 323); - this.lameOptionsGb.TabIndex = 14; - this.lameOptionsGb.TabStop = false; - this.lameOptionsGb.Text = "Mp3 Encoding Options"; - // - // lameDownsampleMonoCbox - // - this.lameDownsampleMonoCbox.AutoSize = true; - this.lameDownsampleMonoCbox.Location = new System.Drawing.Point(234, 35); - this.lameDownsampleMonoCbox.Name = "lameDownsampleMonoCbox"; - this.lameDownsampleMonoCbox.Size = new System.Drawing.Size(184, 34); - this.lameDownsampleMonoCbox.TabIndex = 1; - this.lameDownsampleMonoCbox.Text = "Downsample stereo to mono?\r\n(Recommended)\r\n"; - this.lameDownsampleMonoCbox.UseVisualStyleBackColor = true; - // - // lameBitrateGb - // - this.lameBitrateGb.Controls.Add(this.LameMatchSourceBRCbox); - this.lameBitrateGb.Controls.Add(this.lameConstantBitrateCbox); - this.lameBitrateGb.Controls.Add(this.label7); - this.lameBitrateGb.Controls.Add(this.label6); - this.lameBitrateGb.Controls.Add(this.label5); - this.lameBitrateGb.Controls.Add(this.label4); - this.lameBitrateGb.Controls.Add(this.label11); - this.lameBitrateGb.Controls.Add(this.label3); - this.lameBitrateGb.Controls.Add(this.lameBitrateTb); - this.lameBitrateGb.Location = new System.Drawing.Point(6, 84); - this.lameBitrateGb.Name = "lameBitrateGb"; - this.lameBitrateGb.Size = new System.Drawing.Size(421, 101); - this.lameBitrateGb.TabIndex = 0; - this.lameBitrateGb.TabStop = false; - this.lameBitrateGb.Text = "Bitrate"; - // - // LameMatchSourceBRCbox - // - this.LameMatchSourceBRCbox.AutoSize = true; - this.LameMatchSourceBRCbox.Location = new System.Drawing.Point(260, 77); - this.LameMatchSourceBRCbox.Name = "LameMatchSourceBRCbox"; - this.LameMatchSourceBRCbox.Size = new System.Drawing.Size(140, 19); - this.LameMatchSourceBRCbox.TabIndex = 3; - this.LameMatchSourceBRCbox.Text = "Match source bitrate?"; - this.LameMatchSourceBRCbox.UseVisualStyleBackColor = true; - this.LameMatchSourceBRCbox.CheckedChanged += new System.EventHandler(this.LameMatchSourceBRCbox_CheckedChanged); - // - // lameConstantBitrateCbox - // - this.lameConstantBitrateCbox.AutoSize = true; - this.lameConstantBitrateCbox.Location = new System.Drawing.Point(6, 77); - this.lameConstantBitrateCbox.Name = "lameConstantBitrateCbox"; - this.lameConstantBitrateCbox.Size = new System.Drawing.Size(216, 19); - this.lameConstantBitrateCbox.TabIndex = 2; - this.lameConstantBitrateCbox.Text = "Restrict encoder to constant bitrate?"; - this.lameConstantBitrateCbox.UseVisualStyleBackColor = true; - // - // label7 - // - this.label7.AutoSize = true; - this.label7.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label7.Location = new System.Drawing.Point(390, 52); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(25, 15); - this.label7.TabIndex = 1; - this.label7.Text = "320"; - // - // label6 - // - this.label6.AutoSize = true; - this.label6.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label6.Location = new System.Drawing.Point(309, 52); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(25, 15); - this.label6.TabIndex = 1; - this.label6.Text = "256"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label5.Location = new System.Drawing.Point(228, 52); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(25, 15); - this.label5.TabIndex = 1; - this.label5.Text = "192"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label4.Location = new System.Drawing.Point(147, 52); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(25, 15); - this.label4.TabIndex = 1; - this.label4.Text = "128"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label11.Location = new System.Drawing.Point(10, 52); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(19, 15); - this.label11.TabIndex = 1; - this.label11.Text = "16"; - // - // label3 - // - this.label3.AutoSize = true; - this.label3.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.label3.Location = new System.Drawing.Point(71, 52); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(19, 15); - this.label3.TabIndex = 1; - this.label3.Text = "64"; - // - // lameBitrateTb - // - this.lameBitrateTb.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.lameBitrateTb.LargeChange = 32; - this.lameBitrateTb.Location = new System.Drawing.Point(6, 22); - this.lameBitrateTb.Maximum = 320; - this.lameBitrateTb.Minimum = 16; - this.lameBitrateTb.Name = "lameBitrateTb"; - this.lameBitrateTb.Size = new System.Drawing.Size(409, 45); - this.lameBitrateTb.SmallChange = 8; - this.lameBitrateTb.TabIndex = 0; - this.lameBitrateTb.TickFrequency = 16; - this.lameBitrateTb.Value = 64; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Enabled = false; - this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point); - this.label1.Location = new System.Drawing.Point(6, 298); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(172, 15); - this.label1.TabIndex = 1; - this.label1.Text = "Using L.A.M.E. encoding engine"; - // - // lameQualityGb - // - this.lameQualityGb.Controls.Add(this.label19); - this.lameQualityGb.Controls.Add(this.label18); - this.lameQualityGb.Controls.Add(this.label17); - this.lameQualityGb.Controls.Add(this.label16); - this.lameQualityGb.Controls.Add(this.label12); - this.lameQualityGb.Controls.Add(this.label15); - this.lameQualityGb.Controls.Add(this.label9); - this.lameQualityGb.Controls.Add(this.label8); - this.lameQualityGb.Controls.Add(this.label13); - this.lameQualityGb.Controls.Add(this.label10); - this.lameQualityGb.Controls.Add(this.label14); - this.lameQualityGb.Controls.Add(this.label2); - this.lameQualityGb.Controls.Add(this.lameVBRQualityTb); - this.lameQualityGb.Location = new System.Drawing.Point(6, 186); - this.lameQualityGb.Name = "lameQualityGb"; - this.lameQualityGb.Size = new System.Drawing.Size(421, 109); - this.lameQualityGb.TabIndex = 0; - this.lameQualityGb.TabStop = false; - this.lameQualityGb.Text = "Quality"; - // - // label19 - // - this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(349, 52); - this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(20, 15); - this.label19.TabIndex = 1; - this.label19.Text = "V8"; - // - // label18 - // - this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(307, 52); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(20, 15); - this.label18.TabIndex = 1; - this.label18.Text = "V7"; - // - // label17 - // - this.label17.AutoSize = true; - this.label17.Location = new System.Drawing.Point(265, 52); - this.label17.Name = "label17"; - this.label17.Size = new System.Drawing.Size(20, 15); - this.label17.TabIndex = 1; - this.label17.Text = "V6"; - // - // label16 - // - this.label16.AutoSize = true; - this.label16.Location = new System.Drawing.Point(223, 52); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(20, 15); - this.label16.TabIndex = 1; - this.label16.Text = "V5"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(182, 52); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(20, 15); - this.label12.TabIndex = 1; - this.label12.Text = "V4"; - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Location = new System.Drawing.Point(140, 52); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(20, 15); - this.label15.TabIndex = 1; - this.label15.Text = "V3"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(97, 52); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(20, 15); - this.label9.TabIndex = 1; - this.label9.Text = "V2"; - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(391, 52); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(20, 15); - this.label8.TabIndex = 1; - this.label8.Text = "V9"; - // - // label13 - // - this.label13.AutoSize = true; - this.label13.Location = new System.Drawing.Point(376, 81); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(39, 15); - this.label13.TabIndex = 1; - this.label13.Text = "Lower"; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(6, 81); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(43, 15); - this.label10.TabIndex = 1; - this.label10.Text = "Higher"; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Location = new System.Drawing.Point(56, 52); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(20, 15); - this.label14.TabIndex = 1; - this.label14.Text = "V1"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(14, 52); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(20, 15); - this.label2.TabIndex = 1; - this.label2.Text = "V0"; - // - // lameVBRQualityTb - // - this.lameVBRQualityTb.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.lameVBRQualityTb.LargeChange = 1; - this.lameVBRQualityTb.Location = new System.Drawing.Point(10, 22); - this.lameVBRQualityTb.Maximum = 9; - this.lameVBRQualityTb.Name = "lameVBRQualityTb"; - this.lameVBRQualityTb.Size = new System.Drawing.Size(405, 45); - this.lameVBRQualityTb.TabIndex = 0; - this.lameVBRQualityTb.Value = 9; - // - // groupBox2 - // - this.groupBox2.Controls.Add(this.lameTargetQualityRb); - this.groupBox2.Controls.Add(this.lameTargetBitrateRb); - this.groupBox2.Location = new System.Drawing.Point(6, 22); - this.groupBox2.Name = "groupBox2"; - this.groupBox2.Size = new System.Drawing.Size(222, 56); - this.groupBox2.TabIndex = 0; - this.groupBox2.TabStop = false; - this.groupBox2.Text = "Target"; - // - // lameTargetQualityRb - // - this.lameTargetQualityRb.AutoSize = true; - this.lameTargetQualityRb.Location = new System.Drawing.Point(138, 23); - this.lameTargetQualityRb.Name = "lameTargetQualityRb"; - this.lameTargetQualityRb.Size = new System.Drawing.Size(63, 19); - this.lameTargetQualityRb.TabIndex = 0; - this.lameTargetQualityRb.TabStop = true; - this.lameTargetQualityRb.Text = "Quality"; - this.lameTargetQualityRb.UseVisualStyleBackColor = true; - this.lameTargetQualityRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged); - // - // lameTargetBitrateRb - // - this.lameTargetBitrateRb.AutoSize = true; - this.lameTargetBitrateRb.Location = new System.Drawing.Point(6, 23); - this.lameTargetBitrateRb.Name = "lameTargetBitrateRb"; - this.lameTargetBitrateRb.Size = new System.Drawing.Size(59, 19); - this.lameTargetBitrateRb.TabIndex = 0; - this.lameTargetBitrateRb.TabStop = true; - this.lameTargetBitrateRb.Text = "Bitrate"; - this.lameTargetBitrateRb.UseVisualStyleBackColor = true; - this.lameTargetBitrateRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged); - // - // mergeOpeningEndCreditsCbox - // - this.mergeOpeningEndCreditsCbox.AutoSize = true; - this.mergeOpeningEndCreditsCbox.Location = new System.Drawing.Point(19, 93); - this.mergeOpeningEndCreditsCbox.Name = "mergeOpeningEndCreditsCbox"; - this.mergeOpeningEndCreditsCbox.Size = new System.Drawing.Size(198, 19); - this.mergeOpeningEndCreditsCbox.TabIndex = 13; - this.mergeOpeningEndCreditsCbox.Text = "[MergeOpeningEndCredits desc]"; - this.mergeOpeningEndCreditsCbox.UseVisualStyleBackColor = true; - // - // retainAaxFileCbox - // - this.retainAaxFileCbox.AutoSize = true; - this.retainAaxFileCbox.Location = new System.Drawing.Point(19, 68); - this.retainAaxFileCbox.Name = "retainAaxFileCbox"; - this.retainAaxFileCbox.Size = new System.Drawing.Size(132, 19); - this.retainAaxFileCbox.TabIndex = 10; - this.retainAaxFileCbox.Text = "[RetainAaxFile desc]"; - this.retainAaxFileCbox.UseVisualStyleBackColor = true; - this.retainAaxFileCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); - // - // downloadCoverArtCbox - // - this.downloadCoverArtCbox.AutoSize = true; - this.downloadCoverArtCbox.Checked = true; - this.downloadCoverArtCbox.CheckState = System.Windows.Forms.CheckState.Checked; - this.downloadCoverArtCbox.Location = new System.Drawing.Point(19, 43); - this.downloadCoverArtCbox.Name = "downloadCoverArtCbox"; - this.downloadCoverArtCbox.Size = new System.Drawing.Size(162, 19); - this.downloadCoverArtCbox.TabIndex = 10; - this.downloadCoverArtCbox.Text = "[DownloadCoverArt desc]"; - this.downloadCoverArtCbox.UseVisualStyleBackColor = true; - this.downloadCoverArtCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); - // - // createCueSheetCbox - // - this.createCueSheetCbox.AutoSize = true; - this.createCueSheetCbox.Checked = true; - this.createCueSheetCbox.CheckState = System.Windows.Forms.CheckState.Checked; - this.createCueSheetCbox.Location = new System.Drawing.Point(19, 18); - this.createCueSheetCbox.Name = "createCueSheetCbox"; - this.createCueSheetCbox.Size = new System.Drawing.Size(145, 19); - this.createCueSheetCbox.TabIndex = 10; - this.createCueSheetCbox.Text = "[CreateCueSheet desc]"; - this.createCueSheetCbox.UseVisualStyleBackColor = true; - this.createCueSheetCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); - // - // SettingsDialog - // - this.AcceptButton = this.saveBtn; - this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.cancelBtn; - this.ClientSize = new System.Drawing.Size(886, 534); - this.Controls.Add(this.tabControl); - this.Controls.Add(this.cancelBtn); - this.Controls.Add(this.saveBtn); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "SettingsDialog"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Edit Settings"; - this.Load += new System.EventHandler(this.SettingsDialog_Load); - this.badBookGb.ResumeLayout(false); - this.badBookGb.PerformLayout(); - this.tabControl.ResumeLayout(false); - this.tab1ImportantSettings.ResumeLayout(false); - this.tab1ImportantSettings.PerformLayout(); - this.booksGb.ResumeLayout(false); - this.booksGb.PerformLayout(); - this.tab2ImportLibrary.ResumeLayout(false); - this.tab2ImportLibrary.PerformLayout(); - this.tab3DownloadDecrypt.ResumeLayout(false); - this.tab3DownloadDecrypt.PerformLayout(); - this.inProgressFilesGb.ResumeLayout(false); - this.inProgressFilesGb.PerformLayout(); - this.customFileNamingGb.ResumeLayout(false); - this.customFileNamingGb.PerformLayout(); - this.tab4AudioFileOptions.ResumeLayout(false); - this.tab4AudioFileOptions.PerformLayout(); - this.audiobookFixupsGb.ResumeLayout(false); - this.audiobookFixupsGb.PerformLayout(); - this.chapterTitleTemplateGb.ResumeLayout(false); - this.chapterTitleTemplateGb.PerformLayout(); - this.lameOptionsGb.ResumeLayout(false); - this.lameOptionsGb.PerformLayout(); - this.lameBitrateGb.ResumeLayout(false); - this.lameBitrateGb.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.lameBitrateTb)).EndInit(); - this.lameQualityGb.ResumeLayout(false); - this.lameQualityGb.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).EndInit(); - this.groupBox2.ResumeLayout(false); - this.groupBox2.PerformLayout(); - this.ResumeLayout(false); + this.chapterTitleTemplateTb.Location = new System.Drawing.Point(6, 22); + this.chapterTitleTemplateTb.Name = "chapterTitleTemplateTb"; + this.chapterTitleTemplateTb.ReadOnly = true; + this.chapterTitleTemplateTb.Size = new System.Drawing.Size(752, 23); + this.chapterTitleTemplateTb.TabIndex = 16; + // + // lameOptionsGb + // + this.lameOptionsGb.Controls.Add(this.lameDownsampleMonoCbox); + this.lameOptionsGb.Controls.Add(this.lameBitrateGb); + this.lameOptionsGb.Controls.Add(this.label1); + this.lameOptionsGb.Controls.Add(this.lameQualityGb); + this.lameOptionsGb.Controls.Add(this.groupBox2); + this.lameOptionsGb.Location = new System.Drawing.Point(415, 6); + this.lameOptionsGb.Name = "lameOptionsGb"; + this.lameOptionsGb.Size = new System.Drawing.Size(433, 323); + this.lameOptionsGb.TabIndex = 14; + this.lameOptionsGb.TabStop = false; + this.lameOptionsGb.Text = "Mp3 Encoding Options"; + // + // lameDownsampleMonoCbox + // + this.lameDownsampleMonoCbox.AutoSize = true; + this.lameDownsampleMonoCbox.Location = new System.Drawing.Point(234, 35); + this.lameDownsampleMonoCbox.Name = "lameDownsampleMonoCbox"; + this.lameDownsampleMonoCbox.Size = new System.Drawing.Size(184, 34); + this.lameDownsampleMonoCbox.TabIndex = 1; + this.lameDownsampleMonoCbox.Text = "Downsample stereo to mono?\r\n(Recommended)\r\n"; + this.lameDownsampleMonoCbox.UseVisualStyleBackColor = true; + // + // lameBitrateGb + // + this.lameBitrateGb.Controls.Add(this.LameMatchSourceBRCbox); + this.lameBitrateGb.Controls.Add(this.lameConstantBitrateCbox); + this.lameBitrateGb.Controls.Add(this.label7); + this.lameBitrateGb.Controls.Add(this.label6); + this.lameBitrateGb.Controls.Add(this.label5); + this.lameBitrateGb.Controls.Add(this.label4); + this.lameBitrateGb.Controls.Add(this.label11); + this.lameBitrateGb.Controls.Add(this.label3); + this.lameBitrateGb.Controls.Add(this.lameBitrateTb); + this.lameBitrateGb.Location = new System.Drawing.Point(6, 84); + this.lameBitrateGb.Name = "lameBitrateGb"; + this.lameBitrateGb.Size = new System.Drawing.Size(421, 101); + this.lameBitrateGb.TabIndex = 0; + this.lameBitrateGb.TabStop = false; + this.lameBitrateGb.Text = "Bitrate"; + // + // LameMatchSourceBRCbox + // + this.LameMatchSourceBRCbox.AutoSize = true; + this.LameMatchSourceBRCbox.Location = new System.Drawing.Point(260, 77); + this.LameMatchSourceBRCbox.Name = "LameMatchSourceBRCbox"; + this.LameMatchSourceBRCbox.Size = new System.Drawing.Size(140, 19); + this.LameMatchSourceBRCbox.TabIndex = 3; + this.LameMatchSourceBRCbox.Text = "Match source bitrate?"; + this.LameMatchSourceBRCbox.UseVisualStyleBackColor = true; + this.LameMatchSourceBRCbox.CheckedChanged += new System.EventHandler(this.LameMatchSourceBRCbox_CheckedChanged); + // + // lameConstantBitrateCbox + // + this.lameConstantBitrateCbox.AutoSize = true; + this.lameConstantBitrateCbox.Location = new System.Drawing.Point(6, 77); + this.lameConstantBitrateCbox.Name = "lameConstantBitrateCbox"; + this.lameConstantBitrateCbox.Size = new System.Drawing.Size(216, 19); + this.lameConstantBitrateCbox.TabIndex = 2; + this.lameConstantBitrateCbox.Text = "Restrict encoder to constant bitrate?"; + this.lameConstantBitrateCbox.UseVisualStyleBackColor = true; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label7.Location = new System.Drawing.Point(390, 52); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(25, 15); + this.label7.TabIndex = 1; + this.label7.Text = "320"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label6.Location = new System.Drawing.Point(309, 52); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(25, 15); + this.label6.TabIndex = 1; + this.label6.Text = "256"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label5.Location = new System.Drawing.Point(228, 52); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(25, 15); + this.label5.TabIndex = 1; + this.label5.Text = "192"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label4.Location = new System.Drawing.Point(147, 52); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(25, 15); + this.label4.TabIndex = 1; + this.label4.Text = "128"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label11.Location = new System.Drawing.Point(10, 52); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(19, 15); + this.label11.TabIndex = 1; + this.label11.Text = "16"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.label3.Location = new System.Drawing.Point(71, 52); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(19, 15); + this.label3.TabIndex = 1; + this.label3.Text = "64"; + // + // lameBitrateTb + // + this.lameBitrateTb.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.lameBitrateTb.LargeChange = 32; + this.lameBitrateTb.Location = new System.Drawing.Point(6, 22); + this.lameBitrateTb.Maximum = 320; + this.lameBitrateTb.Minimum = 16; + this.lameBitrateTb.Name = "lameBitrateTb"; + this.lameBitrateTb.Size = new System.Drawing.Size(409, 45); + this.lameBitrateTb.SmallChange = 8; + this.lameBitrateTb.TabIndex = 0; + this.lameBitrateTb.TickFrequency = 16; + this.lameBitrateTb.Value = 64; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Enabled = false; + this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point); + this.label1.Location = new System.Drawing.Point(6, 298); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(172, 15); + this.label1.TabIndex = 1; + this.label1.Text = "Using L.A.M.E. encoding engine"; + // + // lameQualityGb + // + this.lameQualityGb.Controls.Add(this.label19); + this.lameQualityGb.Controls.Add(this.label18); + this.lameQualityGb.Controls.Add(this.label17); + this.lameQualityGb.Controls.Add(this.label16); + this.lameQualityGb.Controls.Add(this.label12); + this.lameQualityGb.Controls.Add(this.label15); + this.lameQualityGb.Controls.Add(this.label9); + this.lameQualityGb.Controls.Add(this.label8); + this.lameQualityGb.Controls.Add(this.label13); + this.lameQualityGb.Controls.Add(this.label10); + this.lameQualityGb.Controls.Add(this.label14); + this.lameQualityGb.Controls.Add(this.label2); + this.lameQualityGb.Controls.Add(this.lameVBRQualityTb); + this.lameQualityGb.Location = new System.Drawing.Point(6, 186); + this.lameQualityGb.Name = "lameQualityGb"; + this.lameQualityGb.Size = new System.Drawing.Size(421, 109); + this.lameQualityGb.TabIndex = 0; + this.lameQualityGb.TabStop = false; + this.lameQualityGb.Text = "Quality"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(349, 52); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(20, 15); + this.label19.TabIndex = 1; + this.label19.Text = "V8"; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(307, 52); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(20, 15); + this.label18.TabIndex = 1; + this.label18.Text = "V7"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(265, 52); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(20, 15); + this.label17.TabIndex = 1; + this.label17.Text = "V6"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(223, 52); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(20, 15); + this.label16.TabIndex = 1; + this.label16.Text = "V5"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(182, 52); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(20, 15); + this.label12.TabIndex = 1; + this.label12.Text = "V4"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(140, 52); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(20, 15); + this.label15.TabIndex = 1; + this.label15.Text = "V3"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(97, 52); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(20, 15); + this.label9.TabIndex = 1; + this.label9.Text = "V2"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(391, 52); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(20, 15); + this.label8.TabIndex = 1; + this.label8.Text = "V9"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(376, 81); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(39, 15); + this.label13.TabIndex = 1; + this.label13.Text = "Lower"; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(6, 81); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(43, 15); + this.label10.TabIndex = 1; + this.label10.Text = "Higher"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(56, 52); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(20, 15); + this.label14.TabIndex = 1; + this.label14.Text = "V1"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(14, 52); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(20, 15); + this.label2.TabIndex = 1; + this.label2.Text = "V0"; + // + // lameVBRQualityTb + // + this.lameVBRQualityTb.BackColor = System.Drawing.SystemColors.ControlLightLight; + this.lameVBRQualityTb.LargeChange = 1; + this.lameVBRQualityTb.Location = new System.Drawing.Point(10, 22); + this.lameVBRQualityTb.Maximum = 9; + this.lameVBRQualityTb.Name = "lameVBRQualityTb"; + this.lameVBRQualityTb.Size = new System.Drawing.Size(405, 45); + this.lameVBRQualityTb.TabIndex = 0; + this.lameVBRQualityTb.Value = 9; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.lameTargetQualityRb); + this.groupBox2.Controls.Add(this.lameTargetBitrateRb); + this.groupBox2.Location = new System.Drawing.Point(6, 22); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(222, 56); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Target"; + // + // lameTargetQualityRb + // + this.lameTargetQualityRb.AutoSize = true; + this.lameTargetQualityRb.Location = new System.Drawing.Point(138, 23); + this.lameTargetQualityRb.Name = "lameTargetQualityRb"; + this.lameTargetQualityRb.Size = new System.Drawing.Size(63, 19); + this.lameTargetQualityRb.TabIndex = 0; + this.lameTargetQualityRb.TabStop = true; + this.lameTargetQualityRb.Text = "Quality"; + this.lameTargetQualityRb.UseVisualStyleBackColor = true; + this.lameTargetQualityRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged); + // + // lameTargetBitrateRb + // + this.lameTargetBitrateRb.AutoSize = true; + this.lameTargetBitrateRb.Location = new System.Drawing.Point(6, 23); + this.lameTargetBitrateRb.Name = "lameTargetBitrateRb"; + this.lameTargetBitrateRb.Size = new System.Drawing.Size(59, 19); + this.lameTargetBitrateRb.TabIndex = 0; + this.lameTargetBitrateRb.TabStop = true; + this.lameTargetBitrateRb.Text = "Bitrate"; + this.lameTargetBitrateRb.UseVisualStyleBackColor = true; + this.lameTargetBitrateRb.CheckedChanged += new System.EventHandler(this.lameTargetRb_CheckedChanged); + // + // mergeOpeningEndCreditsCbox + // + this.mergeOpeningEndCreditsCbox.AutoSize = true; + this.mergeOpeningEndCreditsCbox.Location = new System.Drawing.Point(19, 93); + this.mergeOpeningEndCreditsCbox.Name = "mergeOpeningEndCreditsCbox"; + this.mergeOpeningEndCreditsCbox.Size = new System.Drawing.Size(198, 19); + this.mergeOpeningEndCreditsCbox.TabIndex = 13; + this.mergeOpeningEndCreditsCbox.Text = "[MergeOpeningEndCredits desc]"; + this.mergeOpeningEndCreditsCbox.UseVisualStyleBackColor = true; + // + // retainAaxFileCbox + // + this.retainAaxFileCbox.AutoSize = true; + this.retainAaxFileCbox.Location = new System.Drawing.Point(19, 68); + this.retainAaxFileCbox.Name = "retainAaxFileCbox"; + this.retainAaxFileCbox.Size = new System.Drawing.Size(132, 19); + this.retainAaxFileCbox.TabIndex = 10; + this.retainAaxFileCbox.Text = "[RetainAaxFile desc]"; + this.retainAaxFileCbox.UseVisualStyleBackColor = true; + this.retainAaxFileCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); + // + // downloadCoverArtCbox + // + this.downloadCoverArtCbox.AutoSize = true; + this.downloadCoverArtCbox.Checked = true; + this.downloadCoverArtCbox.CheckState = System.Windows.Forms.CheckState.Checked; + this.downloadCoverArtCbox.Location = new System.Drawing.Point(19, 43); + this.downloadCoverArtCbox.Name = "downloadCoverArtCbox"; + this.downloadCoverArtCbox.Size = new System.Drawing.Size(162, 19); + this.downloadCoverArtCbox.TabIndex = 10; + this.downloadCoverArtCbox.Text = "[DownloadCoverArt desc]"; + this.downloadCoverArtCbox.UseVisualStyleBackColor = true; + this.downloadCoverArtCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); + // + // createCueSheetCbox + // + this.createCueSheetCbox.AutoSize = true; + this.createCueSheetCbox.Checked = true; + this.createCueSheetCbox.CheckState = System.Windows.Forms.CheckState.Checked; + this.createCueSheetCbox.Location = new System.Drawing.Point(19, 18); + this.createCueSheetCbox.Name = "createCueSheetCbox"; + this.createCueSheetCbox.Size = new System.Drawing.Size(145, 19); + this.createCueSheetCbox.TabIndex = 10; + this.createCueSheetCbox.Text = "[CreateCueSheet desc]"; + this.createCueSheetCbox.UseVisualStyleBackColor = true; + this.createCueSheetCbox.CheckedChanged += new System.EventHandler(this.allowLibationFixupCbox_CheckedChanged); + // + // SettingsDialog + // + this.AcceptButton = this.saveBtn; + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.cancelBtn; + this.ClientSize = new System.Drawing.Size(886, 534); + this.Controls.Add(this.tabControl); + this.Controls.Add(this.cancelBtn); + this.Controls.Add(this.saveBtn); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "SettingsDialog"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Edit Settings"; + this.Load += new System.EventHandler(this.SettingsDialog_Load); + this.badBookGb.ResumeLayout(false); + this.badBookGb.PerformLayout(); + this.tabControl.ResumeLayout(false); + this.tab1ImportantSettings.ResumeLayout(false); + this.tab1ImportantSettings.PerformLayout(); + this.booksGb.ResumeLayout(false); + this.booksGb.PerformLayout(); + this.tab2ImportLibrary.ResumeLayout(false); + this.tab2ImportLibrary.PerformLayout(); + this.tab3DownloadDecrypt.ResumeLayout(false); + this.tab3DownloadDecrypt.PerformLayout(); + this.inProgressFilesGb.ResumeLayout(false); + this.inProgressFilesGb.PerformLayout(); + this.customFileNamingGb.ResumeLayout(false); + this.customFileNamingGb.PerformLayout(); + this.tab4AudioFileOptions.ResumeLayout(false); + this.tab4AudioFileOptions.PerformLayout(); + this.audiobookFixupsGb.ResumeLayout(false); + this.audiobookFixupsGb.PerformLayout(); + this.chapterTitleTemplateGb.ResumeLayout(false); + this.chapterTitleTemplateGb.PerformLayout(); + this.lameOptionsGb.ResumeLayout(false); + this.lameOptionsGb.PerformLayout(); + this.lameBitrateGb.ResumeLayout(false); + this.lameBitrateGb.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.lameBitrateTb)).EndInit(); + this.lameQualityGb.ResumeLayout(false); + this.lameQualityGb.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.lameVBRQualityTb)).EndInit(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); } diff --git a/Source/_Tests/FileManager.Tests/FileUtilityTests.cs b/Source/_Tests/FileManager.Tests/FileUtilityTests.cs index 2c060aa2..b82c3d94 100644 --- a/Source/_Tests/FileManager.Tests/FileUtilityTests.cs +++ b/Source/_Tests/FileManager.Tests/FileUtilityTests.cs @@ -83,17 +83,17 @@ namespace FileUtilityTests [TestMethod] // empty replacement [DataRow("http://test.com/a/b/c", "http꞉∕∕test.com∕a∕b∕c")] - public void DefaultReplacementTest(string inStr, string outStr) => Default.ReplaceInvalidFilenameChars(inStr).Should().Be(outStr); + public void DefaultReplacementTest(string inStr, string outStr) => Default.ReplaceFilenameChars(inStr).Should().Be(outStr); [TestMethod] // empty replacement [DataRow("http://test.com/a/b/c", "http-__test.com_a_b_c")] - public void LoFiDefaultReplacementTest(string inStr, string outStr) => LoFiDefault.ReplaceInvalidFilenameChars(inStr).Should().Be(outStr); + public void LoFiDefaultReplacementTest(string inStr, string outStr) => LoFiDefault.ReplaceFilenameChars(inStr).Should().Be(outStr); [TestMethod] // empty replacement [DataRow("http://test.com/a/b/c", "http___test.com_a_b_c")] - public void BarebonesDefaultReplacementTest(string inStr, string outStr) => Barebones.ReplaceInvalidFilenameChars(inStr).Should().Be(outStr); + public void BarebonesDefaultReplacementTest(string inStr, string outStr) => Barebones.ReplaceFilenameChars(inStr).Should().Be(outStr); } [TestClass] From 94469cae3d9a70396eb4492cad1eb48ec5e83877 Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo Date: Thu, 15 Dec 2022 16:22:25 -0700 Subject: [PATCH 3/6] Add better error messages for license denial #352 --- Source/LibationAvalonia/LogMe.cs | 15 ++-- .../ViewModels/ProcessBookViewModel.cs | 25 +++++- .../ViewModels/ProcessQueueViewModel.cs | 16 +++- .../ProcessQueue/ProcessBook.cs | 23 +++++- .../ProcessQueue/ProcessBookControl.cs | 76 +++++-------------- .../ProcessQueue/ProcessQueueControl.cs | 14 ++++ 6 files changed, 98 insertions(+), 71 deletions(-) diff --git a/Source/LibationAvalonia/LogMe.cs b/Source/LibationAvalonia/LogMe.cs index 19d1304c..07432a19 100644 --- a/Source/LibationAvalonia/LogMe.cs +++ b/Source/LibationAvalonia/LogMe.cs @@ -1,4 +1,5 @@ -using System; +using Avalonia.Threading; +using System; using System.Threading.Tasks; namespace LibationAvalonia @@ -40,19 +41,15 @@ namespace LibationAvalonia private static async void LogMe_LogError(object sender, (Exception, string) tuple) { - await Task.Run(() => LogForm?.WriteLine(tuple.Item2 ?? "Automated backup: error")); - await Task.Run(() => LogForm?.WriteLine("ERROR: " + tuple.Item1.Message)); + await Dispatcher.UIThread.InvokeAsync(() => LogForm?.WriteLine(tuple.Item2 ?? "Automated backup: error")); + await Dispatcher.UIThread.InvokeAsync(() => LogForm?.WriteLine("ERROR: " + tuple.Item1.Message)); } private static async void LogMe_LogErrorString(object sender, string text) - { - await Task.Run(() => LogForm?.WriteLine(text)); - } + => await Dispatcher.UIThread.InvokeAsync(() => LogForm?.WriteLine(text)); private static async void LogMe_LogInfo(object sender, string text) - { - await Task.Run(() => LogForm?.WriteLine(text)); - } + => await Dispatcher.UIThread.InvokeAsync(() => LogForm?.WriteLine(text)); public void Info(string text) => LogInfo?.Invoke(this, text); public void Error(string text) => LogErrorString?.Invoke(this, text); diff --git a/Source/LibationAvalonia/ViewModels/ProcessBookViewModel.cs b/Source/LibationAvalonia/ViewModels/ProcessBookViewModel.cs index c4008b58..13f23bc8 100644 --- a/Source/LibationAvalonia/ViewModels/ProcessBookViewModel.cs +++ b/Source/LibationAvalonia/ViewModels/ProcessBookViewModel.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using ApplicationServices; +using AudibleApi; +using AudibleApi.Common; using Avalonia.Media; using Avalonia.Media.Imaging; using DataLayer; @@ -22,7 +24,9 @@ namespace LibationAvalonia.ViewModels ValidationFail, FailedRetry, FailedSkip, - FailedAbort + FailedAbort, + LicenseDenied, + LicenseDeniedPossibleOutage } public enum ProcessBookStatus @@ -80,6 +84,8 @@ namespace LibationAvalonia.ViewModels ProcessBookResult.FailedRetry => "Error, will retry later", ProcessBookResult.FailedSkip => "Error, Skippping", ProcessBookResult.FailedAbort => "Error, Abort", + ProcessBookResult.LicenseDenied => "License Denied", + ProcessBookResult.LicenseDeniedPossibleOutage => "Possible Service Interruption", _ => Status.ToString(), }; @@ -134,18 +140,31 @@ namespace LibationAvalonia.ViewModels return Result = ProcessBookResult.Success; else if (statusHandler.Errors.Contains("Cancelled")) { - Logger.Info($"{procName}: Process was cancelled {LibraryBook.Book}"); + Logger.Info($"{procName}: Process was cancelled - {LibraryBook.Book}"); return Result = ProcessBookResult.Cancelled; } else if (statusHandler.Errors.Contains("Validation failed")) { - Logger.Info($"{procName}: Validation failed {LibraryBook.Book}"); + Logger.Info($"{procName}: Validation failed - {LibraryBook.Book}"); return Result = ProcessBookResult.ValidationFail; } foreach (var errorMessage in statusHandler.Errors) Logger.Error($"{procName}: {errorMessage}"); } + catch (ContentLicenseDeniedException ldex) + { + if (ldex.AYCL?.RejectionReason is null or RejectionReason.GenericError) + { + Logger.Info($"{procName}: Content license was denied, but this error appears to be caused by a temporary interruption of service. - {LibraryBook.Book}"); + return Result = ProcessBookResult.LicenseDeniedPossibleOutage; + } + else + { + Logger.Info($"{procName}: Content license denied. Check your Audible account to see if you have access to this title. - {LibraryBook.Book}"); + return Result = ProcessBookResult.LicenseDenied; + } + } catch (Exception ex) { Logger.Error(ex, procName); diff --git a/Source/LibationAvalonia/ViewModels/ProcessQueueViewModel.cs b/Source/LibationAvalonia/ViewModels/ProcessQueueViewModel.cs index 93521f6d..45631b66 100644 --- a/Source/LibationAvalonia/ViewModels/ProcessQueueViewModel.cs +++ b/Source/LibationAvalonia/ViewModels/ProcessQueueViewModel.cs @@ -163,6 +163,8 @@ namespace LibationAvalonia.ViewModels using var counterTimer = new System.Threading.Timer(CounterTimer_Tick, null, 0, 500); + bool shownServiceOutageMessage = false; + while (Queue.MoveNext()) { var nextBook = Queue.Current; @@ -178,7 +180,19 @@ namespace LibationAvalonia.ViewModels else if (result == ProcessBookResult.FailedAbort) Queue.ClearQueue(); else if (result == ProcessBookResult.FailedSkip) - nextBook.LibraryBook.Book.UpdateBookStatus(DataLayer.LiberatedStatus.Error); + nextBook.LibraryBook.Book.UpdateBookStatus(LiberatedStatus.Error); + else if (result == ProcessBookResult.LicenseDeniedPossibleOutage && !shownServiceOutageMessage) + { + await MessageBox.Show(@$" +You were denied a content license for {nextBook.LibraryBook.Book.Title} + +This error appears to be caused by a temporary interruption of service that sometimes affects Libation's users. This type of error usually resolves itself in 1 to 2 days, and in the meantime you should still be able to access your books through Audible's website or app. +", + "Possible Interruption of Service", + MessageBoxButtons.OK, + MessageBoxIcon.Asterisk); + shownServiceOutageMessage = true; + } } Serilog.Log.Logger.Information("Completed processing queue"); diff --git a/Source/LibationWinForms/ProcessQueue/ProcessBook.cs b/Source/LibationWinForms/ProcessQueue/ProcessBook.cs index fffd0d78..0ff85a9e 100644 --- a/Source/LibationWinForms/ProcessQueue/ProcessBook.cs +++ b/Source/LibationWinForms/ProcessQueue/ProcessBook.cs @@ -7,6 +7,8 @@ using System.Runtime.CompilerServices; using System.Threading.Tasks; using System.Windows.Forms; using ApplicationServices; +using AudibleApi.Common; +using AudibleApi; using DataLayer; using Dinah.Core; using Dinah.Core.ErrorHandling; @@ -24,7 +26,9 @@ namespace LibationWinForms.ProcessQueue ValidationFail, FailedRetry, FailedSkip, - FailedAbort + FailedAbort, + LicenseDenied, + LicenseDeniedPossibleOutage } public enum ProcessBookStatus @@ -108,18 +112,31 @@ namespace LibationWinForms.ProcessQueue return Result = ProcessBookResult.Success; else if (statusHandler.Errors.Contains("Cancelled")) { - Logger.Info($"{procName}: Process was cancelled {LibraryBook.Book}"); + Logger.Info($"{procName}: Process was cancelled - {LibraryBook.Book}"); return Result = ProcessBookResult.Cancelled; } else if (statusHandler.Errors.Contains("Validation failed")) { - Logger.Info($"{procName}: Validation failed {LibraryBook.Book}"); + Logger.Info($"{procName}: Validation failed - {LibraryBook.Book}"); return Result = ProcessBookResult.ValidationFail; } foreach (var errorMessage in statusHandler.Errors) Logger.Error($"{procName}: {errorMessage}"); } + catch (ContentLicenseDeniedException ldex) + { + if (ldex.AYCL?.RejectionReason is null or RejectionReason.GenericError) + { + Logger.Info($"{procName}: Content license was denied, but this error appears to be caused by a temporary interruption of service. - {LibraryBook.Book}"); + return Result = ProcessBookResult.LicenseDeniedPossibleOutage; + } + else + { + Logger.Info($"{procName}: Content license denied. Check your Audible account to see if you have access to this title. - {LibraryBook.Book}"); + return Result = ProcessBookResult.LicenseDenied; + } + } catch (Exception ex) { Logger.Error(ex, procName); diff --git a/Source/LibationWinForms/ProcessQueue/ProcessBookControl.cs b/Source/LibationWinForms/ProcessQueue/ProcessBookControl.cs index 62062468..3254f5d0 100644 --- a/Source/LibationWinForms/ProcessQueue/ProcessBookControl.cs +++ b/Source/LibationWinForms/ProcessQueue/ProcessBookControl.cs @@ -60,68 +60,34 @@ namespace LibationWinForms.ProcessQueue public void SetResult(ProcessBookResult result) { - string statusText = default; - switch (result) + (string statusText, ProcessBookStatus status) = result switch { - case ProcessBookResult.Success: - statusText = "Finished"; - Status = ProcessBookStatus.Completed; - break; - case ProcessBookResult.Cancelled: - statusText = "Cancelled"; - Status = ProcessBookStatus.Cancelled; - break; - case ProcessBookResult.FailedRetry: - statusText = "Error, will retry later"; - Status = ProcessBookStatus.Failed; - break; - case ProcessBookResult.FailedSkip: - statusText = "Error, Skippping"; - Status = ProcessBookStatus.Failed; - break; - case ProcessBookResult.FailedAbort: - statusText = "Error, Abort"; - Status = ProcessBookStatus.Failed; - break; - case ProcessBookResult.ValidationFail: - statusText = "Validion fail"; - Status = ProcessBookStatus.Failed; - break; - case ProcessBookResult.None: - statusText = "UNKNOWN"; - Status = ProcessBookStatus.Failed; - break; - } + ProcessBookResult.Success => ("Finished", ProcessBookStatus.Completed), + ProcessBookResult.Cancelled => ("Cancelled", ProcessBookStatus.Cancelled), + ProcessBookResult.FailedRetry => ("Error, will retry later", ProcessBookStatus.Failed), + ProcessBookResult.FailedSkip => ("Error, Skippping", ProcessBookStatus.Failed), + ProcessBookResult.FailedAbort => ("Error, Abort", ProcessBookStatus.Failed), + ProcessBookResult.ValidationFail => ("Validion fail", ProcessBookStatus.Failed), + ProcessBookResult.LicenseDenied => ("License Denied", ProcessBookStatus.Failed), + ProcessBookResult.LicenseDeniedPossibleOutage => ("Possible Service Interruption", ProcessBookStatus.Failed), + _ => ("UNKNOWN", ProcessBookStatus.Failed), + }; - SetStatus(Status, statusText); + SetStatus(status, statusText); } public void SetStatus(ProcessBookStatus status, string statusText = null) { - Color backColor = default; - switch (status) + Status = status; + + Color backColor = Status switch { - case ProcessBookStatus.Completed: - backColor = SuccessColor; - Status = ProcessBookStatus.Completed; - break; - case ProcessBookStatus.Cancelled: - backColor = CancelledColor; - Status = ProcessBookStatus.Cancelled; - break; - case ProcessBookStatus.Queued: - backColor = QueuedColor; - Status = ProcessBookStatus.Queued; - break; - case ProcessBookStatus.Working: - backColor = QueuedColor; - Status = ProcessBookStatus.Working; - break; - case ProcessBookStatus.Failed: - backColor = FailedColor; - Status = ProcessBookStatus.Failed; - break; - } + ProcessBookStatus.Completed => SuccessColor, + ProcessBookStatus.Cancelled => CancelledColor, + ProcessBookStatus.Queued => QueuedColor, + ProcessBookStatus.Working => QueuedColor, + _ => FailedColor + }; SuspendLayout(); diff --git a/Source/LibationWinForms/ProcessQueue/ProcessQueueControl.cs b/Source/LibationWinForms/ProcessQueue/ProcessQueueControl.cs index dfae3673..baf7a8ea 100644 --- a/Source/LibationWinForms/ProcessQueue/ProcessQueueControl.cs +++ b/Source/LibationWinForms/ProcessQueue/ProcessQueueControl.cs @@ -161,6 +161,8 @@ namespace LibationWinForms.ProcessQueue StartingTime = DateTime.Now; counterTimer.Start(); + bool shownServiceOutageMessage = false; + while (Queue.MoveNext()) { var nextBook = Queue.Current; @@ -177,6 +179,18 @@ namespace LibationWinForms.ProcessQueue Queue.ClearQueue(); else if (result == ProcessBookResult.FailedSkip) nextBook.LibraryBook.Book.UpdateBookStatus(DataLayer.LiberatedStatus.Error); + else if (result == ProcessBookResult.LicenseDeniedPossibleOutage && !shownServiceOutageMessage) + { + MessageBox.Show(@$" +You were denied a content license for {nextBook.LibraryBook.Book.Title} + +This error appears to be caused by a temporary interruption of service that sometimes affects Libation's users. This type of error usually resolves itself in 1 to 2 days, and in the meantime you should still be able to access your books through Audible's website or app. +", + "Possible Interruption of Service", + MessageBoxButtons.OK, + MessageBoxIcon.Asterisk); + shownServiceOutageMessage = true; + } } Serilog.Log.Logger.Information("Completed processing queue"); From 210ab065c2b472b6729753d7f96ad67d30b0c942 Mon Sep 17 00:00:00 2001 From: MBucari Date: Thu, 15 Dec 2022 23:04:27 -0700 Subject: [PATCH 4/6] Make tests xplat --- Source/FileManager/ReplacementCharacters.cs | 31 +++- .../FileNamingTemplateTests.cs | 35 ++-- .../FileManager.Tests/FileUtilityTests.cs | 138 +++++++++----- .../TemplatesTests.cs | 171 +++++++++++------- 4 files changed, 242 insertions(+), 133 deletions(-) diff --git a/Source/FileManager/ReplacementCharacters.cs b/Source/FileManager/ReplacementCharacters.cs index 6c228411..85b65317 100644 --- a/Source/FileManager/ReplacementCharacters.cs +++ b/Source/FileManager/ReplacementCharacters.cs @@ -91,10 +91,10 @@ namespace FileManager { Replacement.OtherInvalid("_"), Replacement.FilenameForwardSlash("∕"), - Replacement.FilenameBackSlash(""), + Replacement.FilenameBackSlash("\\"), Replacement.OpenQuote("“"), Replacement.CloseQuote("”"), - Replacement.OtherQuote(""") + Replacement.OtherQuote("\"") } }; @@ -115,7 +115,18 @@ namespace FileManager Replacement.Colon("-"), } } - : Barebones; + : new () + { + Replacements = new Replacement[] + { + Replacement.OtherInvalid("_"), + Replacement.FilenameForwardSlash("_"), + Replacement.FilenameBackSlash("\\"), + Replacement.OpenQuote("\""), + Replacement.CloseQuote("\""), + Replacement.OtherQuote("\"") + } + }; public static readonly ReplacementCharacters Barebones = IsWindows @@ -164,13 +175,10 @@ namespace FileManager private string GetFilenameCharReplacement(char toReplace, char preceding, char succeding) { - if (invalidSlashes.Contains(toReplace)) - { - if (toReplace == ForwardSlash.CharacterToReplace) - return ForwardSlash.ReplacementString; - else - return BackSlash.ReplacementString; - } + if (toReplace == ForwardSlash.CharacterToReplace) + return ForwardSlash.ReplacementString; + else if (toReplace == BackSlash.CharacterToReplace) + return BackSlash.ReplacementString; else return GetPathCharReplacement(toReplace, preceding, succeding); } private string GetPathCharReplacement(char toReplace, char preceding, char succeding) @@ -199,6 +207,9 @@ namespace FileManager return OtherQuote; } + if (!IsWindows && toReplace == BackSlash.CharacterToReplace) + return BackSlash.ReplacementString; + //Replace any other non-mandatory characters for (int i = Replacement.FIXED_COUNT; i < Replacements.Count; i++) { diff --git a/Source/_Tests/FileManager.Tests/FileNamingTemplateTests.cs b/Source/_Tests/FileManager.Tests/FileNamingTemplateTests.cs index 9a2d8a30..f98868cf 100644 --- a/Source/_Tests/FileManager.Tests/FileNamingTemplateTests.cs +++ b/Source/_Tests/FileManager.Tests/FileNamingTemplateTests.cs @@ -15,16 +15,18 @@ namespace FileNamingTemplateTests static ReplacementCharacters Replacements = ReplacementCharacters.Default; [TestMethod] - public void equiv_GetValidFilename() + [DataRow(@"C:\foo\bar", @"C:\foo\bar\my꞉ book 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [ID123456].txt", PlatformID.Win32NT)] + [DataRow(@"/foo/bar", @"/foo/bar/my: book 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [ID123456].txt", PlatformID.Unix)] + public void equiv_GetValidFilename(string dirFullPath, string expected, PlatformID platformID) { + if (Environment.OSVersion.Platform != platformID) + return; + var sb = new System.Text.StringBuilder(); sb.Append('0', 300); var longText = sb.ToString(); - var expectedNew = @"C:\foo\bar\my꞉ book 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 [ID123456].txt"; - var f2 = NEW_GetValidFilename_FileNamingTemplate(@"C:\foo\bar", "my: book " + longText, "txt", "ID123456"); - - f2.Should().Be(expectedNew); + NEW_GetValidFilename_FileNamingTemplate(dirFullPath, "my: book " + longText, "txt", "ID123456").Should().Be(expected); } private static string NEW_GetValidFilename_FileNamingTemplate(string dirFullPath, string filename, string extension, string metadataSuffix) @@ -40,12 +42,12 @@ namespace FileNamingTemplateTests } [TestMethod] - public void equiv_GetMultipartFileName() + [DataRow(@"C:\foo\bar\my file.txt", @"C:\foo\bar\my file - 002 - title.txt", PlatformID.Win32NT)] + [DataRow(@"/foo/bar/my file.txt", @"/foo/bar/my file - 002 - title.txt", PlatformID.Unix)] + public void equiv_GetMultipartFileName(string inStr, string outStr, PlatformID platformID) { - var expected = @"C:\foo\bar\my file - 002 - title.txt"; - var f2 = NEW_GetMultipartFileName_FileNamingTemplate(@"C:\foo\bar\my file.txt", 2, 100, "title"); - - f2.Should().Be(expected); + if (Environment.OSVersion.Platform == platformID) + NEW_GetMultipartFileName_FileNamingTemplate(inStr, 2, 100, "title").Should().Be(outStr); } private static string NEW_GetMultipartFileName_FileNamingTemplate(string originalPath, int partsPosition, int partsTotal, string suffix) @@ -64,11 +66,16 @@ namespace FileNamingTemplateTests } [TestMethod] - public void remove_slashes() + [DataRow(@"\foo\.txt", @"\foo\sl∕as∕he∕s.txt", PlatformID.Win32NT)] + [DataRow(@"/foo/<title>.txt", @"/foo/s\l∕a\s∕h\e∕s.txt", PlatformID.Unix)] + public void remove_slashes(string inStr, string outStr, PlatformID platformID) { - var fileNamingTemplate = new FileNamingTemplate(@"\foo\<title>.txt"); - fileNamingTemplate.AddParameterReplacement("title", @"s\l/a\s/h\e/s"); - fileNamingTemplate.GetFilePath(Replacements).PathWithoutPrefix.Should().Be(@"\foo\sl∕as∕he∕s.txt"); + if (Environment.OSVersion.Platform == platformID) + { + var fileNamingTemplate = new FileNamingTemplate(inStr); + fileNamingTemplate.AddParameterReplacement("title", @"s\l/a\s/h\e/s"); + fileNamingTemplate.GetFilePath(Replacements).PathWithoutPrefix.Should().Be(outStr); + } } } } diff --git a/Source/_Tests/FileManager.Tests/FileUtilityTests.cs b/Source/_Tests/FileManager.Tests/FileUtilityTests.cs index b82c3d94..325113af 100644 --- a/Source/_Tests/FileManager.Tests/FileUtilityTests.cs +++ b/Source/_Tests/FileManager.Tests/FileUtilityTests.cs @@ -21,51 +21,78 @@ namespace FileUtilityTests [TestMethod] // non-empty replacement - [DataRow("abc*abc.txt", "abc✱abc.txt")] - // standardize slashes - [DataRow(@"a/b\c/d", @"a\b\c\d")] + [DataRow("abc*abc.txt", "abc✱abc.txt", PlatformID.Win32NT)] + [DataRow("abc*abc.txt", "abc*abc.txt", PlatformID.Unix)] + // standardize slashes. There is no unix equivalent because there is no alt directory separator + [DataRow(@"a/b\c/d", @"a\b\c\d", PlatformID.Win32NT)] // remove illegal chars - [DataRow("a*?:z.txt", "a✱?꞉z.txt")] + [DataRow("a*?:z.txt", "a✱?꞉z.txt", PlatformID.Win32NT)] + [DataRow("a*?:z.txt", "a*?:z.txt", PlatformID.Unix)] // retain drive letter path colon - [DataRow(@"C:\az.txt", @"C:\az.txt")] + [DataRow(@"C:\az.txt", @"C:\az.txt", PlatformID.Win32NT)] + [DataRow(@"/:/az.txt", @"/:/az.txt", PlatformID.Unix)] // replace all other colons - [DataRow(@"a\b:c\d.txt", @"a\b꞉c\d.txt")] + [DataRow(@"a\b:c\d.txt", @"a\b꞉c\d.txt", PlatformID.Win32NT)] + [DataRow(@"a/b:c/d.txt", @"a/b:c/d.txt", PlatformID.Unix)] // remove empty directories - [DataRow(@"C:\a\\\b\c\\\d.txt", @"C:\a\b\c\d.txt")] - [DataRow(@"C:\""foo\<id>", @"C:\“foo\<id>")] - public void DefaultTests(string inStr, string outStr) => Assert.AreEqual(outStr, FileUtility.GetSafePath(inStr, Default).PathWithoutPrefix); + [DataRow(@"C:\a\\\b\c\\\d.txt", @"C:\a\b\c\d.txt", PlatformID.Win32NT)] + [DataRow(@"/a///b/c///d.txt", @"/a/b/c/d.txt", PlatformID.Unix)] + [DataRow(@"C:\""foo\<id>", @"C:\“foo\<id>", PlatformID.Win32NT)] + [DataRow(@"/""foo/<id>", @"/“foo/<id>", PlatformID.Unix)] + public void DefaultTests(string inStr, string outStr, PlatformID platformID) + => Test(inStr, outStr, Default, platformID); [TestMethod] // non-empty replacement - [DataRow("abc*abc.txt", "abc_abc.txt")] - // standardize slashes - [DataRow(@"a/b\c/d", @"a\b\c\d")] + [DataRow("abc*abc.txt", "abc_abc.txt", PlatformID.Win32NT)] + [DataRow("abc*abc.txt", "abc*abc.txt", PlatformID.Unix)] + // standardize slashes. There is no unix equivalent because there is no alt directory separator + [DataRow(@"a/b\c/d", @"a\b\c\d", PlatformID.Win32NT)] // remove illegal chars - [DataRow("a*?:z.txt", "a__-z.txt")] + [DataRow("a*?:z.txt", "a__-z.txt", PlatformID.Win32NT)] + [DataRow("a*?:z.txt", "a*?:z.txt", PlatformID.Unix)] // retain drive letter path colon - [DataRow(@"C:\az.txt", @"C:\az.txt")] + [DataRow(@"C:\az.txt", @"C:\az.txt", PlatformID.Win32NT)] + [DataRow(@"/:az.txt", @"/:az.txt", PlatformID.Unix)] // replace all other colons - [DataRow(@"a\b:c\d.txt", @"a\b-c\d.txt")] + [DataRow(@"a\b:c\d.txt", @"a\b-c\d.txt", PlatformID.Win32NT)] + [DataRow(@"a/b:c/d.txt", @"a/b:c/d.txt", PlatformID.Unix)] // remove empty directories - [DataRow(@"C:\a\\\b\c\\\d.txt", @"C:\a\b\c\d.txt")] - [DataRow(@"C:\""foo\<id>", @"C:\'foo\{id}")] - public void LoFiDefaultTests(string inStr, string outStr) => Assert.AreEqual(outStr, FileUtility.GetSafePath(inStr, LoFiDefault).PathWithoutPrefix); + [DataRow(@"C:\a\\\b\c\\\d.txt", @"C:\a\b\c\d.txt", PlatformID.Win32NT)] + [DataRow(@"/a///b/c///d.txt", @"/a/b/c/d.txt", PlatformID.Unix)] + [DataRow(@"C:\""foo\<id>", @"C:\'foo\{id}", PlatformID.Win32NT)] + [DataRow(@"/""foo/<id>", @"/""foo/<id>", PlatformID.Unix)] + public void LoFiDefaultTests(string inStr, string outStr, PlatformID platformID) + => Test(inStr, outStr, LoFiDefault, platformID); [TestMethod] // empty replacement - [DataRow("abc*abc.txt", "abc_abc.txt")] - // standardize slashes - [DataRow(@"a/b\c/d", @"a\b\c\d")] + [DataRow("abc*abc.txt", "abc_abc.txt", PlatformID.Win32NT)] + [DataRow("abc*abc.txt", "abc*abc.txt", PlatformID.Unix)] + // standardize slashes. There is no unix equivalent because there is no alt directory separator + [DataRow(@"a/b\c/d", @"a\b\c\d", PlatformID.Win32NT)] // remove illegal chars - [DataRow("a*?:z.txt", "a___z.txt")] + [DataRow("a*?:z.txt", "a___z.txt", PlatformID.Win32NT)] + [DataRow("a*?:z.txt", "a*?:z.txt", PlatformID.Unix)] // retain drive letter path colon - [DataRow(@"C:\az.txt", @"C:\az.txt")] + [DataRow(@"C:\az.txt", @"C:\az.txt", PlatformID.Win32NT)] + [DataRow(@"/:az.txt", @"/:az.txt", PlatformID.Unix)] // replace all other colons - [DataRow(@"a\b:c\d.txt", @"a\b_c\d.txt")] + [DataRow(@"a\b:c\d.txt", @"a\b_c\d.txt", PlatformID.Win32NT)] + [DataRow(@"a/b:c/d.txt", @"a/b:c/d.txt", PlatformID.Unix)] // remove empty directories - [DataRow(@"C:\a\\\b\c\\\d.txt", @"C:\a\b\c\d.txt")] - [DataRow(@"C:\""foo\<id>", @"C:\_foo\_id_")] - public void BarebonesDefaultTests(string inStr, string outStr) => Assert.AreEqual(outStr, FileUtility.GetSafePath(inStr, Barebones).PathWithoutPrefix); + [DataRow(@"C:\a\\\b\c\\\d.txt", @"C:\a\b\c\d.txt", PlatformID.Win32NT)] + [DataRow(@"/a///b/c///d.txt", @"/a/b/c/d.txt", PlatformID.Unix)] + [DataRow(@"C:\""foo\<id>", @"C:\_foo\_id_", PlatformID.Win32NT)] + [DataRow(@"/""foo/<id>", @"/""foo/<id>", PlatformID.Unix)] + public void BarebonesDefaultTests(string inStr, string outStr, PlatformID platformID) + => Test(inStr, outStr, Barebones, platformID); + + private void Test(string inStr, string outStr, ReplacementCharacters replacements, PlatformID platformID) + { + if (Environment.OSVersion.Platform == platformID) + FileUtility.GetSafePath(inStr, replacements).PathWithoutPrefix.Should().Be(outStr); + } } [TestClass] @@ -77,23 +104,33 @@ namespace FileUtilityTests // needs separate method. middle null param not running correctly in TestExplorer when used in DataRow() [TestMethod] - [DataRow("http://test.com/a/b/c", "http꞉∕∕test.com∕a∕b∕c")] - public void url_null_replacement(string inStr, string outStr) => DefaultReplacementTest(inStr, outStr); + [DataRow("http://test.com/a/b/c", "http꞉∕∕test.com∕a∕b∕c", PlatformID.Win32NT)] + [DataRow("http://test.com/a/b/c", "http:∕∕test.com∕a∕b∕c", PlatformID.Unix)] + public void url_null_replacement(string inStr, string outStr, PlatformID platformID) => DefaultReplacementTest(inStr, outStr, platformID); [TestMethod] // empty replacement - [DataRow("http://test.com/a/b/c", "http꞉∕∕test.com∕a∕b∕c")] - public void DefaultReplacementTest(string inStr, string outStr) => Default.ReplaceFilenameChars(inStr).Should().Be(outStr); + [DataRow("http://test.com/a/b/c", "http꞉∕∕test.com∕a∕b∕c", PlatformID.Win32NT)] + [DataRow("http://test.com/a/b/c", "http:∕∕test.com∕a∕b∕c", PlatformID.Unix)] + public void DefaultReplacementTest(string inStr, string outStr, PlatformID platformID) => Test(inStr, outStr, Default, platformID); [TestMethod] // empty replacement - [DataRow("http://test.com/a/b/c", "http-__test.com_a_b_c")] - public void LoFiDefaultReplacementTest(string inStr, string outStr) => LoFiDefault.ReplaceFilenameChars(inStr).Should().Be(outStr); + [DataRow("http://test.com/a/b/c", "http-__test.com_a_b_c", PlatformID.Win32NT)] + [DataRow("http://test.com/a/b/c", "http:__test.com_a_b_c", PlatformID.Unix)] + public void LoFiDefaultReplacementTest(string inStr, string outStr, PlatformID platformID) => Test(inStr, outStr, LoFiDefault, platformID); [TestMethod] // empty replacement - [DataRow("http://test.com/a/b/c", "http___test.com_a_b_c")] - public void BarebonesDefaultReplacementTest(string inStr, string outStr) => Barebones.ReplaceFilenameChars(inStr).Should().Be(outStr); + [DataRow("http://test.com/a/b/c", "http___test.com_a_b_c", PlatformID.Win32NT)] + [DataRow("http://test.com/a/b/c", "http:__test.com_a_b_c", PlatformID.Unix)] + public void BarebonesDefaultReplacementTest(string inStr, string outStr, PlatformID platformID) => Test(inStr, outStr, Barebones, platformID); + + private void Test(string inStr, string outStr, ReplacementCharacters replacements, PlatformID platformID) + { + if (Environment.OSVersion.Platform == platformID) + replacements.ReplaceFilenameChars(inStr).Should().Be(outStr); + } } [TestClass] @@ -154,32 +191,41 @@ namespace FileUtilityTests } [TestClass] - public class GetValidFilename + public class GetValidFilename { static ReplacementCharacters Replacements = ReplacementCharacters.Default; [TestMethod] // dot-files - [DataRow(@"C:\a bc\x y z\.f i l e.txt")] + [DataRow(@"C:\a bc\x y z\.f i l e.txt", PlatformID.Win32NT)] + [DataRow(@"/a bc/x y z/.f i l e.txt", PlatformID.Unix)] // dot-folders - [DataRow(@"C:\a bc\.x y z\f i l e.txt")] - public void Valid(string input) => Tests(input, input); + [DataRow(@"C:\a bc\.x y z\f i l e.txt", PlatformID.Win32NT)] + [DataRow(@"/a bc/.x y z/f i l e.txt", PlatformID.Unix)] + public void Valid(string input, PlatformID platformID) => Tests(input, input, platformID); [TestMethod] // folder spaces - [DataRow(@"C:\ a bc \x y z ", @"C:\a bc\x y z")] + [DataRow(@"C:\ a bc \x y z ", @"C:\a bc\x y z", PlatformID.Win32NT)] + [DataRow(@"/ a bc /x y z ", @"/a bc/x y z", PlatformID.Unix)] // file spaces - [DataRow(@"C:\a bc\x y z\ f i l e.txt ", @"C:\a bc\x y z\f i l e.txt")] + [DataRow(@"C:\a bc\x y z\ f i l e.txt ", @"C:\a bc\x y z\f i l e.txt", PlatformID.Win32NT)] + [DataRow(@"/a bc/x y z/ f i l e.txt ", @"/a bc/x y z/f i l e.txt", PlatformID.Unix)] // eliminate beginning space and end dots and spaces - [DataRow(@"C:\a bc\ . . . x y z . . . \f i l e.txt", @"C:\a bc\. . . x y z\f i l e.txt")] + [DataRow(@"C:\a bc\ . . . x y z . . . \f i l e.txt", @"C:\a bc\. . . x y z\f i l e.txt", PlatformID.Win32NT)] + [DataRow(@"/a bc/ . . . x y z . . . /f i l e.txt", @"/a bc/. . . x y z/f i l e.txt", PlatformID.Unix)] // file end dots - [DataRow(@"C:\a bc\x y z\f i l e.txt . . .", @"C:\a bc\x y z\f i l e.txt")] - public void Tests(string input, string expected) - => FileUtility.GetValidFilename(input, Replacements).PathWithoutPrefix.Should().Be(expected); + [DataRow(@"C:\a bc\x y z\f i l e.txt . . .", @"C:\a bc\x y z\f i l e.txt", PlatformID.Win32NT)] + [DataRow(@"/a bc/x y z/f i l e.txt . . .", @"/a bc/x y z/f i l e.txt", PlatformID.Unix)] + public void Tests(string input, string expected, PlatformID platformID) + { + if (Environment.OSVersion.Platform == platformID) + FileUtility.GetValidFilename(input, Replacements).PathWithoutPrefix.Should().Be(expected); + } } [TestClass] - public class RemoveLastCharacter + public class RemoveLastCharacter { [TestMethod] public void is_null() => Tests(null, null); diff --git a/Source/_Tests/LibationFileManager.Tests/TemplatesTests.cs b/Source/_Tests/LibationFileManager.Tests/TemplatesTests.cs index 257995f2..33681b6b 100644 --- a/Source/_Tests/LibationFileManager.Tests/TemplatesTests.cs +++ b/Source/_Tests/LibationFileManager.Tests/TemplatesTests.cs @@ -81,40 +81,62 @@ namespace TemplatesTests => Templates.getFileNamingTemplate(GetLibraryBook(), template, dirFullPath, extension); [TestMethod] - public void null_extension() => Tests("f.txt", @"C:\foo\bar", null, @"C:\foo\bar\f.txt"); + [DataRow("f.txt", @"C:\foo\bar", null, @"C:\foo\bar\f.txt", PlatformID.Win32NT)] + [DataRow("f.txt", @"/foo/bar", null, @"/foo/bar/f.txt", PlatformID.Unix)] + [DataRow("f.txt", @"C:\foo\bar", "ext", @"C:\foo\bar\f.txt.ext", PlatformID.Win32NT)] + [DataRow("f.txt", @"/foo/bar", "ext", @"/foo/bar/f.txt.ext", PlatformID.Unix)] + [DataRow("f", @"C:\foo\bar", "ext", @"C:\foo\bar\f.ext", PlatformID.Win32NT)] + [DataRow("f", @"/foo/bar", "ext", @"/foo/bar/f.ext", PlatformID.Unix)] + [DataRow("<id>", @"C:\foo\bar", "ext", @"C:\foo\bar\asin.ext", PlatformID.Win32NT)] + [DataRow("<id>", @"/foo/bar", "ext", @"/foo/bar/asin.ext", PlatformID.Unix)] + [DataRow("<bitrate> - <samplerate> - <channels>", @"C:\foo\bar", "ext", @"C:\foo\bar\128 - 44100 - 2.ext", PlatformID.Win32NT)] + [DataRow("<bitrate> - <samplerate> - <channels>", @"/foo/bar", "ext", @"/foo/bar/128 - 44100 - 2.ext", PlatformID.Unix)] + [DataRow("<year> - <channels>", @"C:\foo\bar", "ext", @"C:\foo\bar\2017 - 2.ext", PlatformID.Win32NT)] + [DataRow("<year> - <channels>", @"/foo/bar", "ext", @"/foo/bar/2017 - 2.ext", PlatformID.Unix)] + public void Tests(string template, string dirFullPath, string extension, string expected, PlatformID platformID) + { + if (Environment.OSVersion.Platform == platformID) + Templates.getFileNamingTemplate(GetLibraryBook(), template, dirFullPath, extension) + .GetFilePath(Replacements) + .PathWithoutPrefix + .Should().Be(expected); + } [TestMethod] - [DataRow("f.txt", @"C:\foo\bar", "ext", @"C:\foo\bar\f.txt.ext")] - [DataRow("f", @"C:\foo\bar", "ext", @"C:\foo\bar\f.ext")] - [DataRow("<id>", @"C:\foo\bar", "ext", @"C:\foo\bar\asin.ext")] - [DataRow("<bitrate> - <samplerate> - <channels>", @"C:\foo\bar", "ext", @"C:\foo\bar\128 - 44100 - 2.ext")] - [DataRow("<year> - <channels>", @"C:\foo\bar", "ext", @"C:\foo\bar\2017 - 2.ext")] - public void Tests(string template, string dirFullPath, string extension, string expected) - => Templates.getFileNamingTemplate(GetLibraryBook(), template, dirFullPath, extension) - .GetFilePath(Replacements) - .PathWithoutPrefix - .Should().Be(expected); + [DataRow(@"C:\a\b", @"C:\a\b\foobar.ext", PlatformID.Win32NT)] + [DataRow(@"/a/b", @"/a/b/foobar.ext", PlatformID.Unix)] + public void IfSeries_empty(string directory, string expected, PlatformID platformID) + { + if (Environment.OSVersion.Platform == platformID) + Templates.getFileNamingTemplate(GetLibraryBook(), "foo<if series-><-if series>bar", directory, "ext") + .GetFilePath(Replacements) + .PathWithoutPrefix + .Should().Be(expected); + } [TestMethod] - public void IfSeries_empty() - => Templates.getFileNamingTemplate(GetLibraryBook(), "foo<if series-><-if series>bar", @"C:\a\b", "ext") - .GetFilePath(Replacements) - .PathWithoutPrefix - .Should().Be(@"C:\a\b\foobar.ext"); + [DataRow(@"C:\a\b", @"C:\a\b\foobar.ext", PlatformID.Win32NT)] + [DataRow(@"/a/b", @"/a/b/foobar.ext", PlatformID.Unix)] + public void IfSeries_no_series(string directory, string expected, PlatformID platformID) + { + if (Environment.OSVersion.Platform == platformID) + Templates.getFileNamingTemplate(GetLibraryBook(null), "foo<if series->-<series>-<id>-<-if series>bar", directory, "ext") + .GetFilePath(Replacements) + .PathWithoutPrefix + .Should().Be(expected); + } [TestMethod] - public void IfSeries_no_series() - => Templates.getFileNamingTemplate(GetLibraryBook(null), "foo<if series->-<series>-<id>-<-if series>bar", @"C:\a\b", "ext") - .GetFilePath(Replacements) - .PathWithoutPrefix - .Should().Be(@"C:\a\b\foobar.ext"); - - [TestMethod] - public void IfSeries_with_series() - => Templates.getFileNamingTemplate(GetLibraryBook(), "foo<if series->-<series>-<id>-<-if series>bar", @"C:\a\b", "ext") - .GetFilePath(Replacements) - .PathWithoutPrefix - .Should().Be(@"C:\a\b\foo-Sherlock Holmes-asin-bar.ext"); + [DataRow(@"C:\a\b", @"C:\a\b\foo-Sherlock Holmes-asin-bar.ext", PlatformID.Win32NT)] + [DataRow(@"/a/b", @"/a/b/foo-Sherlock Holmes-asin-bar.ext", PlatformID.Unix)] + public void IfSeries_with_series(string directory, string expected, PlatformID platformID) + { + if (Environment.OSVersion.Platform == platformID) + Templates.getFileNamingTemplate(GetLibraryBook(), "foo<if series->-<series>-<id>-<-if series>bar", directory, "ext") + .GetFilePath(Replacements) + .PathWithoutPrefix + .Should().Be(expected); + } } } @@ -256,7 +278,7 @@ namespace Templates_File_Tests public class GetErrors { [TestMethod] - public void null_is_invalid() => Tests(null, new[] { Templates.ERROR_NULL_IS_INVALID }); + public void null_is_invalid() => Tests(null, Environment.OSVersion.Platform, new[] { Templates.ERROR_NULL_IS_INVALID }); [TestMethod] public void empty_is_valid() => valid_tests(""); @@ -267,19 +289,23 @@ namespace Templates_File_Tests [TestMethod] [DataRow(@"foo")] [DataRow(@"<id>")] - public void valid_tests(string template) => Tests(template, Array.Empty<string>()); + public void valid_tests(string template) => Tests(template, Environment.OSVersion.Platform, Array.Empty<string>()); [TestMethod] - [DataRow(@"C:\", Templates.ERROR_INVALID_FILE_NAME_CHAR)] - [DataRow(@"\foo", Templates.ERROR_INVALID_FILE_NAME_CHAR)] - [DataRow(@"/foo", Templates.ERROR_INVALID_FILE_NAME_CHAR)] - [DataRow(@"C:\", Templates.ERROR_INVALID_FILE_NAME_CHAR)] - public void Tests(string template, params string[] expected) + [DataRow(@"C:\", PlatformID.Win32NT, Templates.ERROR_INVALID_FILE_NAME_CHAR)] + [DataRow(@"/", PlatformID.Unix, Templates.ERROR_INVALID_FILE_NAME_CHAR)] + [DataRow(@"\foo", PlatformID.Win32NT, Templates.ERROR_INVALID_FILE_NAME_CHAR)] + [DataRow(@"/foo", PlatformID.Win32NT, Templates.ERROR_INVALID_FILE_NAME_CHAR)] + [DataRow(@"/foo", PlatformID.Unix, Templates.ERROR_INVALID_FILE_NAME_CHAR)] + public void Tests(string template, PlatformID platformID, params string[] expected) { - var result = Templates.File.GetErrors(template); - result.Count().Should().Be(expected.Length); - result.Should().BeEquivalentTo(expected); + if (Environment.OSVersion.Platform == platformID) + { + var result = Templates.File.GetErrors(template); + result.Count().Should().Be(expected.Length); + result.Should().BeEquivalentTo(expected); + } } } @@ -287,21 +313,29 @@ namespace Templates_File_Tests public class IsValid { [TestMethod] - public void null_is_invalid() => Tests(null, false); + public void null_is_invalid() => Tests(null, false, Environment.OSVersion.Platform); [TestMethod] - public void empty_is_valid() => Tests("", true); + public void empty_is_valid() => Tests("", true, Environment.OSVersion.Platform); [TestMethod] - public void whitespace_is_valid() => Tests(" ", true); + public void whitespace_is_valid() => Tests(" ", true, Environment.OSVersion.Platform); [TestMethod] - [DataRow(@"C:\", false)] - [DataRow(@"foo", true)] - [DataRow(@"\foo", false)] - [DataRow(@"/foo", false)] - [DataRow(@"<id>", true)] - public void Tests(string template, bool expected) => Templates.File.IsValid(template).Should().Be(expected); + [DataRow(@"C:\", false, PlatformID.Win32NT)] + [DataRow(@"/", false, PlatformID.Unix)] + [DataRow(@"foo", true, PlatformID.Win32NT)] + [DataRow(@"foo", true, PlatformID.Unix)] + [DataRow(@"\foo", false, PlatformID.Win32NT)] + [DataRow(@"\foo", true, PlatformID.Unix)] + [DataRow(@"/foo", false, PlatformID.Win32NT)] + [DataRow(@"<id>", true, PlatformID.Win32NT)] + [DataRow(@"<id>", true, PlatformID.Unix)] + public void Tests(string template, bool expected, PlatformID platformID) + { + if (Environment.OSVersion.Platform == platformID) + Templates.File.IsValid(template).Should().Be(expected); + } } // same as Templates.Folder.GetWarnings @@ -331,28 +365,34 @@ namespace Templates_ChapterFile_Tests public class GetWarnings { [TestMethod] - public void null_is_invalid() => Tests(null, new[] { Templates.ERROR_NULL_IS_INVALID }); + public void null_is_invalid() => Tests(null, null, new[] { Templates.ERROR_NULL_IS_INVALID }); [TestMethod] - public void empty_has_warnings() => Tests("", Templates.WARNING_EMPTY, Templates.WARNING_NO_TAGS, Templates.WARNING_NO_CHAPTER_NUMBER_TAG); + public void empty_has_warnings() => Tests("", null, Templates.WARNING_EMPTY, Templates.WARNING_NO_TAGS, Templates.WARNING_NO_CHAPTER_NUMBER_TAG); [TestMethod] - public void whitespace_has_warnings() => Tests(" ", Templates.WARNING_WHITE_SPACE, Templates.WARNING_NO_TAGS, Templates.WARNING_NO_CHAPTER_NUMBER_TAG); + public void whitespace_has_warnings() => Tests(" ", null, Templates.WARNING_WHITE_SPACE, Templates.WARNING_NO_TAGS, Templates.WARNING_NO_CHAPTER_NUMBER_TAG); [TestMethod] [DataRow("<ch#>")] [DataRow("<ch#> <id>")] - public void valid_tests(string template) => Tests(template, Array.Empty<string>()); + public void valid_tests(string template) => Tests(template, null, Array.Empty<string>()); [TestMethod] - [DataRow(@"no tags", Templates.WARNING_NO_TAGS, Templates.WARNING_NO_CHAPTER_NUMBER_TAG)] - [DataRow(@"<id>\foo\bar", Templates.ERROR_INVALID_FILE_NAME_CHAR, Templates.WARNING_NO_CHAPTER_NUMBER_TAG)] - [DataRow("<chapter count> -- chapter tag but not ch# or ch_#", Templates.WARNING_NO_TAGS, Templates.WARNING_NO_CHAPTER_NUMBER_TAG)] - public void Tests(string template, params string[] expected) + [DataRow(@"no tags", null, Templates.WARNING_NO_TAGS, Templates.WARNING_NO_CHAPTER_NUMBER_TAG)] + [DataRow(@"<id>\foo\bar", true, Templates.ERROR_INVALID_FILE_NAME_CHAR, Templates.WARNING_NO_CHAPTER_NUMBER_TAG)] + [DataRow(@"<id>/foo/bar", false, Templates.ERROR_INVALID_FILE_NAME_CHAR, Templates.WARNING_NO_CHAPTER_NUMBER_TAG)] + [DataRow("<chapter count> -- chapter tag but not ch# or ch_#", null, Templates.WARNING_NO_TAGS, Templates.WARNING_NO_CHAPTER_NUMBER_TAG)] + public void Tests(string template, bool? windows, params string[] expected) { - var result = Templates.ChapterFile.GetWarnings(template); - result.Count().Should().Be(expected.Length); - result.Should().BeEquivalentTo(expected); + if(windows is null + || (windows is true && Environment.OSVersion.Platform is PlatformID.Win32NT) + || (windows is false && Environment.OSVersion.Platform is PlatformID.Unix)) + { + var result = Templates.ChapterFile.GetWarnings(template); + result.Count().Should().Be(expected.Length); + result.Should().BeEquivalentTo(expected); + } } } @@ -408,10 +448,15 @@ namespace Templates_ChapterFile_Tests static readonly ReplacementCharacters Default = ReplacementCharacters.Default; [TestMethod] - [DataRow("[<id>] <ch# 0> of <ch count> - <ch title>", @"C:\foo\", "txt", 6, 10, "chap", @"C:\foo\[asin] 06 of 10 - chap.txt")] - [DataRow("<ch#>", @"C:\foo\", "txt", 6, 10, "chap", @"C:\foo\6.txt")] - public void Tests(string template, string dir, string ext, int pos, int total, string chapter, string expected) - => Templates.ChapterFile.GetPortionFilename(GetLibraryBook(), template, new() { OutputFileName = $"xyz.{ext}", PartsPosition = pos, PartsTotal = total, Title = chapter }, dir, Default) - .Should().Be(expected); + [DataRow("[<id>] <ch# 0> of <ch count> - <ch title>", @"C:\foo\", "txt", 6, 10, "chap", @"C:\foo\[asin] 06 of 10 - chap.txt", PlatformID.Win32NT)] + [DataRow("[<id>] <ch# 0> of <ch count> - <ch title>", @"/foo/", "txt", 6, 10, "chap", @"/foo/[asin] 06 of 10 - chap.txt", PlatformID.Unix)] + [DataRow("<ch#>", @"C:\foo\", "txt", 6, 10, "chap", @"C:\foo\6.txt", PlatformID.Win32NT)] + [DataRow("<ch#>", @"/foo/", "txt", 6, 10, "chap", @"/foo/6.txt", PlatformID.Unix)] + public void Tests(string template, string dir, string ext, int pos, int total, string chapter, string expected, PlatformID platformID) + { + if (Environment.OSVersion.Platform == platformID) + Templates.ChapterFile.GetPortionFilename(GetLibraryBook(), template, new() { OutputFileName = $"xyz.{ext}", PartsPosition = pos, PartsTotal = total, Title = chapter }, dir, Default) + .Should().Be(expected); + } } } From 7d6000e3b62ed96b9532efb8c8c8a39a00b3fca8 Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo <mbucari1@gmail.com> Date: Fri, 16 Dec 2022 16:41:24 -0700 Subject: [PATCH 5/6] Bring Hangover Chardonnay into feature parity with Classic (#409) --- Source/HangoverAvalonia/App.axaml.cs | 6 +- .../Controls/CheckedListBox.axaml | 30 +++++ .../Controls/CheckedListBox.axaml.cs | 106 ++++++++++++++++++ .../HangoverAvalonia/HangoverAvalonia.csproj | 7 +- .../ViewModels/MainVM.Database.cs | 38 +++++++ .../ViewModels/MainVM.Deleted.cs | 43 +++++++ Source/HangoverAvalonia/ViewModels/MainVM.cs | 18 +++ .../ViewModels/MainWindowViewModel.cs | 37 ------ .../HangoverAvalonia/Views/MainWindow.CLI.cs | 17 +++ .../Views/MainWindow.Database.cs | 23 ++++ .../Views/MainWindow.Deleted.cs | 41 +++++++ .../HangoverAvalonia/Views/MainWindow.axaml | 65 +++++++++-- .../Views/MainWindow.axaml.cs | 19 ++-- 13 files changed, 391 insertions(+), 59 deletions(-) create mode 100644 Source/HangoverAvalonia/Controls/CheckedListBox.axaml create mode 100644 Source/HangoverAvalonia/Controls/CheckedListBox.axaml.cs create mode 100644 Source/HangoverAvalonia/ViewModels/MainVM.Database.cs create mode 100644 Source/HangoverAvalonia/ViewModels/MainVM.Deleted.cs create mode 100644 Source/HangoverAvalonia/ViewModels/MainVM.cs delete mode 100644 Source/HangoverAvalonia/ViewModels/MainWindowViewModel.cs create mode 100644 Source/HangoverAvalonia/Views/MainWindow.CLI.cs create mode 100644 Source/HangoverAvalonia/Views/MainWindow.Database.cs create mode 100644 Source/HangoverAvalonia/Views/MainWindow.Deleted.cs diff --git a/Source/HangoverAvalonia/App.axaml.cs b/Source/HangoverAvalonia/App.axaml.cs index a64b8e22..158a427e 100644 --- a/Source/HangoverAvalonia/App.axaml.cs +++ b/Source/HangoverAvalonia/App.axaml.cs @@ -17,10 +17,12 @@ namespace HangoverAvalonia { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { - desktop.MainWindow = new MainWindow + var mainWindow = new MainWindow { - DataContext = new MainWindowViewModel(), + DataContext = new MainVM(), }; + desktop.MainWindow = mainWindow; + mainWindow.OnLoad(); } base.OnFrameworkInitializationCompleted(); diff --git a/Source/HangoverAvalonia/Controls/CheckedListBox.axaml b/Source/HangoverAvalonia/Controls/CheckedListBox.axaml new file mode 100644 index 00000000..f797e06b --- /dev/null +++ b/Source/HangoverAvalonia/Controls/CheckedListBox.axaml @@ -0,0 +1,30 @@ +<UserControl xmlns="https://github.com/avaloniaui" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" + x:Class="HangoverAvalonia.Controls.CheckedListBox"> + + <UserControl.Resources> + <RecyclePool x:Key="RecyclePool" /> + <DataTemplate x:Key="queuedBook"> + <CheckBox Margin="10,0,0,0" Content="{Binding Item}" IsChecked="{Binding IsChecked, Mode=TwoWay}" /> + </DataTemplate> + <RecyclingElementFactory x:Key="elementFactory" RecyclePool="{StaticResource RecyclePool}"> + <RecyclingElementFactory.Templates> + <StaticResource x:Key="queuedBook" ResourceKey="queuedBook" /> + </RecyclingElementFactory.Templates> + </RecyclingElementFactory> + </UserControl.Resources> + + <ScrollViewer + Name="scroller" + HorizontalScrollBarVisibility="Disabled" + VerticalScrollBarVisibility="Auto"> + <ItemsRepeater IsVisible="True" + VerticalCacheLength="1.2" + HorizontalCacheLength="1" + Items="{Binding CheckboxItems}" + ItemTemplate="{StaticResource elementFactory}" /> + </ScrollViewer> +</UserControl> diff --git a/Source/HangoverAvalonia/Controls/CheckedListBox.axaml.cs b/Source/HangoverAvalonia/Controls/CheckedListBox.axaml.cs new file mode 100644 index 00000000..79f899e8 --- /dev/null +++ b/Source/HangoverAvalonia/Controls/CheckedListBox.axaml.cs @@ -0,0 +1,106 @@ +using Avalonia; +using Avalonia.Collections; +using Avalonia.Controls; +using DataLayer; +using HangoverAvalonia.ViewModels; +using NPOI.XSSF.Streaming.Properties; +using ReactiveUI; +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; + +namespace HangoverAvalonia.Controls +{ + public partial class CheckedListBox : UserControl + { + public event EventHandler<ItemCheckEventArgs> ItemCheck; + + public static readonly StyledProperty<IEnumerable> ItemsProperty = + AvaloniaProperty.Register<CheckedListBox, IEnumerable>(nameof(Items)); + + public IEnumerable Items { get => GetValue(ItemsProperty); set => SetValue(ItemsProperty, value); } + private CheckedListBoxViewModel _viewModel = new(); + + public IEnumerable<object> CheckedItems => + _viewModel + .CheckboxItems + .Where(i => i.IsChecked) + .Select(i => i.Item); + + public void SetItemChecked(int i, bool isChecked) => _viewModel.CheckboxItems[i].IsChecked = isChecked; + public void SetItemChecked(object item, bool isChecked) + { + var obj = _viewModel.CheckboxItems.SingleOrDefault(i => i.Item == item); + if (obj is not null) + obj.IsChecked = isChecked; + } + + public CheckedListBox() + { + InitializeComponent(); + scroller.DataContext = _viewModel; + _viewModel.CheckedChanged += _viewModel_CheckedChanged; + } + + private void _viewModel_CheckedChanged(object sender, CheckBoxViewModel e) + { + var args = new ItemCheckEventArgs { Item = e.Item, ItemIndex = _viewModel.CheckboxItems.IndexOf(e), IsChecked = e.IsChecked }; + ItemCheck?.Invoke(this, args); + } + + protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) + { + if (change.Property.Name == nameof(Items) && Items != null) + _viewModel.SetItems(Items); + base.OnPropertyChanged(change); + } + + public class CheckedListBoxViewModel : ViewModelBase + { + public event EventHandler<CheckBoxViewModel> CheckedChanged; + public AvaloniaList<CheckBoxViewModel> CheckboxItems { get; private set; } + + public void SetItems(IEnumerable items) + { + UnsubscribeFromItems(CheckboxItems); + CheckboxItems = new(items.OfType<object>().Select(o => new CheckBoxViewModel { Item = o })); + SubscribeToItems(CheckboxItems); + this.RaisePropertyChanged(nameof(CheckboxItems)); + } + + private void SubscribeToItems(IEnumerable objects) + { + foreach (var i in objects.OfType<INotifyPropertyChanged>()) + i.PropertyChanged += I_PropertyChanged; + } + + private void UnsubscribeFromItems(AvaloniaList<CheckBoxViewModel> objects) + { + if (objects is null) return; + + foreach (var i in objects) + i.PropertyChanged -= I_PropertyChanged; + } + private void I_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + CheckedChanged?.Invoke(this, (CheckBoxViewModel)sender); + } + } + public class CheckBoxViewModel : ViewModelBase + { + private bool _isChecked; + public bool IsChecked { get => _isChecked; set => this.RaiseAndSetIfChanged(ref _isChecked, value); } + private object _bookText; + public object Item { get => _bookText; set => this.RaiseAndSetIfChanged(ref _bookText, value); } + } + } + + public class ItemCheckEventArgs : EventArgs + { + public int ItemIndex { get; init; } + public bool IsChecked { get; init; } + public object Item { get; init; } + } +} diff --git a/Source/HangoverAvalonia/HangoverAvalonia.csproj b/Source/HangoverAvalonia/HangoverAvalonia.csproj index 999e7fe2..40795aff 100644 --- a/Source/HangoverAvalonia/HangoverAvalonia.csproj +++ b/Source/HangoverAvalonia/HangoverAvalonia.csproj @@ -50,7 +50,12 @@ <None Remove="Assets\hangover.ico" /> <None Remove="hangover.ico" /> </ItemGroup> - + + <ItemGroup> + <Compile Update="ViewModels\MainVM.*.cs"> + <DependentUpon>MainVM.cs</DependentUpon> + </Compile> + </ItemGroup> <ItemGroup> <AvaloniaResource Include="hangover.ico" /> diff --git a/Source/HangoverAvalonia/ViewModels/MainVM.Database.cs b/Source/HangoverAvalonia/ViewModels/MainVM.Database.cs new file mode 100644 index 00000000..070a96fa --- /dev/null +++ b/Source/HangoverAvalonia/ViewModels/MainVM.Database.cs @@ -0,0 +1,38 @@ +using HangoverBase; +using ReactiveUI; +using System; +using System.Linq; + +namespace HangoverAvalonia.ViewModels +{ + public partial class MainVM + { + private DatabaseTab _tab; + + private string _databaseFileText; + private bool _databaseFound; + private string _sqlResults; + public string DatabaseFileText { get => _databaseFileText; set => this.RaiseAndSetIfChanged(ref _databaseFileText, value); } + public string SqlQuery { get; set; } + public bool DatabaseFound { get => _databaseFound; set => this.RaiseAndSetIfChanged(ref _databaseFound, value); } + public string SqlResults { get => _sqlResults; set => this.RaiseAndSetIfChanged(ref _sqlResults, value); } + + private void Load_databaseVM() + { + _tab = new(new(() => SqlQuery, s => SqlResults = s, s => SqlResults = s)); + + _tab.LoadDatabaseFile(); + if (_tab.DbFile is null) + { + DatabaseFileText = $"Database file not found"; + DatabaseFound = false; + return; + } + + DatabaseFileText = $"Database file: {_tab.DbFile}"; + DatabaseFound = true; + } + + public void ExecuteQuery() => _tab.ExecuteQuery(); + } +} diff --git a/Source/HangoverAvalonia/ViewModels/MainVM.Deleted.cs b/Source/HangoverAvalonia/ViewModels/MainVM.Deleted.cs new file mode 100644 index 00000000..482c98a1 --- /dev/null +++ b/Source/HangoverAvalonia/ViewModels/MainVM.Deleted.cs @@ -0,0 +1,43 @@ +using ApplicationServices; +using DataLayer; +using ReactiveUI; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace HangoverAvalonia.ViewModels +{ + public partial class MainVM + { + private List<LibraryBook> _deletedBooks; + public List<LibraryBook> DeletedBooks { get => _deletedBooks; set => this.RaiseAndSetIfChanged(ref _deletedBooks, value); } + public string CheckedCountText => $"Checked : {_checkedBooksCount} of {_totalBooksCount}"; + + private int _totalBooksCount = 0; + private int _checkedBooksCount = 0; + public int CheckedBooksCount + { + get => _checkedBooksCount; + set + { + if (_checkedBooksCount != value) + { + _checkedBooksCount = value; + this.RaisePropertyChanged(nameof(CheckedCountText)); + } + } + } + private void Load_deletedVM() + { + reload(); + } + + public void reload() + { + DeletedBooks = DbContexts.GetContext().GetDeletedLibraryBooks(); + _checkedBooksCount = 0; + _totalBooksCount = DeletedBooks.Count; + this.RaisePropertyChanged(nameof(CheckedCountText)); + } + } +} diff --git a/Source/HangoverAvalonia/ViewModels/MainVM.cs b/Source/HangoverAvalonia/ViewModels/MainVM.cs new file mode 100644 index 00000000..9cc1fea6 --- /dev/null +++ b/Source/HangoverAvalonia/ViewModels/MainVM.cs @@ -0,0 +1,18 @@ +using System; +using ApplicationServices; +using DataLayer; +using System.Collections.Generic; +using HangoverBase; +using ReactiveUI; + +namespace HangoverAvalonia.ViewModels +{ + public partial class MainVM : ViewModelBase + { + public MainVM() + { + Load_databaseVM(); + Load_deletedVM(); + } + } +} diff --git a/Source/HangoverAvalonia/ViewModels/MainWindowViewModel.cs b/Source/HangoverAvalonia/ViewModels/MainWindowViewModel.cs deleted file mode 100644 index a578811b..00000000 --- a/Source/HangoverAvalonia/ViewModels/MainWindowViewModel.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using HangoverBase; -using ReactiveUI; - -namespace HangoverAvalonia.ViewModels -{ - public class MainWindowViewModel : ViewModelBase - { - private DatabaseTab _tab; - - private string _databaseFileText; - private bool _databaseFound; - private string _sqlResults; - public string DatabaseFileText { get => _databaseFileText; set => this.RaiseAndSetIfChanged(ref _databaseFileText, value); } - public string SqlQuery { get; set; } - public bool DatabaseFound { get => _databaseFound; set => this.RaiseAndSetIfChanged(ref _databaseFound, value); } - public string SqlResults { get => _sqlResults; set => this.RaiseAndSetIfChanged(ref _sqlResults, value); } - - public MainWindowViewModel() - { - _tab = new(new(() => SqlQuery, s => SqlResults = s, s => SqlResults = s)); - - _tab.LoadDatabaseFile(); - if (_tab.DbFile is null) - { - DatabaseFileText = $"Database file not found"; - DatabaseFound = false; - return; - } - - DatabaseFileText = $"Database file: {_tab.DbFile}"; - DatabaseFound = true; - } - - public void ExecuteQuery() => _tab.ExecuteQuery(); - } -} diff --git a/Source/HangoverAvalonia/Views/MainWindow.CLI.cs b/Source/HangoverAvalonia/Views/MainWindow.CLI.cs new file mode 100644 index 00000000..6002bb80 --- /dev/null +++ b/Source/HangoverAvalonia/Views/MainWindow.CLI.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HangoverAvalonia.Views +{ + public partial class MainWindow + { + private void cliTab_VisibleChanged(bool isVisible) + { + if (!isVisible) + return; + } + } +} diff --git a/Source/HangoverAvalonia/Views/MainWindow.Database.cs b/Source/HangoverAvalonia/Views/MainWindow.Database.cs new file mode 100644 index 00000000..0a9e6ed4 --- /dev/null +++ b/Source/HangoverAvalonia/Views/MainWindow.Database.cs @@ -0,0 +1,23 @@ +using HangoverAvalonia.ViewModels; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HangoverAvalonia.Views +{ + public partial class MainWindow + { + private void databaseTab_VisibleChanged(bool isVisible) + { + if (!isVisible) + return; + } + + public void Execute_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) + { + _viewModel.ExecuteQuery(); + } + } +} diff --git a/Source/HangoverAvalonia/Views/MainWindow.Deleted.cs b/Source/HangoverAvalonia/Views/MainWindow.Deleted.cs new file mode 100644 index 00000000..aa352552 --- /dev/null +++ b/Source/HangoverAvalonia/Views/MainWindow.Deleted.cs @@ -0,0 +1,41 @@ +using ApplicationServices; +using DataLayer; +using HangoverAvalonia.Controls; +using System; +using System.Linq; + +namespace HangoverAvalonia.Views +{ + public partial class MainWindow + { + private void deletedTab_VisibleChanged(bool isVisible) + { + if (!isVisible) + return; + + if (_viewModel.DeletedBooks.Count == 0) + _viewModel.reload(); + } + public void Deleted_CheckedListBox_ItemCheck(object sender, ItemCheckEventArgs args) + { + _viewModel.CheckedBooksCount = deletedCbl.CheckedItems.Count(); + } + public void Deleted_CheckAll_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) + { + foreach (var item in deletedCbl.Items) + deletedCbl.SetItemChecked(item, true); + } + public void Deleted_UncheckAll_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) + { + foreach (var item in deletedCbl.Items) + deletedCbl.SetItemChecked(item, false); + } + public void Deleted_Save_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) + { + var libraryBooksToRestore = deletedCbl.CheckedItems.Cast<LibraryBook>().ToList(); + var qtyChanges = libraryBooksToRestore.RestoreBooks(); + if (qtyChanges > 0) + _viewModel.reload(); + } + } +} diff --git a/Source/HangoverAvalonia/Views/MainWindow.axaml b/Source/HangoverAvalonia/Views/MainWindow.axaml index b32eb8de..d407fbc7 100644 --- a/Source/HangoverAvalonia/Views/MainWindow.axaml +++ b/Source/HangoverAvalonia/Views/MainWindow.axaml @@ -3,33 +3,74 @@ xmlns:vm="using:HangoverAvalonia.ViewModels" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="500" + xmlns:controls="clr-namespace:HangoverAvalonia.Controls" + mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="500" Width="800" Height="500" x:Class="HangoverAvalonia.Views.MainWindow" Icon="/Assets/hangover.ico " Title="Hangover: Libation debug and recovery tool"> - <Design.DataContext> - <vm:MainWindowViewModel/> + <vm:MainVM/> </Design.DataContext> - - <TabControl Grid.Row="0"> + + <TabControl Name="tabControl1" Grid.Row="0"> <TabControl.Styles> <Style Selector="ItemsPresenter#PART_ItemsPresenter"> - <Setter Property="Height" Value="18"/> + <Setter Property="Height" Value="23"/> </Style> <Style Selector="TabItem"> - <Setter Property="MinHeight" Value="30"/> - <Setter Property="Height" Value="30"/> - <Setter Property="Padding" Value="8,2,8,0"/> + <Setter Property="MinHeight" Value="40"/> + <Setter Property="Height" Value="40"/> + <Setter Property="Padding" Value="8,2,8,5"/> </Style> <Style Selector="TabItem#Header TextBlock"> <Setter Property="MinHeight" Value="5"/> </Style> + <Style Selector="Button"> + <Setter Property="Padding" Value="20,5,20,5"/> + </Style> </TabControl.Styles> + + <!-- Deleted Books Tab --> + <TabItem Name="deletedTab"> + <TabItem.Header> + <TextBlock FontSize="14" VerticalAlignment="Center">Deleted Books</TextBlock> + </TabItem.Header> + + <Grid + RowDefinitions="Auto,*,Auto"> + + <TextBlock + Grid.Row="0" + Margin="5" + Text="To restore deleted book, check box and save" /> + + <controls:CheckedListBox + Grid.Row="1" + Margin="5,0,5,0" + BorderThickness="1" + BorderBrush="Gray" + Name="deletedCbl" + Items="{Binding DeletedBooks}" /> + + <Grid + Grid.Row="2" + Margin="5" + ColumnDefinitions="Auto,Auto,Auto,*"> + + <Button Grid.Column="0" Margin="0,0,20,0" Content="Check All" Click="Deleted_CheckAll_Click" /> + <Button Grid.Column="1" Margin="0,0,20,0" Content="Uncheck All" Click="Deleted_UncheckAll_Click" /> + <TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding CheckedCountText}" /> + <Button Grid.Column="3" HorizontalAlignment="Right" Content="Save" Click="Deleted_Save_Click" /> + + </Grid> + </Grid> + + + </TabItem> <!-- Database Tab --> - <TabItem> + <TabItem Name="databaseTab"> <TabItem.Header> <TextBlock FontSize="14" VerticalAlignment="Center">Database</TextBlock> </TabItem.Header> @@ -52,7 +93,6 @@ <Button Grid.Row="3" - Padding="20,5,20,5" Content="Execute" IsEnabled="{Binding DatabaseFound}" Click="Execute_Click" /> @@ -65,8 +105,9 @@ </Grid> </TabItem> + <!-- Command Line Interface Tab --> - <TabItem> + <TabItem Name="cliTab"> <TabItem.Header> <TextBlock FontSize="14" VerticalAlignment="Center">Command Line Interface</TextBlock> </TabItem.Header> diff --git a/Source/HangoverAvalonia/Views/MainWindow.axaml.cs b/Source/HangoverAvalonia/Views/MainWindow.axaml.cs index ca6c94d3..3e514ee0 100644 --- a/Source/HangoverAvalonia/Views/MainWindow.axaml.cs +++ b/Source/HangoverAvalonia/Views/MainWindow.axaml.cs @@ -1,24 +1,29 @@ using AppScaffolding; using Avalonia.Controls; using HangoverAvalonia.ViewModels; +using System; +using System.Linq; namespace HangoverAvalonia.Views { public partial class MainWindow : Window { - MainWindowViewModel _viewModel => DataContext as MainWindowViewModel; + MainVM _viewModel => DataContext as MainVM; public MainWindow() { InitializeComponent(); - var config = LibationScaffolding.RunPreConfigMigrations(); - LibationScaffolding.RunPostConfigMigrations(config); - LibationScaffolding.RunPostMigrationScaffolding(config); - } + var config = LibationScaffolding.RunPreConfigMigrations(); + LibationScaffolding.RunPostConfigMigrations(config); + LibationScaffolding.RunPostMigrationScaffolding(config); + } - public void Execute_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) + public void OnLoad() { - _viewModel.ExecuteQuery(); + deletedCbl.ItemCheck += Deleted_CheckedListBox_ItemCheck; + databaseTab.PropertyChanged += (_, e) => { if (e.Property.Name == nameof(TabItem.IsSelected)) databaseTab_VisibleChanged(databaseTab.IsSelected); }; + deletedTab.PropertyChanged += (_, e) => { if (e.Property.Name == nameof(TabItem.IsSelected)) deletedTab_VisibleChanged(deletedTab.IsSelected); }; + cliTab.PropertyChanged += (_, e) => { if (e.Property.Name == nameof(TabItem.IsSelected)) cliTab_VisibleChanged(cliTab.IsSelected); }; } } } From 0701cb3970f8c8d58a6309c3dc844582eff95f9f Mon Sep 17 00:00:00 2001 From: Michael Bucari-Tovo <mbucari1@gmail.com> Date: Fri, 16 Dec 2022 16:45:51 -0700 Subject: [PATCH 6/6] Reorder tabs --- .../Controls/CheckedListBox.axaml.cs | 2 - Source/HangoverAvalonia/Program.cs | 1 - .../ViewModels/MainVM.Database.cs | 2 - .../ViewModels/MainVM.Deleted.cs | 2 - Source/HangoverAvalonia/ViewModels/MainVM.cs | 17 ++--- .../ViewModels/ViewModelBase.cs | 3 - .../HangoverAvalonia/Views/MainWindow.CLI.cs | 8 +- .../Views/MainWindow.Database.cs | 9 +-- .../Views/MainWindow.Deleted.cs | 1 - .../HangoverAvalonia/Views/MainWindow.axaml | 74 +++++++++---------- .../Views/MainWindow.axaml.cs | 2 - 11 files changed, 43 insertions(+), 78 deletions(-) diff --git a/Source/HangoverAvalonia/Controls/CheckedListBox.axaml.cs b/Source/HangoverAvalonia/Controls/CheckedListBox.axaml.cs index 79f899e8..bdcfcf61 100644 --- a/Source/HangoverAvalonia/Controls/CheckedListBox.axaml.cs +++ b/Source/HangoverAvalonia/Controls/CheckedListBox.axaml.cs @@ -1,9 +1,7 @@ using Avalonia; using Avalonia.Collections; using Avalonia.Controls; -using DataLayer; using HangoverAvalonia.ViewModels; -using NPOI.XSSF.Streaming.Properties; using ReactiveUI; using System; using System.Collections; diff --git a/Source/HangoverAvalonia/Program.cs b/Source/HangoverAvalonia/Program.cs index 426b6853..037d6c57 100644 --- a/Source/HangoverAvalonia/Program.cs +++ b/Source/HangoverAvalonia/Program.cs @@ -1,5 +1,4 @@ using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; using Avalonia.ReactiveUI; using System; diff --git a/Source/HangoverAvalonia/ViewModels/MainVM.Database.cs b/Source/HangoverAvalonia/ViewModels/MainVM.Database.cs index 070a96fa..0e11d5b4 100644 --- a/Source/HangoverAvalonia/ViewModels/MainVM.Database.cs +++ b/Source/HangoverAvalonia/ViewModels/MainVM.Database.cs @@ -1,7 +1,5 @@ using HangoverBase; using ReactiveUI; -using System; -using System.Linq; namespace HangoverAvalonia.ViewModels { diff --git a/Source/HangoverAvalonia/ViewModels/MainVM.Deleted.cs b/Source/HangoverAvalonia/ViewModels/MainVM.Deleted.cs index 482c98a1..2c376fd7 100644 --- a/Source/HangoverAvalonia/ViewModels/MainVM.Deleted.cs +++ b/Source/HangoverAvalonia/ViewModels/MainVM.Deleted.cs @@ -1,9 +1,7 @@ using ApplicationServices; using DataLayer; using ReactiveUI; -using System; using System.Collections.Generic; -using System.Linq; namespace HangoverAvalonia.ViewModels { diff --git a/Source/HangoverAvalonia/ViewModels/MainVM.cs b/Source/HangoverAvalonia/ViewModels/MainVM.cs index 9cc1fea6..340f4a15 100644 --- a/Source/HangoverAvalonia/ViewModels/MainVM.cs +++ b/Source/HangoverAvalonia/ViewModels/MainVM.cs @@ -1,18 +1,11 @@ -using System; -using ApplicationServices; -using DataLayer; -using System.Collections.Generic; -using HangoverBase; -using ReactiveUI; - namespace HangoverAvalonia.ViewModels { public partial class MainVM : ViewModelBase - { - public MainVM() - { + { + public MainVM() + { Load_databaseVM(); - Load_deletedVM(); - } + Load_deletedVM(); + } } } diff --git a/Source/HangoverAvalonia/ViewModels/ViewModelBase.cs b/Source/HangoverAvalonia/ViewModels/ViewModelBase.cs index 50908ee3..7425a30b 100644 --- a/Source/HangoverAvalonia/ViewModels/ViewModelBase.cs +++ b/Source/HangoverAvalonia/ViewModels/ViewModelBase.cs @@ -1,7 +1,4 @@ using ReactiveUI; -using System; -using System.Collections.Generic; -using System.Text; namespace HangoverAvalonia.ViewModels { diff --git a/Source/HangoverAvalonia/Views/MainWindow.CLI.cs b/Source/HangoverAvalonia/Views/MainWindow.CLI.cs index 6002bb80..116297f8 100644 --- a/Source/HangoverAvalonia/Views/MainWindow.CLI.cs +++ b/Source/HangoverAvalonia/Views/MainWindow.CLI.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HangoverAvalonia.Views +namespace HangoverAvalonia.Views { public partial class MainWindow { diff --git a/Source/HangoverAvalonia/Views/MainWindow.Database.cs b/Source/HangoverAvalonia/Views/MainWindow.Database.cs index 0a9e6ed4..88f10b4a 100644 --- a/Source/HangoverAvalonia/Views/MainWindow.Database.cs +++ b/Source/HangoverAvalonia/Views/MainWindow.Database.cs @@ -1,11 +1,4 @@ -using HangoverAvalonia.ViewModels; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HangoverAvalonia.Views +namespace HangoverAvalonia.Views { public partial class MainWindow { diff --git a/Source/HangoverAvalonia/Views/MainWindow.Deleted.cs b/Source/HangoverAvalonia/Views/MainWindow.Deleted.cs index aa352552..2c2341e4 100644 --- a/Source/HangoverAvalonia/Views/MainWindow.Deleted.cs +++ b/Source/HangoverAvalonia/Views/MainWindow.Deleted.cs @@ -1,7 +1,6 @@ using ApplicationServices; using DataLayer; using HangoverAvalonia.Controls; -using System; using System.Linq; namespace HangoverAvalonia.Views diff --git a/Source/HangoverAvalonia/Views/MainWindow.axaml b/Source/HangoverAvalonia/Views/MainWindow.axaml index d407fbc7..1b849ddf 100644 --- a/Source/HangoverAvalonia/Views/MainWindow.axaml +++ b/Source/HangoverAvalonia/Views/MainWindow.axaml @@ -30,44 +30,6 @@ <Setter Property="Padding" Value="20,5,20,5"/> </Style> </TabControl.Styles> - - <!-- Deleted Books Tab --> - <TabItem Name="deletedTab"> - <TabItem.Header> - <TextBlock FontSize="14" VerticalAlignment="Center">Deleted Books</TextBlock> - </TabItem.Header> - - <Grid - RowDefinitions="Auto,*,Auto"> - - <TextBlock - Grid.Row="0" - Margin="5" - Text="To restore deleted book, check box and save" /> - - <controls:CheckedListBox - Grid.Row="1" - Margin="5,0,5,0" - BorderThickness="1" - BorderBrush="Gray" - Name="deletedCbl" - Items="{Binding DeletedBooks}" /> - - <Grid - Grid.Row="2" - Margin="5" - ColumnDefinitions="Auto,Auto,Auto,*"> - - <Button Grid.Column="0" Margin="0,0,20,0" Content="Check All" Click="Deleted_CheckAll_Click" /> - <Button Grid.Column="1" Margin="0,0,20,0" Content="Uncheck All" Click="Deleted_UncheckAll_Click" /> - <TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding CheckedCountText}" /> - <Button Grid.Column="3" HorizontalAlignment="Right" Content="Save" Click="Deleted_Save_Click" /> - - </Grid> - </Grid> - - - </TabItem> <!-- Database Tab --> <TabItem Name="databaseTab"> @@ -106,6 +68,42 @@ </TabItem> + <!-- Deleted Books Tab --> + <TabItem Name="deletedTab"> + <TabItem.Header> + <TextBlock FontSize="14" VerticalAlignment="Center">Deleted Books</TextBlock> + </TabItem.Header> + + <Grid + RowDefinitions="Auto,*,Auto"> + + <TextBlock + Grid.Row="0" + Margin="5" + Text="To restore deleted book, check box and save" /> + + <controls:CheckedListBox + Grid.Row="1" + Margin="5,0,5,0" + BorderThickness="1" + BorderBrush="Gray" + Name="deletedCbl" + Items="{Binding DeletedBooks}" /> + + <Grid + Grid.Row="2" + Margin="5" + ColumnDefinitions="Auto,Auto,Auto,*"> + + <Button Grid.Column="0" Margin="0,0,20,0" Content="Check All" Click="Deleted_CheckAll_Click" /> + <Button Grid.Column="1" Margin="0,0,20,0" Content="Uncheck All" Click="Deleted_UncheckAll_Click" /> + <TextBlock Grid.Column="2" VerticalAlignment="Center" Text="{Binding CheckedCountText}" /> + <Button Grid.Column="3" HorizontalAlignment="Right" Content="Save" Click="Deleted_Save_Click" /> + + </Grid> + </Grid> + </TabItem> + <!-- Command Line Interface Tab --> <TabItem Name="cliTab"> <TabItem.Header> diff --git a/Source/HangoverAvalonia/Views/MainWindow.axaml.cs b/Source/HangoverAvalonia/Views/MainWindow.axaml.cs index 3e514ee0..9fcfd1f9 100644 --- a/Source/HangoverAvalonia/Views/MainWindow.axaml.cs +++ b/Source/HangoverAvalonia/Views/MainWindow.axaml.cs @@ -1,8 +1,6 @@ using AppScaffolding; using Avalonia.Controls; using HangoverAvalonia.ViewModels; -using System; -using System.Linq; namespace HangoverAvalonia.Views {