From 889bc1e5147c65e6c3e824f002faf697a7e56737 Mon Sep 17 00:00:00 2001 From: Heiko <61519853+htcfreek@users.noreply.github.com> Date: Tue, 22 Mar 2022 12:07:09 +0100 Subject: [PATCH] [PT Run] Folder plugin: Improvements for the results (#16867) * Improvements * fix spelling * text improvement * fix build * update tipp text --- .../Properties/Resources.Designer.cs | 6 +++--- .../Microsoft.Plugin.Folder/Properties/Resources.resx | 6 +++--- .../Sources/Result/CreateOpenCurrentFolderResult.cs | 6 +++++- .../Sources/Result/EnvironmentVariableResult.cs | 1 + .../Sources/Result/FileItemResult.cs | 1 + .../Sources/Result/FolderItemResult.cs | 1 + .../Sources/Result/TruncatedItemResult.cs | 1 + 7 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Properties/Resources.Designer.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Properties/Resources.Designer.cs index 73ff8c79c4..23679b9dd1 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Properties/Resources.Designer.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace Microsoft.Plugin.Folder.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { @@ -151,7 +151,7 @@ namespace Microsoft.Plugin.Folder.Properties { } /// - /// Looks up a localized string similar to Use > to search within the directory. Use * to search for file extensions. Or use both >*. + /// Looks up a localized string similar to Tip: Use > to search in folders, * to search file by mask, >* for both.. /// public static string wox_plugin_folder_select_folder_first_result_subtitle { get { @@ -160,7 +160,7 @@ namespace Microsoft.Plugin.Folder.Properties { } /// - /// Looks up a localized string similar to Open. + /// Looks up a localized string similar to Open: {0}. /// public static string wox_plugin_folder_select_folder_first_result_title { get { diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Properties/Resources.resx b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Properties/Resources.resx index 452d6d2575..f1e7342702 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Properties/Resources.resx +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Properties/Resources.resx @@ -146,11 +146,11 @@ Fail to open file at - Use > to search within the directory. Use * to search for file extensions. Or use both >* + Tip: Use > to search in folders, * to search file by mask, >* for both. - Open - Open as a verb. Open this folder. + Open: {0} + Open as a verb. Open this folder. Do not translate the placeholder '{0}'. Could not start diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/CreateOpenCurrentFolderResult.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/CreateOpenCurrentFolderResult.cs index 3e323fae5d..3e0a62f532 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/CreateOpenCurrentFolderResult.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/CreateOpenCurrentFolderResult.cs @@ -2,6 +2,8 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Globalization; +using System.IO; using Wox.Plugin; namespace Microsoft.Plugin.Folder.Sources.Result @@ -27,12 +29,14 @@ namespace Microsoft.Plugin.Folder.Sources.Result { return new Wox.Plugin.Result { - Title = Properties.Resources.wox_plugin_folder_select_folder_first_result_title, + Title = string.Format(CultureInfo.InvariantCulture, Properties.Resources.wox_plugin_folder_select_folder_first_result_title, new DirectoryInfo(Search).Name), QueryTextDisplay = Search, SubTitle = Properties.Resources.wox_plugin_folder_select_folder_first_result_subtitle, + ToolTipData = new ToolTipData(string.Format(CultureInfo.InvariantCulture, Properties.Resources.wox_plugin_folder_select_folder_first_result_title, new DirectoryInfo(Search).Name), Properties.Resources.wox_plugin_folder_select_folder_first_result_subtitle), IcoPath = Search, Score = 500, Action = c => _shellAction.ExecuteSanitized(Search, contextApi), + ContextData = new SearchResult { Type = ResultType.Folder, FullPath = Search }, }; } } diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/EnvironmentVariableResult.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/EnvironmentVariableResult.cs index f7faa06286..3ca0884bc1 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/EnvironmentVariableResult.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/EnvironmentVariableResult.cs @@ -36,6 +36,7 @@ namespace Microsoft.Plugin.Folder.Sources.Result // Using CurrentCulture since this is user facing SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_folder_select_folder_result_subtitle, Path), + ToolTipData = new ToolTipData(Title, string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_folder_select_folder_result_subtitle, Path)), QueryTextDisplay = Path, ContextData = new SearchResult { Type = ResultType.Folder, FullPath = Path }, Action = c => _shellAction.Execute(Path, contextApi), diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/FileItemResult.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/FileItemResult.cs index 2b1b2f71e9..b104230a08 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/FileItemResult.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/FileItemResult.cs @@ -39,6 +39,7 @@ namespace Microsoft.Plugin.Folder.Sources.Result // Using CurrentCulture since this is user facing SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_folder_select_file_result_subtitle, FilePath), + ToolTipData = new ToolTipData(Title, string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_folder_select_file_result_subtitle, FilePath)), IcoPath = FilePath, Action = c => ShellAction.Execute(FilePath, contextApi), ContextData = new SearchResult { Type = ResultType.File, FullPath = FilePath }, diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/FolderItemResult.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/FolderItemResult.cs index ea094bde33..86bb7e9f7e 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/FolderItemResult.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/FolderItemResult.cs @@ -40,6 +40,7 @@ namespace Microsoft.Plugin.Folder.Sources.Result // Using CurrentCulture since this is user facing SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_folder_select_folder_result_subtitle, Subtitle), + ToolTipData = new ToolTipData(Title, string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_folder_select_folder_result_subtitle, Subtitle)), QueryTextDisplay = Path, ContextData = new SearchResult { Type = ResultType.Folder, FullPath = Path }, Action = c => ShellAction.Execute(Path, contextApi), diff --git a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/TruncatedItemResult.cs b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/TruncatedItemResult.cs index 4eff8f40f9..e41f363a0f 100644 --- a/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/TruncatedItemResult.cs +++ b/src/modules/launcher/Plugins/Microsoft.Plugin.Folder/Sources/Result/TruncatedItemResult.cs @@ -26,6 +26,7 @@ namespace Microsoft.Plugin.Folder.Sources.Result // Using CurrentCulture since this is user facing SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.Microsoft_plugin_folder_truncation_warning_subtitle, PostTruncationCount, PreTruncationCount), + ToolTipData = new ToolTipData(Properties.Resources.Microsoft_plugin_folder_truncation_warning_title, string.Format(CultureInfo.CurrentCulture, Properties.Resources.Microsoft_plugin_folder_truncation_warning_subtitle, PostTruncationCount, PreTruncationCount)), IcoPath = WarningIconPath, }; }