mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add exclude index search confirmation and persist settings to storage
This commit is contained in:
parent
06877ca06b
commit
b90664d760
2 changed files with 15 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue