From 3ed71444a7e59e412f28f2d52e3ff6a492a93a4b Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Tue, 15 Dec 2020 18:12:10 +0100 Subject: [PATCH] fix setup dialog issue --- Changelog.md | 2 ++ mpv.net/Misc/App.cs | 6 +++--- mpv.net/Misc/RegistryHelp.cs | 6 ------ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Changelog.md b/Changelog.md index f37ef49..70d1d70 100644 --- a/Changelog.md +++ b/Changelog.md @@ -12,6 +12,8 @@ - Audio devices can be shown in the menu under: View > Show Audio Devices - Audio devices can be shown on the command line with --audio-device=help - Protocols can be shown in the menu under: View > Show Protocols +- Allow mpv.net to start from different startup locations + without showing the setup dialog. 5.4.8.5 Beta diff --git a/mpv.net/Misc/App.cs b/mpv.net/Misc/App.cs index 144f11d..fc32e99 100644 --- a/mpv.net/Misc/App.cs +++ b/mpv.net/Misc/App.cs @@ -195,9 +195,9 @@ namespace mpvnet public static void ShowSetup() { - string path = RegistryHelp.GetString(RegistryHelp.ApplicationKey, "SetupDialog"); + int value = RegistryHelp.GetInt(RegistryHelp.ApplicationKey, Folder.Startup); - if (path != Folder.Startup) + if (value != 1) { if (Msg.ShowQuestion("Would you like to setup mpv.net?", "The setup allows to create a start menu shortcut, file associations and " + @@ -207,7 +207,7 @@ namespace mpvnet else Msg.Show("The setup dialog can be found in the context menu at:\n\nTools > Setup"); - RegistryHelp.SetValue(RegistryHelp.ApplicationKey, "SetupDialog", Folder.Startup); + RegistryHelp.SetValue(RegistryHelp.ApplicationKey, Folder.Startup, 1); } } } diff --git a/mpv.net/Misc/RegistryHelp.cs b/mpv.net/Misc/RegistryHelp.cs index e943ae9..2ff753b 100644 --- a/mpv.net/Misc/RegistryHelp.cs +++ b/mpv.net/Misc/RegistryHelp.cs @@ -25,12 +25,6 @@ public class RegistryHelp return !(value is int) ? defaultValue : (int)value; } - public static bool GetBool(string path, string name, bool defaultValue = false) - { - object val = GetValue(path, name, defaultValue); - return val is bool ? (bool)val : defaultValue; - } - public static object GetValue(string path, string name, object defaultValue = null) { using (RegistryKey regKey = GetRootKey(path).OpenSubKey(path.Substring(5)))