context menu- update text display and add check if already exists

This commit is contained in:
Jeremy Wu 2020-06-02 21:08:41 +10:00
parent 6330a784e8
commit bbca3cf202

View file

@ -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;
},