From 465146d36f9a44ecec831043d0509858e4909b9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=98=E9=9F=AC=20=E5=BC=A0?= Date: Wed, 4 Nov 2020 07:42:35 +0800 Subject: [PATCH 01/13] Add Exploere Customize to Program Plugin --- .../Flow.Launcher.Plugin.Program/Programs/UWP.cs | 4 +++- .../Flow.Launcher.Plugin.Program/Programs/Win32.cs | 7 +++---- Plugins/Flow.Launcher.Plugin.Program/Settings.cs | 1 + .../Views/ProgramSetting.xaml | 13 ++++++++++--- .../Views/ProgramSetting.xaml.cs | 7 +++++++ 5 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs index 69e077ee2f6..4e8ff8e547d 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs @@ -324,7 +324,9 @@ public List ContextMenus(IPublicAPI api) Action = _ => { - Main.StartProcess(Process.Start, new ProcessStartInfo(Package.Location)); + Main.StartProcess(Process.Start, new ProcessStartInfo( + !string.IsNullOrEmpty(Main._settings.CustomizedExploere)?Main._settings.CustomizedExploere:"exploere" + , Package.Location)); return true; }, diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index cdea767f3ee..662ca270efe 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -140,10 +140,9 @@ public List ContextMenus(IPublicAPI api) Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"), Action = _ => { - - - Main.StartProcess(Process.Start, new ProcessStartInfo("explorer", ParentDirectory)); - + Main.StartProcess(Process.Start, new ProcessStartInfo( + !string.IsNullOrEmpty(Main._settings.CustomizedExploere)?Main._settings.CustomizedExploere:"exploere" + , ParentDirectory)); return true; }, IcoPath = "Images/folder.png" diff --git a/Plugins/Flow.Launcher.Plugin.Program/Settings.cs b/Plugins/Flow.Launcher.Plugin.Program/Settings.cs index fcb4cbf2da6..28a4ae145c3 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Settings.cs @@ -14,6 +14,7 @@ public class Settings public bool EnableStartMenuSource { get; set; } = true; public bool EnableRegistrySource { get; set; } = true; + public string CustomizedExploere { get; set; } = "exploere"; internal const char SuffixSeperator = ';'; diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml index 6051e0579fc..1307b61d07a 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml @@ -5,12 +5,13 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program" mc:Ignorable="d" - d:DesignHeight="300" d:DesignWidth="600"> + d:DesignHeight="404.508" d:DesignWidth="600"> + @@ -24,7 +25,7 @@ - + @@ -74,6 +75,12 @@