From bbca3cf202ed75543119f7408d463fa47041f0f3 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 2 Jun 2020 21:08:41 +1000 Subject: [PATCH] context menu- update text display and add check if already exists --- Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 964a8897c..7a24d58fb 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -8,6 +8,7 @@ using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.Explorer.Search; using System.Windows.Media; +using System.Linq; namespace Flow.Launcher.Plugin.Explorer { @@ -27,7 +28,7 @@ namespace Flow.Launcher.Plugin.Explorer contextMenus.Add(CreateOpenContainingFolderResult(record)); if (record.ShowIndexState) - contextMenus.Add(new Result {Title = "Indexed: " + (record.WindowsIndexed ? "Yes" : "No"), + contextMenus.Add(new Result {Title = "From index search: " + (record.WindowsIndexed ? "Yes" : "No"), SubTitle = "Location: " + record.FullPath, Score = 501, IcoPath = Constants.IndexImagePath}); @@ -188,10 +189,11 @@ namespace Flow.Launcher.Plugin.Explorer return new Result { Title = "Exclude path from index search", - SubTitle = record.FullPath, + SubTitle = "Path: " + record.FullPath, Action = _ => { - Main.Settings.IndexSearchExcludedDirectories.Add(record.FullPath); + if(!Main.Settings.IndexSearchExcludedDirectories.Any(x => x == record.FullPath)) + Main.Settings.IndexSearchExcludedDirectories.Add(record.FullPath); return false; },