[Run] Open in console functionality (#4739)

* Added open in console for indexer

* Added open in console fpr indexer and folder plugin

* Added open in console to program plugin

* Added string localization for program plugin

* Added test for win32 program

* Added test for win32 programs

* Added test for indexer plugin

* Localization for context menu title

* Added tests for folder plugin

* Added tests for indexer plugin

* Code cleanup

* Improved logging and nit fixes

* Updated tooltip for open in console

* Updates tests

* Removed subtitle property from contextmenuresult class

* Improved logging for context menu loaders
This commit is contained in:
Divyansh Srivastava
2020-07-08 09:56:26 -07:00
committed by GitHub
parent e3e6b23b7c
commit 638cd1dd48
32 changed files with 402 additions and 80 deletions

View File

@@ -22,6 +22,7 @@ using System.Runtime.InteropServices.ComTypes;
using Wox.Plugin.SharedCommands;
using System.Reflection;
using Wox.Infrastructure.Image;
using Wox.Infrastructure.Logger;
namespace Microsoft.Plugin.Program.Programs
{
@@ -356,7 +357,30 @@ namespace Microsoft.Plugin.Program.Programs
return true;
}
});
contextMenus.Add(new ContextMenuResult
{
PluginName = Assembly.GetExecutingAssembly().GetName().Name,
Title = api.GetTranslation("wox_plugin_program_open_in_console"),
Glyph = "\xE756",
FontFamily = "Segoe MDL2 Assets",
AcceleratorKey = Key.C,
AcceleratorModifiers = ModifierKeys.Control | ModifierKeys.Shift,
Action = (context) =>
{
try
{
Helper.OpenInConsole(Package.Location);
return true;
}
catch (Exception e)
{
Log.Exception($"|Microsoft.Plugin.Program.UWP.ContextMenu| Failed to open {Name} in console, {e.Message}", e);
return false;
}
}
});
return contextMenus;
}