Skip to content

Commit b90664d

Browse files
committed
add exclude index search confirmation and persist settings to storage
1 parent 06877ca commit b90664d

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
using Flow.Launcher.Infrastructure.Logger;
88
using Flow.Launcher.Plugin.SharedCommands;
99
using Flow.Launcher.Plugin.Explorer.Search;
10-
using System.Windows.Media;
1110
using System.Linq;
11+
using System.Reflection;
1212

1313
namespace Flow.Launcher.Plugin.Explorer
1414
{
@@ -188,13 +188,25 @@ private Result CreateAddToIndexSearchExclusionListResult(SearchResult record)
188188
{
189189
return new Result
190190
{
191-
Title = "Exclude path from index search",
191+
Title = "Exclude current and sub-directories from index search",
192192
SubTitle = "Path: " + record.FullPath,
193193
Action = _ =>
194194
{
195195
if(!Main.Settings.IndexSearchExcludedSubdirectoryPaths.Any(x => x == record.FullPath))
196196
Main.Settings.IndexSearchExcludedSubdirectoryPaths.Add(record.FullPath);
197197

198+
var pluginDirectory = Directory.GetParent(Assembly.GetExecutingAssembly().Location.ToString());
199+
200+
var iconPath = pluginDirectory + "\\" + Constants.ExplorerIconImagePath;
201+
202+
Task.Run(() =>
203+
{
204+
Main.Context.API.ShowMsg("Excluded from Index Search", "Path: " + record.FullPath, iconPath);
205+
206+
// so the new path can be persisted to storage and not wait till next ViewModel save.
207+
Main.Context.API.SaveAppAllSettings();
208+
});
209+
198210
return false;
199211
},
200212
IcoPath = Constants.ExcludeFromIndexImagePath

Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ internal static class Constants
1212
internal const string CopyImagePath = "Images\\copy.png";
1313
internal const string IndexImagePath = "Images\\index.png";
1414
internal const string ExcludeFromIndexImagePath = "Images\\excludeindexpath.png";
15+
internal const string ExplorerIconImagePath = "Images\\explorer.png";
1516

1617
internal const string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory";
1718

0 commit comments

Comments
 (0)