Merge pull request #3 from pc223/add-task-link

Add task links directly to WindowsSettings.json
This commit is contained in:
Kevin Zhang 2021-09-26 18:36:19 -05:00 committed by GitHub
commit cfbb884032
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12311 additions and 1 deletions

View file

@ -47,6 +47,16 @@ namespace Flow.Plugin.WindowsSettings.Classes
/// </summary>
public IEnumerable<string>? AltNames { get; set; }
/// <summary>
/// Gets or sets the Keywords names of this task link.
/// </summary>
public IEnumerable<IEnumerable<string>>? Keywords { get; set; }
/// <summary>
/// Gets or sets the Ghyph of this setting
/// </summary>
public string? glyph { get; set; }
/// <summary>
/// Gets or sets a additional note of this settings.
/// <para>(e.g. why is not supported on your system)</para>

View file

@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31512.422
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Plugin.WindowsSettings", "Flow.Plugin.WindowsSettings.csproj", "{5043CECE-E6A7-4867-9CBE-02D27D83747A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.ActiveCfg = Debug|x64
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.Build.0 = Debug|x64
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.ActiveCfg = Release|x64
{5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EA85E245-28F0-4192-B9E7-6FA8CFF3D3CD}
EndGlobalSection
EndGlobal

View file

@ -69,7 +69,20 @@ namespace Flow.Plugin.WindowsSettings.Helper
.FirstOrDefault();
}
if (result is null && entry.Keywords is not null)
{
string[] searchKeywords = query.Terms[(string.IsNullOrEmpty(query.ActionKeyword) ? 0 : 1)..];
if (searchKeywords
.All(x => entry
.Keywords
.SelectMany(x => x)
.Contains(x, StringComparer.CurrentCultureIgnoreCase))
)
result = NewSettingResult(midScore);
}
}
if (result is null)
continue;
@ -82,7 +95,7 @@ namespace Flow.Plugin.WindowsSettings.Helper
Action = _ => DoOpenSettingsAction(entry),
IcoPath = iconPath,
SubTitle = $"{Resources.Area} \"{entry.Area}\" {Resources.SubtitlePreposition} {entry.Type}",
Title = entry.Name,
Title = entry.Name + entry.glyph,
ContextData = entry,
Score = score
};

File diff suppressed because it is too large Load diff