Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,25 @@ mscorlib
pythonw
dotnet
winget
jjw24
wolframalpha
gmail
duckduckgo
facebook
findicon
baidu
pls
websearch
qianlifeng
userdata
srchadmin
EWX
dlgtext
CMD
appref-ms
appref
TSource
runas
dpi
popup
ptr
4 changes: 3 additions & 1 deletion .github/actions/spelling/patterns.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
#x:Key="[^"]+"
#{DynamicResource [^"]+}

# html tag
<\w+[^>]*>

#http/https
(?:\b(?:https?|ftp|file)://)[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]

2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<system:String x:Key="flowlauncher_plugin_program_suffixes_cannot_empty">File suffixes can't be empty</system:String>
<system:String x:Key="flowlauncher_plugin_protocols_cannot_empty">Protocols can't be empty</system:String>

<system:String x:Key="flowlauncher_plugin_program_suffixes_excutable_types">File Suffixes</system:String>
<system:String x:Key="flowlauncher_plugin_program_suffixes_executable_types">File Suffixes</system:String>
<system:String x:Key="flowlauncher_plugin_program_suffixes_URL_types">URL Protocols</system:String>
<system:String x:Key="flowlauncher_plugin_program_suffixes_URL_steam">Steam Games</system:String>
<system:String x:Key="flowlauncher_plugin_program_suffixes_URL_epic">Epic Games</system:String>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
Margin="0,0,0,8"
FontSize="16"
FontWeight="SemiBold"
Text="{DynamicResource flowlauncher_plugin_program_suffixes_excutable_types}" />
Text="{DynamicResource flowlauncher_plugin_program_suffixes_executable_types}" />
<CheckBox
Name="apprefMS"
Margin="10,0,0,0"
Expand Down
24 changes: 12 additions & 12 deletions Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ public UWP(Package package)

public void InitAppsInPackage(Package package)
{
var applist = new List<Application>();
var apps = new List<Application>();
// WinRT
var appListEntries = package.GetAppListEntries();
foreach (var app in appListEntries)
{
try
{
var tmp = new Application(app, this);
applist.Add(tmp);
apps.Add(tmp);
}
catch (Exception e)
{
Expand All @@ -55,7 +55,7 @@ public void InitAppsInPackage(Package package)
+ $"{FullName} from location {Location}", e);
}
}
Apps = applist.ToArray();
Apps = apps.ToArray();

try
{
Expand Down Expand Up @@ -147,7 +147,7 @@ private PackageVersion GetPackageVersionFromManifest(XmlNode xmlRoot)
}

ProgramLogger.LogException($"|UWP|GetPackageVersionFromManifest|{Location}" +
"|Trying to get the package version of the UWP program, but an unknown UWP appmanifest version in package "
"|Trying to get the package version of the UWP program, but an unknown UWP app-manifest version in package "
+ $"{FullName} from location {Location}", new FormatException());
return PackageVersion.Unknown;
}
Expand Down Expand Up @@ -392,14 +392,14 @@ public Result Result(string query, IPublicAPI api)
{
title = $"{Name}: {Description}";
var nameMatch = StringMatcher.FuzzySearch(query, Name);
var desciptionMatch = StringMatcher.FuzzySearch(query, Description);
if (desciptionMatch.Score > nameMatch.Score)
var descriptionMatch = StringMatcher.FuzzySearch(query, Description);
if (descriptionMatch.Score > nameMatch.Score)
{
for (int i = 0; i < desciptionMatch.MatchData.Count; i++)
for (int i = 0; i < descriptionMatch.MatchData.Count; i++)
{
desciptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
descriptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
}
matchResult = desciptionMatch;
matchResult = descriptionMatch;
}
else matchResult = nameMatch;
}
Expand Down Expand Up @@ -633,7 +633,7 @@ string TryToFindLogo(string uri, string path, int px)
// }
// else
// {
// ProgramLogger.LogException($"|UWP|ImageFromPath|{(string.IsNullOrEmpty(path) ? "Not Avaliable" : path)}" +
// ProgramLogger.LogException($"|UWP|ImageFromPath|{(string.IsNullOrEmpty(path) ? "Not Available" : path)}" +
// $"|Unable to get logo for {UserModelId} from {path} and" +
// $" located in {Location}", new FileNotFoundException());
// return new BitmapImage(new Uri(Constant.MissingImgIcon));
Expand All @@ -658,8 +658,8 @@ string TryToFindLogo(string uri, string path, int px)
// var brush = new SolidColorBrush(color);
// var pen = new Pen(brush, 1);
// var backgroundArea = new Rect(0, 0, width, width);
// var rectabgle = new RectangleGeometry(backgroundArea);
// var rectDrawing = new GeometryDrawing(brush, pen, rectabgle);
// var rectangle = new RectangleGeometry(backgroundArea);
// var rectDrawing = new GeometryDrawing(brush, pen, rectangle);
// group.Children.Add(rectDrawing);

