fix setup dialog issue
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user