mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Change Directory plugin subdirectory list action
This commit is contained in:
parent
0dd540a048
commit
e1f71cae37
1 changed files with 20 additions and 9 deletions
|
|
@ -10,6 +10,7 @@ namespace Wox.Plugin.System
|
|||
{
|
||||
public class DirectoryIndicator : BaseSystemPlugin
|
||||
{
|
||||
private PluginInitContext context;
|
||||
private static List<string> driverNames = null;
|
||||
private static Dictionary<string, DirectoryInfo[]> parentDirectories = new Dictionary<string, DirectoryInfo[]>();
|
||||
|
||||
|
|
@ -25,6 +26,8 @@ namespace Wox.Plugin.System
|
|||
return results;
|
||||
}
|
||||
|
||||
InitialDriverList();
|
||||
|
||||
var input = query.RawQuery.ToLower();
|
||||
if (driverNames.FirstOrDefault(x => input.StartsWith(x)) == null) return results;
|
||||
|
||||
|
|
@ -49,12 +52,11 @@ namespace Wox.Plugin.System
|
|||
Result result = new Result
|
||||
{
|
||||
Title = dir.Name,
|
||||
SubTitle = "Open this directory",
|
||||
IcoPath = "Images/folder.png",
|
||||
Action = (c) =>
|
||||
{
|
||||
Process.Start(dirPath);
|
||||
return true;
|
||||
context.ChangeQuery(dirPath);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
results.Add(result);
|
||||
|
|
@ -64,9 +66,14 @@ namespace Wox.Plugin.System
|
|||
{
|
||||
Result result = new Result
|
||||
{
|
||||
Title = "No files in this directory",
|
||||
SubTitle = "",
|
||||
Title = "Open this directory",
|
||||
SubTitle = "No files in this directory",
|
||||
IcoPath = "Images/folder.png",
|
||||
Action = (c) =>
|
||||
{
|
||||
Process.Start(query.RawQuery);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
results.Add(result);
|
||||
}
|
||||
|
|
@ -111,12 +118,11 @@ namespace Wox.Plugin.System
|
|||
Result result = new Result
|
||||
{
|
||||
Title = dir.Name,
|
||||
SubTitle = "Open this directory",
|
||||
IcoPath = "Images/folder.png",
|
||||
Action = (c) =>
|
||||
{
|
||||
Process.Start(dirPath);
|
||||
return true;
|
||||
context.ChangeQuery(dirPath);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
results.Add(result);
|
||||
|
|
@ -128,7 +134,7 @@ namespace Wox.Plugin.System
|
|||
return results;
|
||||
}
|
||||
|
||||
protected override void InitInternal(PluginInitContext context)
|
||||
private void InitialDriverList()
|
||||
{
|
||||
if (driverNames == null)
|
||||
{
|
||||
|
|
@ -141,5 +147,10 @@ namespace Wox.Plugin.System
|
|||
}
|
||||
}
|
||||
|
||||
protected override void InitInternal(PluginInitContext context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue