diff --git a/Doc/app_missing_img.png b/Doc/app_missing_img.png new file mode 100644 index 000000000..11d5466f0 Binary files /dev/null and b/Doc/app_missing_img.png differ diff --git a/Flow.Launcher.Core/Configuration/Portable.cs b/Flow.Launcher.Core/Configuration/Portable.cs index 44e4434be..5bca087b8 100644 --- a/Flow.Launcher.Core/Configuration/Portable.cs +++ b/Flow.Launcher.Core/Configuration/Portable.cs @@ -95,7 +95,7 @@ namespace Flow.Launcher.Core.Configuration public void MoveUserDataFolder(string fromLocation, string toLocation) { - FilesFolders.Copy(fromLocation, toLocation); + FilesFolders.CopyAll(fromLocation, toLocation); VerifyUserDataAfterMove(fromLocation, toLocation); } diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs index 99d48275a..20df23e40 100644 --- a/Flow.Launcher.Core/Updater.cs +++ b/Flow.Launcher.Core/Updater.cs @@ -91,7 +91,7 @@ namespace Flow.Launcher.Core if (DataLocation.PortableDataLocationInUse()) { var targetDestination = updateManager.RootAppDirectory + $"\\app-{newReleaseVersion.ToString()}\\{DataLocation.PortableFolderName}"; - FilesFolders.Copy(DataLocation.PortableDataPath, targetDestination); + FilesFolders.CopyAll(DataLocation.PortableDataPath, targetDestination); if (!FilesFolders.VerifyBothFolderFilesEqual(DataLocation.PortableDataPath, targetDestination)) MessageBox.Show("Flow Launcher was not able to move your user profile data to the new update version. Please manually " + $"move your profile data folder from {DataLocation.PortableDataPath} to {targetDestination}"); diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs index a8c72fb12..c6a3b48f3 100644 --- a/Flow.Launcher.Infrastructure/Constant.cs +++ b/Flow.Launcher.Infrastructure/Constant.cs @@ -23,8 +23,10 @@ namespace Flow.Launcher.Infrastructure public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion; public static readonly int ThumbnailSize = 64; - public static readonly string DefaultIcon = Path.Combine(ProgramDirectory, "Images", "app.png"); - public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png"); + private static readonly string ImagesDirectory = Path.Combine(ProgramDirectory, "Images"); + public static readonly string DefaultIcon = Path.Combine(ImagesDirectory, "app.png"); + public static readonly string ErrorIcon = Path.Combine(ImagesDirectory, "app_error.png"); + public static readonly string MissingImgIcon = Path.Combine(ImagesDirectory, "app_missing_img.png"); public static string PythonPath; diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 0bf575337..5cf3d84a6 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -38,7 +38,7 @@ namespace Flow.Launcher.Infrastructure.Image _imageCache.Usage = LoadStorageToConcurrentDictionary(); - foreach (var icon in new[] { Constant.DefaultIcon, Constant.ErrorIcon }) + foreach (var icon in new[] { Constant.DefaultIcon, Constant.MissingImgIcon }) { ImageSource img = new BitmapImage(new Uri(icon)); img.Freeze(); @@ -106,7 +106,7 @@ namespace Flow.Launcher.Infrastructure.Image { if (string.IsNullOrEmpty(path)) { - return new ImageResult(_imageCache[Constant.ErrorIcon], ImageType.Error); + return new ImageResult(_imageCache[Constant.MissingImgIcon], ImageType.Error); } if (_imageCache.ContainsKey(path)) { @@ -139,7 +139,7 @@ namespace Flow.Launcher.Infrastructure.Image Log.Exception($"|ImageLoader.Load|Failed to get thumbnail for {path} on first try", e); Log.Exception($"|ImageLoader.Load|Failed to get thumbnail for {path} on second try", e2); - ImageSource image = _imageCache[Constant.ErrorIcon]; + ImageSource image = _imageCache[Constant.MissingImgIcon]; _imageCache[path] = image; imageResult = new ImageResult(image, ImageType.Error); } @@ -191,8 +191,8 @@ namespace Flow.Launcher.Infrastructure.Image } else { - image = _imageCache[Constant.ErrorIcon]; - path = Constant.ErrorIcon; + image = _imageCache[Constant.MissingImgIcon]; + path = Constant.MissingImgIcon; } if (type != ImageType.Error) diff --git a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj index 1c2b4b76a..6732d58c8 100644 --- a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj +++ b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj @@ -14,10 +14,10 @@ - 1.2.0 - 1.2.0 - 1.2.0 - 1.2.0 + 1.2.1 + 1.2.1 + 1.2.1 + 1.2.1 Flow.Launcher.Plugin Flow-Launcher MIT diff --git a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs index 13905788a..27cd1a558 100644 --- a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs +++ b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs @@ -17,7 +17,7 @@ namespace Flow.Launcher.Plugin.SharedCommands /// /// /// - public static void Copy(this string sourcePath, string targetPath) + public static void CopyAll(this string sourcePath, string targetPath) { // Get the subdirectories for the specified directory. DirectoryInfo dir = new DirectoryInfo(sourcePath); @@ -50,7 +50,7 @@ namespace Flow.Launcher.Plugin.SharedCommands foreach (DirectoryInfo subdir in dirs) { string temppath = Path.Combine(targetPath, subdir.Name); - Copy(subdir.FullName, temppath); + CopyAll(subdir.FullName, temppath); } } catch (Exception e) @@ -114,7 +114,7 @@ namespace Flow.Launcher.Plugin.SharedCommands return Directory.Exists(path); } - public static bool FileExits(this string filePath) + public static bool FileExists(this string filePath) { return File.Exists(filePath); } @@ -124,7 +124,7 @@ namespace Flow.Launcher.Plugin.SharedCommands var psi = new ProcessStartInfo { FileName = FileExplorerProgramName, UseShellExecute = true, Arguments = fileOrFolderPath }; try { - if (LocationExists(fileOrFolderPath) || FileExits(fileOrFolderPath)) + if (LocationExists(fileOrFolderPath) || FileExists(fileOrFolderPath)) Process.Start(psi); } catch (Exception e) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 985d4da87..731dc1541 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Text; using System.Threading.Tasks; using System.Timers; using System.Windows; @@ -85,6 +86,8 @@ namespace Flow.Launcher Http.Proxy = _settings.Proxy; + Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); + RegisterExitEvents(); AutoStartup(); diff --git a/Flow.Launcher/Images/app_missing_img.png b/Flow.Launcher/Images/app_missing_img.png new file mode 100644 index 000000000..11d5466f0 Binary files /dev/null and b/Flow.Launcher/Images/app_missing_img.png differ diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 4392234eb..a4fe2ede4 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -51,7 +51,7 @@ namespace Flow.Launcher.ViewModel catch (Exception e) { Log.Exception($"|ResultViewModel.Image|IcoPath is empty and exception when calling Icon() for result <{Result.Title}> of plugin <{Result.PluginDirectory}>", e); - imagePath = Constant.ErrorIcon; + imagePath = Constant.MissingImgIcon; } } diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 1235a18e7..949911229 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -34,7 +34,7 @@ namespace Flow.Launcher.Plugin.Caculator { MagesEngine = new Engine(); } - + public void Init(PluginInitContext context) { Context = context; @@ -78,16 +78,16 @@ namespace Flow.Launcher.Plugin.Caculator { try { - Clipboard.SetText(newResult); + Clipboard.SetDataObject(newResult); return true; } - catch (ExternalException) + catch (ExternalException e) { MessageBox.Show("Copy failed, please try later"); return false; } } - } + } }; } } @@ -111,7 +111,7 @@ namespace Flow.Launcher.Plugin.Caculator { return false; } - + if (!IsBracketComplete(query.Search)) { return false; @@ -164,7 +164,7 @@ namespace Flow.Launcher.Plugin.Caculator return leftBracketCount == 0; } - + public string GetTranslatedPluginTitle() { return Context.API.GetTranslation("flowlauncher_plugin_caculator_plugin_name"); diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json index 284a2893d..316788884 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json @@ -4,7 +4,7 @@ "Name": "Calculator", "Description": "Provide mathematical calculations.(Try 5*3-2 in Flow Launcher)", "Author": "cxfksword", - "Version": "1.0.0", + "Version": "1.0.1", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Caculator.dll", diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Languages/en.xaml index 2eee31745..e7a136114 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Languages/en.xaml @@ -5,7 +5,8 @@ Process Killer Kill running processes from Flow Launcher - kill all "{0}" processes + kill all instances of "{0}" + kill {0} processes kill all instances \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs index 22c84b20f..c3d9d1ab2 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs @@ -52,21 +52,24 @@ namespace Flow.Launcher.Plugin.ProcessKiller // get all non-system processes whose file path matches that of the given result (processPath) var similarProcesses = processHelper.GetSimilarProcesses(processPath); - menuOptions.Add(new Result + if (similarProcesses.Count() > 0) { - Title = _context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_instances"), - SubTitle = processPath, - Action = _ => + menuOptions.Add(new Result { - foreach (var p in similarProcesses) + Title = _context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_instances"), + SubTitle = processPath, + Action = _ => { - processHelper.TryKill(p); - } + foreach (var p in similarProcesses) + { + processHelper.TryKill(p); + } - return true; - }, - IcoPath = processPath - }); + return true; + }, + IcoPath = processPath + }); + } return menuOptions; } @@ -86,6 +89,7 @@ namespace Flow.Launcher.Plugin.ProcessKiller SubTitle = path, TitleHighlightData = StringMatcher.FuzzySearch(termToSearch, p.ProcessName).MatchData, Score = pr.Score, + ContextData = p.ProcessName, Action = (c) => { processHelper.TryKill(p); @@ -94,16 +98,18 @@ namespace Flow.Launcher.Plugin.ProcessKiller }); } + var sortedResults = results.OrderBy(x => x.Title).ToList(); + // When there are multiple results AND all of them are instances of the same executable // add a quick option to kill them all at the top of the results. - var firstResult = results.FirstOrDefault()?.SubTitle; - if (processlist.Count > 1 && !string.IsNullOrEmpty(termToSearch) && results.All(r => r.SubTitle == firstResult)) + var firstResult = sortedResults.FirstOrDefault(x => !string.IsNullOrEmpty(x.SubTitle)); + if (processlist.Count > 1 && !string.IsNullOrEmpty(termToSearch) && sortedResults.All(r => r.SubTitle == firstResult?.SubTitle)) { - results.Insert(0, new Result() + sortedResults.Insert(1, new Result() { - IcoPath = "Images/app.png", - Title = string.Format(_context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_all"), termToSearch), - SubTitle = "", + IcoPath = firstResult?.IcoPath, + Title = string.Format(_context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_all"), firstResult?.ContextData), + SubTitle = string.Format(_context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_all_count"), processlist.Count), Score = 200, Action = (c) => { @@ -117,7 +123,7 @@ namespace Flow.Launcher.Plugin.ProcessKiller }); } - return results; + return sortedResults; } } } diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json b/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json index f2e1eca12..894c49bdf 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json @@ -4,7 +4,7 @@ "Name":"Process Killer", "Description":"kill running processes from Flow", "Author":"Flow-Launcher", - "Version":"1.0.0", + "Version":"1.1.0", "Language":"csharp", "Website":"https://github.com/Flow-Launcher/Flow.Launcher.Plugin.ProcessKiller", "IcoPath":"Images\\app.png", diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs index b8633f357..69e077ee2 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs @@ -536,7 +536,7 @@ namespace Flow.Launcher.Plugin.Program.Programs ProgramLogger.LogException($"|UWP|ImageFromPath|{path}" + $"|Unable to get logo for {UserModelId} from {path} and" + $" located in {Package.Location}", new FileNotFoundException()); - return new BitmapImage(new Uri(Constant.ErrorIcon)); + return new BitmapImage(new Uri(Constant.MissingImgIcon)); } } @@ -586,7 +586,7 @@ namespace Flow.Launcher.Plugin.Program.Programs $"|Unable to convert background string {BackgroundColor} " + $"to color for {Package.Location}", new InvalidOperationException()); - return new BitmapImage(new Uri(Constant.ErrorIcon)); + return new BitmapImage(new Uri(Constant.MissingImgIcon)); } } else diff --git a/README.md b/README.md index b4459b9d8..b44628744 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![Github All Releases](https://img.shields.io/github/downloads/Flow-Launcher/Flow.Launcher/total.svg)](https://github.com/Flow-Launcher/Flow.Launcher/releases) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/Flow-Launcher/Flow.Launcher)](https://github.com/Flow-Launcher/Flow.Launcher/releases/latest) ![GitHub Release Date](https://img.shields.io/github/release-date/Flow-Launcher/Flow.Launcher) +[![Discord](https://img.shields.io/discord/727828229250875472?color=7389D8&labelColor=6A7EC2&label=Community&logo=discord&logoColor=white)](https://discord.gg/AvgAQgh) Flow Launcher. Dedicated to make your workflow flow more seamlessly. Aimed at being more than an app launcher, it searches, integrates and expands on functionalities. Flow will continue to evolve, designed to be open and built with the community at heart. @@ -59,6 +60,8 @@ Get in touch if you like to join the Flow-Launcher Team and help build this grea Yes please, submit an issue to let us know. +**Join our community on [Discord](https://discord.gg/AvgAQgh)!** + ## Developing/Debugging Flow Launcher's target framework is .Net Core 3.1 diff --git a/SolutionAssemblyInfo.cs b/SolutionAssemblyInfo.cs index c7c8812f2..abf7f5e15 100644 --- a/SolutionAssemblyInfo.cs +++ b/SolutionAssemblyInfo.cs @@ -16,6 +16,6 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.2.1")] -[assembly: AssemblyFileVersion("1.2.1")] -[assembly: AssemblyInformationalVersion("1.2.1")] \ No newline at end of file +[assembly: AssemblyVersion("1.3.1")] +[assembly: AssemblyFileVersion("1.3.1")] +[assembly: AssemblyInformationalVersion("1.3.1")] \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 703f1cb00..2b2acc304 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: '1.2.1.{build}' +version: '1.3.1.{build}' init: - ps: |