[PT Run] Folder plugin: Improvements for the results (#16867)

* Improvements

* fix spelling

* text improvement

* fix build

* update tipp text
This commit is contained in:
Heiko
2022-03-22 12:07:09 +01:00
committed by GitHub
parent fcc1d46b63
commit 889bc1e514
7 changed files with 15 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ namespace Microsoft.Plugin.Folder.Properties {
// class via a tool like ResGen or Visual Studio. // class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen // To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project. // 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.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources { public class Resources {
@@ -151,7 +151,7 @@ namespace Microsoft.Plugin.Folder.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Use &gt; to search within the directory. Use * to search for file extensions. Or use both &gt;*. /// Looks up a localized string similar to Tip: Use &gt; to search in folders, * to search file by mask, &gt;* for both..
/// </summary> /// </summary>
public static string wox_plugin_folder_select_folder_first_result_subtitle { public static string wox_plugin_folder_select_folder_first_result_subtitle {
get { get {
@@ -160,7 +160,7 @@ namespace Microsoft.Plugin.Folder.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Open. /// Looks up a localized string similar to Open: {0}.
/// </summary> /// </summary>
public static string wox_plugin_folder_select_folder_first_result_title { public static string wox_plugin_folder_select_folder_first_result_title {
get { get {

View File

@@ -146,11 +146,11 @@
<value>Fail to open file at</value> <value>Fail to open file at</value>
</data> </data>
<data name="wox_plugin_folder_select_folder_first_result_subtitle" xml:space="preserve"> <data name="wox_plugin_folder_select_folder_first_result_subtitle" xml:space="preserve">
<value>Use &gt; to search within the directory. Use * to search for file extensions. Or use both &gt;*</value> <value>Tip: Use &gt; to search in folders, * to search file by mask, &gt;* for both.</value>
</data> </data>
<data name="wox_plugin_folder_select_folder_first_result_title" xml:space="preserve"> <data name="wox_plugin_folder_select_folder_first_result_title" xml:space="preserve">
<value>Open</value> <value>Open: {0}</value>
<comment>Open as a verb. Open this folder.</comment> <comment>Open as a verb. Open this folder. Do not translate the placeholder '{0}'.</comment>
</data> </data>
<data name="wox_plugin_folder_select_folder_OpenFileOrFolder_error_message" xml:space="preserve"> <data name="wox_plugin_folder_select_folder_OpenFileOrFolder_error_message" xml:space="preserve">
<value>Could not start</value> <value>Could not start</value>

View File

@@ -2,6 +2,8 @@
// The Microsoft Corporation licenses this file to you under the MIT license. // The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information. // See the LICENSE file in the project root for more information.
using System.Globalization;
using System.IO;
using Wox.Plugin; using Wox.Plugin;
namespace Microsoft.Plugin.Folder.Sources.Result namespace Microsoft.Plugin.Folder.Sources.Result
@@ -27,12 +29,14 @@ namespace Microsoft.Plugin.Folder.Sources.Result
{ {
return new Wox.Plugin.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, QueryTextDisplay = Search,
SubTitle = Properties.Resources.wox_plugin_folder_select_folder_first_result_subtitle, 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, IcoPath = Search,
Score = 500, Score = 500,
Action = c => _shellAction.ExecuteSanitized(Search, contextApi), Action = c => _shellAction.ExecuteSanitized(Search, contextApi),
ContextData = new SearchResult { Type = ResultType.Folder, FullPath = Search },
}; };
} }
} }

View File

@@ -36,6 +36,7 @@ namespace Microsoft.Plugin.Folder.Sources.Result
// Using CurrentCulture since this is user facing // Using CurrentCulture since this is user facing
SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_folder_select_folder_result_subtitle, Path), 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, QueryTextDisplay = Path,
ContextData = new SearchResult { Type = ResultType.Folder, FullPath = Path }, ContextData = new SearchResult { Type = ResultType.Folder, FullPath = Path },
Action = c => _shellAction.Execute(Path, contextApi), Action = c => _shellAction.Execute(Path, contextApi),

View File

@@ -39,6 +39,7 @@ namespace Microsoft.Plugin.Folder.Sources.Result
// Using CurrentCulture since this is user facing // Using CurrentCulture since this is user facing
SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_folder_select_file_result_subtitle, FilePath), 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, IcoPath = FilePath,
Action = c => ShellAction.Execute(FilePath, contextApi), Action = c => ShellAction.Execute(FilePath, contextApi),
ContextData = new SearchResult { Type = ResultType.File, FullPath = FilePath }, ContextData = new SearchResult { Type = ResultType.File, FullPath = FilePath },

View File

@@ -40,6 +40,7 @@ namespace Microsoft.Plugin.Folder.Sources.Result
// Using CurrentCulture since this is user facing // Using CurrentCulture since this is user facing
SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.wox_plugin_folder_select_folder_result_subtitle, Subtitle), 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, QueryTextDisplay = Path,
ContextData = new SearchResult { Type = ResultType.Folder, FullPath = Path }, ContextData = new SearchResult { Type = ResultType.Folder, FullPath = Path },
Action = c => ShellAction.Execute(Path, contextApi), Action = c => ShellAction.Execute(Path, contextApi),

View File

@@ -26,6 +26,7 @@ namespace Microsoft.Plugin.Folder.Sources.Result
// Using CurrentCulture since this is user facing // Using CurrentCulture since this is user facing
SubTitle = string.Format(CultureInfo.CurrentCulture, Properties.Resources.Microsoft_plugin_folder_truncation_warning_subtitle, PostTruncationCount, PreTruncationCount), 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, IcoPath = WarningIconPath,
}; };
} }