// var imageArea = new Rect(x, y, image.Width, image.Height);
Expand Down
18 changes: 9 additions & 9 deletions Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Win32 : IProgram, IEquatable<Win32>
/// </summary>
public string FullPath { get; set; }
/// <summary>
/// Path of the excutable for .lnk, or the URL for .url. Arguments are included if any.
/// Path of the executable for .lnk, or the URL for .url. Arguments are included if any.
/// </summary>
public string LnkResolvedPath { get; set; }
/// <summary>
Expand Down Expand Up @@ -84,14 +84,14 @@ public Result Result(string query, IPublicAPI api)
{
title = $"{Name}: {Description}";
var nameMatch = StringMatcher.FuzzySearch(query, Name);
var desciptionMatch = StringMatcher.FuzzySearch(query, Description);
if (desciptionMatch.Score > nameMatch.Score)
var descriptionMatch = StringMatcher.FuzzySearch(query, Description);
if (descriptionMatch.Score > nameMatch.Score)
{
for (int i = 0; i < desciptionMatch.MatchData.Count; i++)
for (int i = 0; i < descriptionMatch.MatchData.Count; i++)
{
desciptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
descriptionMatch.MatchData[i] += Name.Length + 2; // 2 is ": "
}
matchResult = desciptionMatch;
matchResult = descriptionMatch;
}
else matchResult = nameMatch;
}
Expand Down Expand Up @@ -495,12 +495,12 @@ private static IEnumerable<string> GetPathFromRegistry(RegistryKey root)
.Distinct();
}

