5.6.2.0 Beta
This commit is contained in:
@@ -131,7 +131,7 @@ namespace mpvnet
|
||||
|
||||
public static string Version => "Copyright (C) 2000-2022 mpv.net/mpv/mplayer\n" +
|
||||
$"mpv.net {Application.ProductVersion} ({File.GetLastWriteTime(Application.ExecutablePath).ToShortDateString()})\n" +
|
||||
$"{Core.GetPropertyString("mpv-version")} ({File.GetLastWriteTime(Folder.Startup + "mpv-2.dll").ToShortDateString()})\nffmpeg {Core.GetPropertyString("ffmpeg-version")}\nGPL v2 License";
|
||||
$"{Core.GetPropertyString("mpv-version")} ({File.GetLastWriteTime(Folder.Startup + "mpv-2.dll").ToShortDateString()})\nffmpeg {Core.GetPropertyString("ffmpeg-version")}\nMediaInfo {FileVersionInfo.GetVersionInfo(Path.Combine(Application.StartupPath, "MediaInfo.dll")).FileVersion} ({File.GetLastWriteTime(Path.Combine(Application.StartupPath , "MediaInfo.dll")).ToShortDateString()})\nGPL v2 License";
|
||||
|
||||
public static void ShowException(object obj)
|
||||
{
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace mpvnet
|
||||
{
|
||||
case "add-files-to-playlist": OpenFiles("append"); break; // deprecated 2019
|
||||
case "cycle-audio": CycleAudio(); break;
|
||||
case "execute-mpv-command": Msg.ShowError("Command was removed, reset input.conf."); break; // deprecated 2020
|
||||
case "execute-mpv-command": Msg.ShowError("The command was removed, please reset input.conf by deleting it, in the new menu use the on screen console."); break; // deprecated 2020
|
||||
case "load-audio": LoadAudio(); break;
|
||||
case "load-sub": LoadSubtitle(); break;
|
||||
case "open-conf-folder": ProcessHelp.ShellExecute(Core.ConfigFolder); break;
|
||||
@@ -58,6 +58,7 @@ namespace mpvnet
|
||||
case "show-properties": ShowProperties(); break;
|
||||
case "show-protocols": ShowStrings(mpvHelp.GetProtocols().Split("\r\n".ToCharArray(), StringSplitOptions.RemoveEmptyEntries)); break;
|
||||
case "show-recent": ShowRecent(); break;
|
||||
case "show-setup-dialog": ShowSetupDialog(); break; // deprecated 2022
|
||||
case "show-subtitle-tracks": ShowSubtitleTracks(); break;
|
||||
case "show-text": ShowText(args[0], Convert.ToInt32(args[1]), Convert.ToInt32(args[2])); break;
|
||||
case "window-scale": WindowScale(float.Parse(args[0], CultureInfo.InvariantCulture)); break;
|
||||
@@ -624,5 +625,19 @@ namespace mpvnet
|
||||
MainForm.Instance.ShowCommandPalette();
|
||||
CommandPalette.Instance.SelectFirst();
|
||||
});
|
||||
|
||||
public static void ShowSetupDialog() => App.InvokeOnMainThread(() =>
|
||||
{
|
||||
(string, string)[] pairs = {
|
||||
("Register video file associations", "script-message mpv.net reg-file-assoc video"),
|
||||
("Register audio file associations", "script-message mpv.net reg-file-assoc audio"),
|
||||
("Register image file associations", "script-message mpv.net reg-file-assoc image"),
|
||||
("Unregister file associations", "script-message mpv.net reg-file-assoc unreg") };
|
||||
|
||||
var list = pairs.Select(i => new CommandPaletteItem(i.Item1, () => Core.Command(i.Item2)));
|
||||
CommandPalette.Instance.SetItems(list);
|
||||
MainForm.Instance.ShowCommandPalette();
|
||||
CommandPalette.Instance.SelectFirst();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,6 +233,14 @@ namespace mpvnet
|
||||
|
||||
public class CommandPaletteItem
|
||||
{
|
||||
public CommandPaletteItem() {}
|
||||
|
||||
public CommandPaletteItem(string text, Action action)
|
||||
{
|
||||
Text = text;
|
||||
Action = action;
|
||||
}
|
||||
|
||||
public string Text { get; set; } = "";
|
||||
public string SecondaryText { get; set; } = "";
|
||||
public Action Action { get; set; }
|
||||
|
||||
Reference in New Issue
Block a user