diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 38bf63f89..e36b09eb7 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -7,8 +7,8 @@ using System.Windows; using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.Explorer.Search; -using System.Windows.Media; using System.Linq; +using System.Reflection; namespace Flow.Launcher.Plugin.Explorer { @@ -188,13 +188,25 @@ namespace Flow.Launcher.Plugin.Explorer { return new Result { - Title = "Exclude path from index search", + Title = "Exclude current and sub-directories from index search", SubTitle = "Path: " + record.FullPath, Action = _ => { if(!Main.Settings.IndexSearchExcludedSubdirectoryPaths.Any(x => x == record.FullPath)) Main.Settings.IndexSearchExcludedSubdirectoryPaths.Add(record.FullPath); + var pluginDirectory = Directory.GetParent(Assembly.GetExecutingAssembly().Location.ToString()); + + var iconPath = pluginDirectory + "\\" + Constants.ExplorerIconImagePath; + + Task.Run(() => + { + Main.Context.API.ShowMsg("Excluded from Index Search", "Path: " + record.FullPath, iconPath); + + // so the new path can be persisted to storage and not wait till next ViewModel save. + Main.Context.API.SaveAppAllSettings(); + }); + return false; }, IcoPath = Constants.ExcludeFromIndexImagePath diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs index 2f6a6f2ea..c033e3165 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs @@ -12,6 +12,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search internal const string CopyImagePath = "Images\\copy.png"; internal const string IndexImagePath = "Images\\index.png"; internal const string ExcludeFromIndexImagePath = "Images\\excludeindexpath.png"; + internal const string ExplorerIconImagePath = "Images\\explorer.png"; internal const string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory";