From d60bf050cf56ddacc93aabb1c6f7e08c9149f402 Mon Sep 17 00:00:00 2001 From: stax76 Date: Sat, 12 Mar 2022 14:26:00 +0100 Subject: [PATCH] show commands with text editor --- docs/Changelog.md | 2 ++ src/Misc/Commands.cs | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index b6a66f8..849bcb8 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -2,6 +2,8 @@ - Fix showing incorrect timestamps in About dialog of Store version. - Fix Store page showing non existant ARM and x86 support. - Fix opening zip files. +- The list of available input commands is like before shown + by the text editor, so it's like everything else searchable. 5.7.0.0 Stable (2022-03-09) diff --git a/src/Misc/Commands.cs b/src/Misc/Commands.cs index 9995c0b..69cab37 100644 --- a/src/Misc/Commands.cs +++ b/src/Misc/Commands.cs @@ -67,6 +67,14 @@ namespace mpvnet } } + public static void ShowTextWithEditor(string name, string text) + { + string file = Path.Combine(Path.GetTempPath(), name + ".txt"); + App.TempFiles.Add(file); + File.WriteAllText(file, BR + text.Trim() + BR); + ProcessHelp.ShellExecute(file); + } + public static void ShowDialog(Type winType) { App.InvokeOnMainThread(new Action(() => { @@ -356,7 +364,7 @@ namespace mpvnet } } - Msg.ShowInfo(sb.ToString()); + ShowTextWithEditor("command-list", sb.ToString()); } public static void ScaleWindow(float factor) => Core.RaiseScaleWindow(factor); @@ -538,7 +546,7 @@ namespace mpvnet if (propValue.ContainsEx("${")) propValue += BR2 + Core.Expand(propValue); - App.ShowInfo(prop + ": " + propValue); + App.ShowInfo(prop + "\n\n" + propValue); } };