private static string GetProgramPathFromRegistrySubKeys(RegistryKey root, string subkey)
private static string GetProgramPathFromRegistrySubKeys(RegistryKey root, string subKey)
{
var path = string.Empty;
try
{
using (var key = root.OpenSubKey(subkey))
using (var key = root.OpenSubKey(subKey))
{
if (key == null)
return string.Empty;
Expand Down Expand Up @@ -577,7 +577,7 @@ public static IEnumerable<T> DistinctBy<T, R>(IEnumerable<T> source, Func<T, R>

private static IEnumerable<Win32> ProgramsHasher(IEnumerable<Win32> programs)
{
// TODO: Unable to distinguish multiple lnks to the same excutable but with different params
// TODO: Unable to distinguish multiple lnks to the same executable but with different params
return programs.GroupBy(p => p.ExecutablePath.ToLowerInvariant())
.AsParallel()
.SelectMany(g =>
Expand Down
20 changes: 10 additions & 10 deletions Plugins/Flow.Launcher.Plugin.Shell/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public List<Result> Query(Query query)
string cmd = query.Search;
if (string.IsNullOrEmpty(cmd))
{
return ResultsFromlHistory();
return ResultsFromHistory();
}
else
{
Expand All @@ -55,8 +55,8 @@ public List<Result> Query(Query query)
else if (Directory.Exists(Path.GetDirectoryName(excmd) ?? string.Empty))
{
basedir = Path.GetDirectoryName(excmd);
var dirn = Path.GetDirectoryName(cmd);
dir = (dirn.EndsWith("/") || dirn.EndsWith(@"\")) ? dirn : cmd.Substring(0, dirn.Length + 1);
var dirName = Path.GetDirectoryName(cmd);
dir = (dirName.EndsWith("/") || dirName.EndsWith(@"\")) ? dirName : cmd.Substring(0, dirName.Length + 1);
}

if (basedir != null)
Expand Down Expand Up @@ -158,7 +158,7 @@ private Result GetCurrentCmd(string cmd)
return result;
}

private List<Result> ResultsFromlHistory()
private List<Result> ResultsFromHistory()
{
IEnumerable<Result> history = _settings.CommandHistory.OrderByDescending(o => o.Value)
.Select(m => new Result
Expand Down Expand Up @@ -204,7 +204,7 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
info.Arguments = $"{(_settings.LeaveShellOpen ? "/k" : "/c")} {command}";

//// Use info.Arguments instead of info.ArgumentList to enable users better control over the arguments they are writing.
//// Previous code using ArgumentList, commands needed to be seperated correctly:
//// Previous code using ArgumentList, commands needed to be separated correctly:
//// Incorrect:
// info.ArgumentList.Add(_settings.LeaveShellOpen ? "/k" : "/c");
// info.ArgumentList.Add(command); //<== info.ArgumentList.Add("mkdir \"c:\\test new\"");
Expand Down Expand Up @@ -377,9 +377,9 @@ public string GetTranslatedPluginDescription()

public List<Result> LoadContextMenus(Result selectedResult)
{
var resultlist = new List<Result>
var results = new List<Result>
{
new Result
new()
{
Title = context.API.GetTranslation("flowlauncher_plugin_cmd_run_as_different_user"),
AsyncAction = async c =>
Expand All @@ -390,7 +390,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
IcoPath = "Images/user.png",
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe7ee")
},
new Result
new()
{
Title = context.API.GetTranslation("flowlauncher_plugin_cmd_run_as_administrator"),
Action = c =>
Expand All @@ -401,7 +401,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
IcoPath = "Images/admin.png",
Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\xe7ef")
},
new Result
new()
{
Title = context.API.GetTranslation("flowlauncher_plugin_cmd_copy"),
Action = c =>
Expand All @@ -414,7 +414,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
}
};

return resultlist;
return results;
}
}
}
4 changes: 2 additions & 2 deletions Plugins/Flow.Launcher.Plugin.Sys/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ private List<Result> Commands()
IcoPath = "Images\\shutdown.png",
Action = c =>
{
var reuslt = MessageBox.Show(
var result = MessageBox.Show(
context.API.GetTranslation("flowlauncher_plugin_sys_dlgtext_shutdown_computer"),
context.API.GetTranslation("flowlauncher_plugin_sys_shutdown_computer"),
MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (reuslt == MessageBoxResult.Yes)
if (result == MessageBoxResult.Yes)
{
Process.Start("shutdown", "/s /t 0");
}
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Url/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<system:String x:Key="flowlauncher_plugin_new_tab">New Tab</system:String>

<system:String x:Key="flowlauncher_plugin_url_open_url">Open url:{0}</system:String>
<system:String x:Key="flowlauncher_plugin_url_canot_open_url">Can't open url:{0}</system:String>
<system:String x:Key="flowlauncher_plugin_url_cannot_open_url">Can't open url:{0}</system:String>

<system:String x:Key="flowlauncher_plugin_url_plugin_name">URL</system:String>
<system:String x:Key="flowlauncher_plugin_url_plugin_description">Open the typed URL from Flow Launcher</system:String>
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Url/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public List<Result> Query(Query query)
}
catch(Exception)
{
context.API.ShowMsg(string.Format(context.API.GetTranslation("flowlauncher_plugin_url_canot_open_url"), raw));
context.API.ShowMsg(string.Format(context.API.GetTranslation("flowlauncher_plugin_url_cannot_open_url"), raw));
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ public SearchSourceSettingWindow(IList<SearchSource> sources, PluginInitContext
{
_oldSearchSource = old;
_viewModel = new SearchSourceViewModel {SearchSource = old.DeepCopy()};
Initilize(sources, context, Action.Edit);
Initialize(sources, context, Action.Edit);
}

public SearchSourceSettingWindow(IList<SearchSource> sources, PluginInitContext context)
{
_viewModel = new SearchSourceViewModel {SearchSource = new SearchSource()};
Initilize(sources, context, Action.Add);
Initialize(sources, context, Action.Add);
}

private async void Initilize(IList<SearchSource> sources, PluginInitContext context, Action action)
private async void Initialize(IList<SearchSource> sources, PluginInitContext context, Action action)
{
InitializeComponent();
DataContext = _viewModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ internal static class ResultHelper

public static void Init(IPublicAPI api) => _api = api;

private static List<Result> GetDefaultReuslts(in IEnumerable<WindowsSetting> list,
private static List<Result> GetDefaultResults(in IEnumerable<WindowsSetting> list,
string windowsSettingIconPath,
string controlPanelIconPath)
{
Expand All @@ -45,7 +45,7 @@ internal static List<Result> GetResultList(
{
if (string.IsNullOrWhiteSpace(query.Search))
{
return GetDefaultReuslts(list, windowsSettingIconPath, controlPanelIconPath);
return GetDefaultResults(list, windowsSettingIconPath, controlPanelIconPath);
}

var resultList = new List<Result>();
Expand Down Expand Up @@ -110,7 +110,7 @@ internal static List<Result> GetResultList(
return resultList;
}

private const int TaskLinkScorePanelty = 50;
private const int TaskLinkScorePenalty = 50;

private static Result NewSettingResult(int score, string type, string windowsSettingIconPath, string controlPanelIconPath, WindowsSetting entry) => new()
{
Expand All @@ -120,7 +120,7 @@ internal static List<Result> GetResultList(
SubTitle = GetSubtitle(entry.Area, type),
Title = entry.Name,
ContextData = entry,
Score = score - (type == "TaskLink" ? TaskLinkScorePanelty : 0),
Score = score - (type == "TaskLink" ? TaskLinkScorePenalty : 0),
};

private static string GetSubtitle(string section, string entryType)
Expand Down