mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
show if file or folder is indexed in context menu
This commit is contained in:
parent
af00ec5879
commit
2ea6642248
7 changed files with 21 additions and 8 deletions
|
|
@ -23,6 +23,10 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
contextMenus.Add(CreateOpenContainingFolderResult(record));
|
||||
}
|
||||
|
||||
if (record.ShowIndexState)
|
||||
contextMenus.Add(new Result { Title = "Indexed: " + (record.WindowsIndexed ? "Yes" : "No"),
|
||||
Score = 501, IcoPath = Constants.IndexImagePath });
|
||||
|
||||
var icoPath = (record.Type == ResultType.File) ? Constants.FileImagePath : Constants.FolderImagePath;
|
||||
var fileOrFolder = (record.Type == ResultType.File) ? "file" : "folder";
|
||||
contextMenus.Add(new Result
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@
|
|||
<None Include="Images\explorer.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
<None Include="Images\index.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
||||
<None Include="Images\copy.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
|
|
|
|||
BIN
Plugins/Flow.Launcher.Plugin.Explorer/Images/index.png
Normal file
BIN
Plugins/Flow.Launcher.Plugin.Explorer/Images/index.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
|
|
@ -10,6 +10,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
public const string FileImagePath = "Images\\file.png";
|
||||
public const string DeleteFileFolderImagePath = "Images\\deletefilefolder.png";
|
||||
public const string CopyImagePath = "Images\\copy.png";
|
||||
public const string IndexImagePath = "Images\\index.png";
|
||||
|
||||
public const string DefaultFolderSubtitleString = "Ctrl + Enter to open the directory";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,11 +71,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo
|
|||
|
||||
if (fileSystemInfo is System.IO.DirectoryInfo)
|
||||
{
|
||||
folderList.Add(ResultManager.CreateFolderResult(fileSystemInfo.Name, fileSystemInfo.FullName, fileSystemInfo.FullName, query));
|
||||
folderList.Add(ResultManager.CreateFolderResult(fileSystemInfo.Name, fileSystemInfo.FullName, fileSystemInfo.FullName, query, true, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
fileList.Add(ResultManager.CreateFileResult(fileSystemInfo.FullName, query));
|
||||
fileList.Add(ResultManager.CreateFileResult(fileSystemInfo.FullName, query, true, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
{
|
||||
internal static class ResultManager
|
||||
{
|
||||
internal static Result CreateFolderResult(string title, string subtitle, string path, Query query)
|
||||
internal static Result CreateFolderResult(string title, string subtitle, string path, Query query, bool showIndexState = false, bool windowsIndexed = false)
|
||||
{
|
||||
return new Result
|
||||
{
|
||||
|
|
@ -41,7 +41,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
query.ActionKeyword + " " + changeTo);
|
||||
return false;
|
||||
},
|
||||
ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path }
|
||||
ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path, ShowIndexState = showIndexState, WindowsIndexed = windowsIndexed }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
};
|
||||
}
|
||||
|
||||
internal static Result CreateFileResult(string filePath, Query query)
|
||||
internal static Result CreateFileResult(string filePath, Query query, bool showIndexState = false, bool windowsIndexed = false)
|
||||
{
|
||||
var result = new Result
|
||||
{
|
||||
|
|
@ -106,7 +106,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
|
||||
return true;
|
||||
},
|
||||
ContextData = new SearchResult { Type = ResultType.File, FullPath = filePath }
|
||||
ContextData = new SearchResult { Type = ResultType.File, FullPath = filePath, ShowIndexState = showIndexState, WindowsIndexed = windowsIndexed }
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
|
@ -116,6 +116,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
{
|
||||
public string FullPath { get; set; }
|
||||
public ResultType Type { get; set; }
|
||||
|
||||
public bool WindowsIndexed { get; set; }
|
||||
|
||||
public bool ShowIndexState { get; set; }
|
||||
}
|
||||
|
||||
internal enum ResultType
|
||||
|
|
|
|||
|
|
@ -71,10 +71,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
|
|||
private Result CreateResult(string filename, string path, string fileType, Query query)
|
||||
{
|
||||
if (fileType == "Directory")
|
||||
return ResultManager.CreateFolderResult(filename, path, path, query);
|
||||
return ResultManager.CreateFolderResult(filename, path, path, query, true, true);
|
||||
else
|
||||
{
|
||||
return ResultManager.CreateFileResult(path, query);
|
||||
return ResultManager.CreateFileResult(path, query, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue