diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 49318cc86..02195db98 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -38,6 +38,8 @@ namespace Flow.Launcher.Plugin.Explorer contextMenus.Add(CreateOpenContainingFolderResult(record)); + contextMenus.Add(CreateOpenWindowsIndexingOptions(record)); + if (record.ShowIndexState) contextMenus.Add(new Result {Title = "From index search: " + (record.WindowsIndexed ? "Yes" : "No"), SubTitle = "Location: " + record.FullPath, @@ -186,13 +188,13 @@ namespace Flow.Launcher.Plugin.Explorer } catch (Exception e) { - var message = $"Fail to editor for file at {record.FullPath}"; + var message = $"Failed to open editor for file at {record.FullPath}"; LogException(message, e); Context.API.ShowMsg(message); return false; } }, - IcoPath = editorPath + IcoPath = Constants.FileImagePath }; } @@ -225,6 +227,38 @@ namespace Flow.Launcher.Plugin.Explorer }; } + private Result CreateOpenWindowsIndexingOptions(SearchResult record) + { + return new Result + { + Title = "Open Windows Indexing Options", + SubTitle = "Manage indexed files and folders", + Action = _ => + { + try + { + var psi = new ProcessStartInfo + { + FileName = "control.exe", + UseShellExecute = true, + Arguments = "srchadmin.dll" + }; + + Process.Start(psi); + return true; + } + catch (Exception e) + { + var message = $"Failed to open Windows Indexing Options"; + LogException(message, e); + Context.API.ShowMsg(message); + return false; + } + }, + IcoPath = Constants.IndexingOptionsIconImagePath + }; + } + public void LogException(string message, Exception e) { Log.Exception($"|Flow.Launcher.Plugin.Folder.ContextMenu|{message}", e); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj index 0cbe94d86..3025f8fb7 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Flow.Launcher.Plugin.Explorer.csproj @@ -56,6 +56,10 @@ PreserveNewest + + + PreserveNewest + diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Images/windowsindexingoptions.png b/Plugins/Flow.Launcher.Plugin.Explorer/Images/windowsindexingoptions.png new file mode 100644 index 000000000..78a015715 Binary files /dev/null and b/Plugins/Flow.Launcher.Plugin.Explorer/Images/windowsindexingoptions.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs index aa16c64ad..9c8a300bc 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs @@ -14,11 +14,14 @@ namespace Flow.Launcher.Plugin.Explorer.Search internal const string ExcludeFromIndexImagePath = "Images\\excludeindexpath.png"; internal const string ExplorerIconImagePath = "Images\\explorer.png"; internal const string DifferentUserIconImagePath = "Images\\user.png"; + internal const string IndexingOptionsIconImagePath = "Images\\windowsindexingoptions.png"; internal const string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory"; internal const char AllFilesFolderSearchWildcard = '>'; internal const char DirectorySeperator = '\\'; + + internal const string WindowsIndexingOptions = "srchadmin.dll"; } } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index c0bb60c40..a5e81716a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -1,8 +1,7 @@ using Flow.Launcher.Infrastructure.Storage; +using Flow.Launcher.Plugin.Explorer.Search; using Flow.Launcher.Plugin.Explorer.Search.FolderLinks; -using System; -using System.Collections.Generic; -using System.Text; +using System.Diagnostics; namespace Flow.Launcher.Plugin.Explorer.ViewModels { @@ -29,5 +28,17 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels internal void RemoveFolderLinkFromQuickFolders(FolderLink selectedRow) => Settings.QuickFolderAccessLinks.Remove(selectedRow); internal void RemoveFolderLinkFromExcludedIndexPaths(FolderLink selectedRow) => Settings.IndexSearchExcludedSubdirectoryPaths.Remove(selectedRow); + + internal void OpenWindowsIndexingOptions() + { + var psi = new ProcessStartInfo + { + FileName = "control.exe", + UseShellExecute = true, + Arguments = Constants.WindowsIndexingOptions + }; + + Process.Start(psi); + } } } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml index 9e04c8b8f..b2f999111 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml @@ -44,10 +44,19 @@ - -