diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index b4924a0fc..2297e5f96 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -54,6 +54,11 @@ namespace Flow.Launcher.Plugin.Explorer contextMenus.Add(CreateOpenContainingFolderResult(record)); + if (record.Type == ResultType.File) + { + contextMenus.Add(CreateOpenWithMenu(record)); + } + if (record.WindowsIndexed) { contextMenus.Add(CreateOpenWindowsIndexingOptions()); @@ -434,6 +439,22 @@ namespace Flow.Launcher.Plugin.Explorer }; } + private Result CreateOpenWithMenu(SearchResult record) + { + return new Result + { + Title = Context.API.GetTranslation("plugin_explorer_openwith"), + SubTitle = Context.API.GetTranslation("plugin_explorer_openwith_subtitle"), + Action = _ => + { + Process.Start("rundll32.exe", $"{Path.Combine(Environment.SystemDirectory, "shell32.dll")},OpenAs_RunDLL {record.FullPath}"); + return true; + }, + IcoPath = Constants.ShowContextMenuImagePath, + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue7ac"), + }; + } + private void LogException(string message, Exception e) { Log.Exception($"|Flow.Launcher.Plugin.Folder.ContextMenu|{message}", e); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index d5352ef1e..f2491d928 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -102,7 +102,9 @@ Remove from Quick Access Remove current item from Quick Access Show Windows Context Menu - + Open With + Select a program to open with + {0} free of {1} Open in Default File Manager