From be57edf2c594cf12a22e3a80b26b5fc5ad18b8e0 Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Tue, 15 Oct 2019 05:58:00 +0200 Subject: [PATCH] 5.4.2.1 --- Changelog.md | 4 +++- mpv.net/Properties/AssemblyInfo.cs | 4 ++-- mpv.net/WPF/ConfWindow.xaml.cs | 14 +++++++------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Changelog.md b/Changelog.md index c69ac76..555afa0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,4 @@ -### +### 5.4.2.1 - pressing shift key suppresses auto-load-folder - switch --queue added, this will not clear the playlist but append @@ -7,6 +7,8 @@ [Open with++](https://github.com/stax76/OpenWithPlusPlus#add-to-mpvnet-playlist) shell extension, as far as I know multi selection can not be done using the Registry but only via shell extension - window-size mpv property support added ([default bindings](https://github.com/stax76/mpv.net/blob/master/mpv.net/Resources/inputConf.txt#L137)) +- the config editor keeps profiles and comments in mpv.conf intact! +- the options in the config editor are better organized ### 5.4.2 diff --git a/mpv.net/Properties/AssemblyInfo.cs b/mpv.net/Properties/AssemblyInfo.cs index 8873f76..f1a6977 100644 --- a/mpv.net/Properties/AssemblyInfo.cs +++ b/mpv.net/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.4.2.0")] -[assembly: AssemblyFileVersion("5.4.2.0")] +[assembly: AssemblyVersion("5.4.2.1")] +[assembly: AssemblyFileVersion("5.4.2.1")] diff --git a/mpv.net/WPF/ConfWindow.xaml.cs b/mpv.net/WPF/ConfWindow.xaml.cs index d4ebf1f..bd0f2a7 100644 --- a/mpv.net/WPF/ConfWindow.xaml.cs +++ b/mpv.net/WPF/ConfWindow.xaml.cs @@ -100,7 +100,7 @@ namespace mpvnet return string.Join("", SettingsDefinitions.Select(item => item.Name + item.Value).ToArray()); } - string SectionComment; + Dictionary SectionComment = new Dictionary(); void LoadConf(string file) { @@ -127,8 +127,8 @@ namespace mpvnet { section = line.Substring(0, line.IndexOf("]") + 1); - if (SectionComment == null) - SectionComment = comment; + if (!SectionComment.ContainsKey(file)) + SectionComment[file] = comment; comment = ""; isSectionItem = true; @@ -211,11 +211,11 @@ namespace mpvnet } } - if (SectionComment != "") - sb.Append(SectionComment); + if (SectionComment.ContainsKey(name) && SectionComment[name] != "\r\n") + sb.Append(SectionComment[name]); - if (!sb.ToString().Contains("\r\n# Editor")) - sb.AppendLine("\r\n# Editor"); + if (!sb.ToString().Contains("# Editor")) + sb.AppendLine("# Editor"); foreach (SettingBase setting in SettingsDefinitions) {