diff --git a/Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs b/Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs index c0cd022ea..fab1b3e8f 100644 --- a/Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs +++ b/Flow.Launcher.Core/ExternalPlugins/PluginsManifest.cs @@ -2,6 +2,8 @@ using Flow.Launcher.Infrastructure.Logger; using System; using System.Collections.Generic; +using System.Net; +using System.Net.Http; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -10,43 +12,43 @@ namespace Flow.Launcher.Core.ExternalPlugins { public static class PluginsManifest { - static PluginsManifest() - { - UpdateTask = UpdateManifestAsync(); - } - - public static List UserPlugins { get; private set; } = new List(); - - public static Task UpdateTask { get; private set; } + private const string manifestFileUrl = "https://cdn.jsdelivr.net/gh/Flow-Launcher/Flow.Launcher.PluginsManifest@plugin_api_v2/plugins.json"; private static readonly SemaphoreSlim manifestUpdateLock = new(1); - public static Task UpdateManifestAsync() - { - if (manifestUpdateLock.CurrentCount == 0) - { - return UpdateTask; - } + private static string latestEtag = ""; - return UpdateTask = DownloadManifestAsync(); - } + public static List UserPlugins { get; private set; } = new List(); - private async static Task DownloadManifestAsync() + public static async Task UpdateManifestAsync(CancellationToken token = default) { try { - await manifestUpdateLock.WaitAsync().ConfigureAwait(false); + await manifestUpdateLock.WaitAsync(token).ConfigureAwait(false); - await using var jsonStream = await Http.GetStreamAsync("https://raw.githubusercontent.com/Flow-Launcher/Flow.Launcher.PluginsManifest/plugin_api_v2/plugins.json") - .ConfigureAwait(false); + var request = new HttpRequestMessage(HttpMethod.Get, manifestFileUrl); + request.Headers.Add("If-None-Match", latestEtag); - UserPlugins = await JsonSerializer.DeserializeAsync>(jsonStream).ConfigureAwait(false); + var response = await Http.SendAsync(request, token).ConfigureAwait(false); + + if (response.StatusCode == HttpStatusCode.OK) + { + Log.Info($"|PluginsManifest.{nameof(UpdateManifestAsync)}|Fetched plugins from manifest repo"); + + var json = await response.Content.ReadAsStreamAsync(token).ConfigureAwait(false); + + UserPlugins = await JsonSerializer.DeserializeAsync>(json, cancellationToken: token).ConfigureAwait(false); + + latestEtag = response.Headers.ETag.Tag; + } + else if (response.StatusCode != HttpStatusCode.NotModified) + { + Log.Warn($"|PluginsManifest.{nameof(UpdateManifestAsync)}|Http response for manifest file was {response.StatusCode}"); + } } catch (Exception e) { - Log.Exception("|PluginManagement.GetManifest|Encountered error trying to download plugins manifest", e); - - UserPlugins = new List(); + Log.Exception($"|PluginsManifest.{nameof(UpdateManifestAsync)}|Http request failed", e); } finally { diff --git a/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs b/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs index 0982e4017..049d1c583 100644 --- a/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs +++ b/Flow.Launcher.Core/Plugin/ExecutablePlugin.cs @@ -1,5 +1,4 @@ -using System; -using System.Diagnostics; +using System.Diagnostics; using System.IO; using System.Threading; using System.Threading.Tasks; @@ -22,18 +21,23 @@ namespace Flow.Launcher.Core.Plugin RedirectStandardOutput = true, RedirectStandardError = true }; + + // required initialisation for below request calls + _startInfo.ArgumentList.Add(string.Empty); } protected override Task RequestAsync(JsonRPCRequestModel request, CancellationToken token = default) { - _startInfo.Arguments = $"\"{request}\""; + // since this is not static, request strings will build up in ArgumentList if index is not specified + _startInfo.ArgumentList[0] = request.ToString(); return ExecuteAsync(_startInfo, token); } protected override string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default) { - _startInfo.Arguments = $"\"{rpcRequest}\""; + // since this is not static, request strings will build up in ArgumentList if index is not specified + _startInfo.ArgumentList[0] = rpcRequest.ToString(); return Execute(_startInfo); } } -} \ No newline at end of file +} diff --git a/Flow.Launcher.Core/Plugin/JsonPRCModel.cs b/Flow.Launcher.Core/Plugin/JsonPRCModel.cs index 5232e46da..cf75e4aa3 100644 --- a/Flow.Launcher.Core/Plugin/JsonPRCModel.cs +++ b/Flow.Launcher.Core/Plugin/JsonPRCModel.cs @@ -43,15 +43,19 @@ namespace Flow.Launcher.Core.Plugin [JsonPropertyName("result")] public new List Result { get; set; } + public Dictionary SettingsChange { get; set; } + public string DebugMessage { get; set; } } - + public class JsonRPCRequestModel { public string Method { get; set; } public object[] Parameters { get; set; } + public Dictionary Settings { get; set; } + private static readonly JsonSerializerOptions options = new() { PropertyNamingPolicy = JsonNamingPolicy.CamelCase @@ -86,5 +90,7 @@ namespace Flow.Launcher.Core.Plugin public class JsonRPCResult : Result { public JsonRPCClientRequestModel JsonRPCAction { get; set; } + + public Dictionary SettingsChange { get; set; } } } \ No newline at end of file diff --git a/Flow.Launcher.Core/Plugin/JsonRPCConfigurationModel.cs b/Flow.Launcher.Core/Plugin/JsonRPCConfigurationModel.cs new file mode 100644 index 000000000..1f63f85a8 --- /dev/null +++ b/Flow.Launcher.Core/Plugin/JsonRPCConfigurationModel.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; + +namespace Flow.Launcher.Core.Plugin +{ + public class JsonRpcConfigurationModel + { + public List Body { get; set; } + public void Deconstruct(out List Body) + { + Body = this.Body; + } + } + + public class SettingField + { + public string Type { get; set; } + public FieldAttributes Attributes { get; set; } + public void Deconstruct(out string Type, out FieldAttributes attributes) + { + Type = this.Type; + attributes = this.Attributes; + } + } + public class FieldAttributes + { + public string Name { get; set; } + public string Label { get; set; } + public string Description { get; set; } + public bool Validation { get; set; } + public List Options { get; set; } + public string DefaultValue { get; set; } + public char passwordChar { get; set; } + public void Deconstruct(out string Name, out string Label, out string Description, out bool Validation, out List Options, out string DefaultValue) + { + Name = this.Name; + Label = this.Label; + Description = this.Description; + Validation = this.Validation; + Options = this.Options; + DefaultValue = this.DefaultValue; + } + } +} \ No newline at end of file diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs index 65977219d..4cfa83382 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs @@ -1,4 +1,6 @@ -using Flow.Launcher.Core.Resource; +using Accessibility; +using Flow.Launcher.Core.Resource; +using Flow.Launcher.Infrastructure; using System; using System.Collections.Generic; using System.Diagnostics; @@ -8,12 +10,24 @@ using System.Reflection; using System.Text.Json; using System.Threading; using System.Threading.Tasks; -using System.Windows.Forms; using Flow.Launcher.Infrastructure.Logger; +using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using ICSharpCode.SharpZipLib.Zip; using JetBrains.Annotations; using Microsoft.IO; +using System.Text.Json.Serialization; +using System.Windows; +using System.Windows.Controls; +using YamlDotNet.Serialization; +using YamlDotNet.Serialization.NamingConventions; +using CheckBox = System.Windows.Controls.CheckBox; +using Control = System.Windows.Controls.Control; +using Label = System.Windows.Controls.Label; +using Orientation = System.Windows.Controls.Orientation; +using TextBox = System.Windows.Controls.TextBox; +using UserControl = System.Windows.Controls.UserControl; +using System.Windows.Data; namespace Flow.Launcher.Core.Plugin { @@ -21,7 +35,7 @@ namespace Flow.Launcher.Core.Plugin /// Represent the plugin that using JsonPRC /// every JsonRPC plugin should has its own plugin instance /// - internal abstract class JsonRPCPlugin : IAsyncPlugin, IContextMenu + internal abstract class JsonRPCPlugin : IAsyncPlugin, IContextMenu, ISettingProvider, ISavable { protected PluginInitContext context; public const string JsonRPC = "JsonRPC"; @@ -35,6 +49,9 @@ namespace Flow.Launcher.Core.Plugin private static readonly RecyclableMemoryStreamManager BufferManager = new(); + private string SettingConfigurationPath => Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "SettingsTemplate.yaml"); + private string SettingPath => Path.Combine(DataLocation.PluginSettingsDirectory, context.CurrentPluginMetadata.Name, "Settings.json"); + public List LoadContextMenus(Result selectedResult) { var request = new JsonRPCRequestModel @@ -59,6 +76,14 @@ namespace Flow.Launcher.Core.Plugin } }; + private static readonly JsonSerializerOptions settingSerializeOption = new() + { + WriteIndented = true + }; + private Dictionary Settings { get; set; } + + private Dictionary _settingControls = new(); + private async Task> DeserializedResultAsync(Stream output) { if (output == Stream.Null) return null; @@ -92,6 +117,8 @@ namespace Flow.Launcher.Core.Plugin { result.Action = c => { + UpdateSettings(result.SettingsChange); + if (result.JsonRPCAction == null) return false; if (string.IsNullOrEmpty(result.JsonRPCAction.Method)) @@ -131,6 +158,8 @@ namespace Flow.Launcher.Core.Plugin results.AddRange(queryResponseModel.Result); + UpdateSettings(queryResponseModel.SettingsChange); + return results; } @@ -283,19 +312,227 @@ namespace Flow.Launcher.Core.Plugin var request = new JsonRPCRequestModel { Method = "query", - Parameters = new[] + Parameters = new object[] { query.Search - } + }, + Settings = Settings }; var output = await RequestAsync(request, token); return await DeserializedResultAsync(output); } - public virtual Task InitAsync(PluginInitContext context) + public async Task InitSettingAsync() + { + if (!File.Exists(SettingConfigurationPath)) + return; + + if (File.Exists(SettingPath)) + { + await using var fileStream = File.OpenRead(SettingPath); + Settings = await JsonSerializer.DeserializeAsync>(fileStream, options); + } + + var deserializer = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build(); + _settingsTemplate = deserializer.Deserialize(await File.ReadAllTextAsync(SettingConfigurationPath)); + + Settings ??= new Dictionary(); + + foreach (var (type, attribute) in _settingsTemplate.Body) + { + if (type == "textBlock") + continue; + if (!Settings.ContainsKey(attribute.Name)) + { + Settings[attribute.Name] = attribute.DefaultValue; + } + } + } + + public virtual async Task InitAsync(PluginInitContext context) { this.context = context; - return Task.CompletedTask; + await InitSettingAsync(); + } + private static readonly Thickness settingControlMargin = new(10, 4, 10, 4); + private static readonly Thickness settingPanelMargin = new(15, 20, 15, 20); + private static readonly Thickness settingTextBlockMargin = new(10, 4, 10, 4); + private JsonRpcConfigurationModel _settingsTemplate; + public Control CreateSettingPanel() + { + if (Settings == null) + return new(); + var settingWindow = new UserControl(); + var mainPanel = new StackPanel + { + Margin = settingPanelMargin, + Orientation = Orientation.Vertical + }; + settingWindow.Content = mainPanel; + + foreach (var (type, attribute) in _settingsTemplate.Body) + { + var panel = new StackPanel + { + Orientation = Orientation.Horizontal, + Margin = settingControlMargin + }; + var name = new TextBlock() + { + Text = attribute.Label, + Width = 120, + VerticalAlignment = VerticalAlignment.Center, + Margin = settingControlMargin, + TextWrapping = TextWrapping.WrapWithOverflow + }; + + FrameworkElement contentControl; + + switch (type) + { + case "textBlock": + { + contentControl = new TextBlock + { + Text = attribute.Description.Replace("\\r\\n", "\r\n"), + Margin = settingTextBlockMargin, + MaxWidth = 500, + TextWrapping = TextWrapping.WrapWithOverflow + }; + break; + } + case "input": + { + var textBox = new TextBox() + { + Width = 300, + Text = Settings[attribute.Name] as string ?? string.Empty, + Margin = settingControlMargin, + ToolTip = attribute.Description + }; + textBox.TextChanged += (_, _) => + { + Settings[attribute.Name] = textBox.Text; + }; + contentControl = textBox; + break; + } + case "textarea": + { + var textBox = new TextBox() + { + Width = 300, + Height = 120, + Margin = settingControlMargin, + TextWrapping = TextWrapping.WrapWithOverflow, + AcceptsReturn = true, + Text = Settings[attribute.Name] as string ?? string.Empty, + ToolTip = attribute.Description + }; + textBox.TextChanged += (sender, _) => + { + Settings[attribute.Name] = ((TextBox)sender).Text; + }; + contentControl = textBox; + break; + } + case "passwordBox": + { + var passwordBox = new PasswordBox() + { + Width = 300, + Margin = settingControlMargin, + Password = Settings[attribute.Name] as string ?? string.Empty, + PasswordChar = attribute.passwordChar == default ? '*' : attribute.passwordChar, + ToolTip = attribute.Description + }; + passwordBox.PasswordChanged += (sender, _) => + { + Settings[attribute.Name] = ((PasswordBox)sender).Password; + }; + contentControl = passwordBox; + break; + } + case "dropdown": + { + var comboBox = new ComboBox() + { + ItemsSource = attribute.Options, + SelectedItem = Settings[attribute.Name], + Margin = settingControlMargin, + ToolTip = attribute.Description + }; + comboBox.SelectionChanged += (sender, _) => + { + Settings[attribute.Name] = (string)((ComboBox)sender).SelectedItem; + }; + contentControl = comboBox; + break; + } + case "checkbox": + var checkBox = new CheckBox + { + IsChecked = Settings[attribute.Name] is bool isChecked ? isChecked : bool.Parse(attribute.DefaultValue), + Margin = settingControlMargin, + ToolTip = attribute.Description + }; + checkBox.Click += (sender, _) => + { + Settings[attribute.Name] = ((CheckBox)sender).IsChecked; + }; + contentControl = checkBox; + break; + default: + continue; + } + if (type != "textBlock") + _settingControls[attribute.Name] = contentControl; + panel.Children.Add(name); + panel.Children.Add(contentControl); + mainPanel.Children.Add(panel); + } + return settingWindow; + } + public void Save() + { + if (Settings != null) + { + Helper.ValidateDirectory(Path.Combine(DataLocation.PluginSettingsDirectory, context.CurrentPluginMetadata.Name)); + File.WriteAllText(SettingPath, JsonSerializer.Serialize(Settings, settingSerializeOption)); + } + } + + public void UpdateSettings(Dictionary settings) + { + if (settings == null || settings.Count == 0) + return; + + foreach (var (key, value) in settings) + { + if (Settings.ContainsKey(key)) + { + Settings[key] = value; + } + if (_settingControls.ContainsKey(key)) + { + + switch (_settingControls[key]) + { + case TextBox textBox: + textBox.Dispatcher.Invoke(() => textBox.Text = value as string); + break; + case PasswordBox passwordBox: + passwordBox.Dispatcher.Invoke(() => passwordBox.Password = value as string); + break; + case ComboBox comboBox: + comboBox.Dispatcher.Invoke(() => comboBox.SelectedItem = value); + break; + case CheckBox checkBox: + checkBox.Dispatcher.Invoke(() => checkBox.IsChecked = value is bool isChecked ? isChecked : bool.Parse(value as string)); + break; + } + } + } } } } \ No newline at end of file diff --git a/Flow.Launcher.Core/Plugin/PythonPlugin.cs b/Flow.Launcher.Core/Plugin/PythonPlugin.cs index 5711ed6aa..8f7e5760a 100644 --- a/Flow.Launcher.Core/Plugin/PythonPlugin.cs +++ b/Flow.Launcher.Core/Plugin/PythonPlugin.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Diagnostics; using System.IO; using System.Threading; @@ -28,6 +28,11 @@ namespace Flow.Launcher.Core.Plugin var path = Path.Combine(Constant.ProgramDirectory, JsonRPC); _startInfo.EnvironmentVariables["PYTHONPATH"] = path; + _startInfo.EnvironmentVariables["FLOW_VERSION"] = Constant.Version; + _startInfo.EnvironmentVariables["FLOW_PROGRAM_DIRECTORY"] = Constant.ProgramDirectory; + _startInfo.EnvironmentVariables["FLOW_APPLICATION_DIRECTORY"] = Constant.ApplicationDirectory; + + //Add -B flag to tell python don't write .py[co] files. Because .pyc contains location infos which will prevent python portable _startInfo.ArgumentList.Add("-B"); } @@ -46,15 +51,12 @@ namespace Flow.Launcher.Core.Plugin // TODO: Async Action return Execute(_startInfo); } - public override Task InitAsync(PluginInitContext context) + public override async Task InitAsync(PluginInitContext context) { - this.context = context; _startInfo.ArgumentList.Add(context.CurrentPluginMetadata.ExecuteFilePath); _startInfo.ArgumentList.Add(""); - + await base.InitAsync(context); _startInfo.WorkingDirectory = context.CurrentPluginMetadata.PluginDirectory; - - return Task.CompletedTask; } } -} \ No newline at end of file +} diff --git a/Flow.Launcher.Core/Resource/AvailableLanguages.cs b/Flow.Launcher.Core/Resource/AvailableLanguages.cs index 3c3dbc76f..0ad7ede1e 100644 --- a/Flow.Launcher.Core/Resource/AvailableLanguages.cs +++ b/Flow.Launcher.Core/Resource/AvailableLanguages.cs @@ -17,7 +17,8 @@ namespace Flow.Launcher.Core.Resource public static Language German = new Language("de", "Deutsch"); public static Language Korean = new Language("ko", "한국어"); public static Language Serbian = new Language("sr", "Srpski"); - public static Language Portuguese_BR = new Language("pt-br", "Português (Brasil)"); + public static Language Portuguese_Portugal = new Language("pt-pt", "Português"); + public static Language Portuguese_Brazil = new Language("pt-br", "Português (Brasil)"); public static Language Italian = new Language("it", "Italiano"); public static Language Norwegian_Bokmal = new Language("nb-NO", "Norsk Bokmål"); public static Language Slovak = new Language("sk", "Slovenský"); @@ -40,7 +41,8 @@ namespace Flow.Launcher.Core.Resource German, Korean, Serbian, - Portuguese_BR, + Portuguese_Portugal, + Portuguese_Brazil, Italian, Norwegian_Bokmal, Slovak, diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index 78e8c5cbf..374f7c71f 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -10,6 +10,7 @@ using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using System.Globalization; +using System.Threading.Tasks; namespace Flow.Launcher.Core.Resource { @@ -95,10 +96,13 @@ namespace Flow.Launcher.Core.Resource { LoadLanguage(language); } - UpdatePluginMetadataTranslations(); Settings.Language = language.LanguageCode; CultureInfo.CurrentCulture = new CultureInfo(language.LanguageCode); CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture; + Task.Run(() => + { + UpdatePluginMetadataTranslations(); + }); } public bool PromptShouldUsePinyin(string languageCodeToSet) diff --git a/Flow.Launcher.Core/Updater.cs b/Flow.Launcher.Core/Updater.cs index e09c6380c..69b537b39 100644 --- a/Flow.Launcher.Core/Updater.cs +++ b/Flow.Launcher.Core/Updater.cs @@ -91,8 +91,9 @@ namespace Flow.Launcher.Core catch (Exception e) when (e is HttpRequestException or WebException or SocketException || e.InnerException is TimeoutException) { Log.Exception($"|Updater.UpdateApp|Check your connection and proxy settings to github-cloud.s3.amazonaws.com.", e); - api.ShowMsg(api.GetTranslation("update_flowlauncher_fail"), - api.GetTranslation("update_flowlauncher_check_connection")); + if (!silentUpdate) + api.ShowMsg(api.GetTranslation("update_flowlauncher_fail"), + api.GetTranslation("update_flowlauncher_check_connection")); } finally { @@ -124,7 +125,7 @@ namespace Flow.Launcher.Core var releases = await System.Text.Json.JsonSerializer.DeserializeAsync>(jsonStream).ConfigureAwait(false); var latest = releases.Where(r => !r.Prerelease).OrderByDescending(r => r.PublishedAt).First(); var latestUrl = latest.HtmlUrl.Replace("/tag/", "/download/"); - + var client = new WebClient { Proxy = Http.WebProxy diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs index cd49217a4..57b39e46e 100644 --- a/Flow.Launcher.Infrastructure/Constant.cs +++ b/Flow.Launcher.Infrastructure/Constant.cs @@ -21,7 +21,7 @@ namespace Flow.Launcher.Infrastructure public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins); public const string Issue = "https://github.com/Flow-Launcher/Flow.Launcher/issues/new"; public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion; - public const string Documentation = "https://flow-launcher.github.io/docs/#/usage-tips"; + public const string Documentation = "https://flowlauncher.com/docs/#/usage-tips"; public static readonly int ThumbnailSize = 64; private static readonly string ImagesDirectory = Path.Combine(ProgramDirectory, "Images"); @@ -43,8 +43,8 @@ namespace Flow.Launcher.Infrastructure public const string Settings = "Settings"; public const string Logs = "Logs"; - public const string Website = "https://flow-launcher.github.io"; + public const string Website = "https://flowlauncher.com"; public const string GitHub = "https://github.com/Flow-Launcher/Flow.Launcher"; - public const string Docs = "https://flow-launcher.github.io/docs"; + public const string Docs = "https://flowlauncher.com/docs"; } } diff --git a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj index e01bc1efd..40c2cb956 100644 --- a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj +++ b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj @@ -11,6 +11,7 @@ false false false + true @@ -21,7 +22,6 @@ DEBUG;TRACE prompt 4 - true false @@ -32,7 +32,6 @@ TRACE prompt 4 - false false diff --git a/Flow.Launcher.Infrastructure/Hotkey/GlobalHotkey.cs b/Flow.Launcher.Infrastructure/Hotkey/GlobalHotkey.cs index e92a93c12..a09185696 100644 --- a/Flow.Launcher.Infrastructure/Hotkey/GlobalHotkey.cs +++ b/Flow.Launcher.Infrastructure/Hotkey/GlobalHotkey.cs @@ -9,13 +9,14 @@ namespace Flow.Launcher.Infrastructure.Hotkey /// Listens keyboard globally. /// Uses WH_KEYBOARD_LL. /// - public class GlobalHotkey : IDisposable + public unsafe class GlobalHotkey : IDisposable { - private static GlobalHotkey instance; - private InterceptKeys.LowLevelKeyboardProc hookedLowLevelKeyboardProc; - private IntPtr hookId = IntPtr.Zero; + private static readonly IntPtr hookId; + + + public delegate bool KeyboardCallback(KeyEvent keyEvent, int vkCode, SpecialKeyState state); - public event KeyboardCallback hookedKeyboardCallback; + internal static Func hookedKeyboardCallback; //Modifier key constants private const int VK_SHIFT = 0x10; @@ -23,27 +24,13 @@ namespace Flow.Launcher.Infrastructure.Hotkey private const int VK_ALT = 0x12; private const int VK_WIN = 91; - public static GlobalHotkey Instance + static GlobalHotkey() { - get - { - if (instance == null) - { - instance = new GlobalHotkey(); - } - return instance; - } - } - - private GlobalHotkey() - { - // We have to store the LowLevelKeyboardProc, so that it is not garbage collected runtime - hookedLowLevelKeyboardProc = LowLevelKeyboardProc; // Set the hook - hookId = InterceptKeys.SetHook(hookedLowLevelKeyboardProc); + hookId = InterceptKeys.SetHook(& LowLevelKeyboardProc); } - public SpecialKeyState CheckModifiers() + public static SpecialKeyState CheckModifiers() { SpecialKeyState state = new SpecialKeyState(); if ((InterceptKeys.GetKeyState(VK_SHIFT) & 0x8000) != 0) @@ -70,8 +57,8 @@ namespace Flow.Launcher.Infrastructure.Hotkey return state; } - [MethodImpl(MethodImplOptions.NoInlining)] - private IntPtr LowLevelKeyboardProc(int nCode, UIntPtr wParam, IntPtr lParam) + [UnmanagedCallersOnly] + private static IntPtr LowLevelKeyboardProc(int nCode, UIntPtr wParam, IntPtr lParam) { bool continues = true; @@ -91,17 +78,17 @@ namespace Flow.Launcher.Infrastructure.Hotkey { return InterceptKeys.CallNextHookEx(hookId, nCode, wParam, lParam); } - return (IntPtr)1; - } - - ~GlobalHotkey() - { - Dispose(); + return (IntPtr)(-1); } public void Dispose() { InterceptKeys.UnhookWindowsHookEx(hookId); } + + ~GlobalHotkey() + { + Dispose(); + } } } \ No newline at end of file diff --git a/Flow.Launcher.Infrastructure/Hotkey/InterceptKeys.cs b/Flow.Launcher.Infrastructure/Hotkey/InterceptKeys.cs index c45e685f3..d33bac34c 100644 --- a/Flow.Launcher.Infrastructure/Hotkey/InterceptKeys.cs +++ b/Flow.Launcher.Infrastructure/Hotkey/InterceptKeys.cs @@ -4,13 +4,13 @@ using System.Runtime.InteropServices; namespace Flow.Launcher.Infrastructure.Hotkey { - internal static class InterceptKeys + internal static unsafe class InterceptKeys { public delegate IntPtr LowLevelKeyboardProc(int nCode, UIntPtr wParam, IntPtr lParam); private const int WH_KEYBOARD_LL = 13; - public static IntPtr SetHook(LowLevelKeyboardProc proc) + public static IntPtr SetHook(delegate* unmanaged proc) { using (Process curProcess = Process.GetCurrentProcess()) using (ProcessModule curModule = curProcess.MainModule) @@ -20,7 +20,7 @@ namespace Flow.Launcher.Infrastructure.Hotkey } [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] - public static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId); + public static extern IntPtr SetWindowsHookEx(int idHook, delegate* unmanaged lpfn, IntPtr hMod, uint dwThreadId); [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] diff --git a/Flow.Launcher.Infrastructure/Http/Http.cs b/Flow.Launcher.Infrastructure/Http/Http.cs index b45b6adcd..9f4146b7b 100644 --- a/Flow.Launcher.Infrastructure/Http/Http.cs +++ b/Flow.Launcher.Infrastructure/Http/Http.cs @@ -153,5 +153,13 @@ namespace Flow.Launcher.Infrastructure.Http var response = await client.GetAsync(url, HttpCompletionOption.ResponseHeadersRead, token); return await response.Content.ReadAsStreamAsync(); } + + /// + /// Asynchrously send an HTTP request. + /// + public static async Task SendAsync(HttpRequestMessage request, CancellationToken token = default) + { + return await client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, token); + } } } diff --git a/Flow.Launcher.Infrastructure/Logger/Log.cs b/Flow.Launcher.Infrastructure/Logger/Log.cs index 26e305ace..75f208c9e 100644 --- a/Flow.Launcher.Infrastructure/Logger/Log.cs +++ b/Flow.Launcher.Infrastructure/Logger/Log.cs @@ -211,4 +211,4 @@ namespace Flow.Launcher.Infrastructure.Logger LogInternal(message, LogLevel.Warn); } } -} \ No newline at end of file +} diff --git a/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs new file mode 100644 index 000000000..24584115d --- /dev/null +++ b/Flow.Launcher.Infrastructure/UserSettings/CustomBrowserViewModel.cs @@ -0,0 +1,33 @@ +using Flow.Launcher.Plugin; +using System.Text.Json.Serialization; + +namespace Flow.Launcher.Infrastructure.UserSettings +{ + public class CustomBrowserViewModel : BaseModel + { + public string Name { get; set; } + public string Path { get; set; } + public string PrivateArg { get; set; } + public bool EnablePrivate { get; set; } + public bool OpenInTab { get; set; } = true; + [JsonIgnore] + public bool OpenInNewWindow => !OpenInTab; + public bool Editable { get; set; } = true; + + public CustomBrowserViewModel Copy() + { + return new CustomBrowserViewModel + { + Name = Name, + Path = Path, + OpenInTab = OpenInTab, + PrivateArg = PrivateArg, + EnablePrivate = EnablePrivate, + Editable = Editable + }; + } + } +} + + + diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index de840cdb1..8ecd6dc4b 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -15,7 +15,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings private string language = "en"; public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}"; public string OpenResultModifiers { get; set; } = KeyConstant.Alt; - public string DarkMode { get; set; } = "System"; + public string ColorScheme { get; set; } = "System"; public bool ShowOpenResultHotkey { get; set; } = true; public double WindowSize { get; set; } = 580; @@ -39,6 +39,9 @@ namespace Flow.Launcher.Infrastructure.UserSettings public string ResultFontWeight { get; set; } public string ResultFontStretch { get; set; } public bool UseGlyphIcons { get; set; } = true; + public bool UseAnimation { get; set; } = true; + public bool UseSound { get; set; } = true; + public bool FirstLaunch { get; set; } = true; public int CustomExplorerIndex { get; set; } = 0; @@ -83,8 +86,52 @@ namespace Flow.Launcher.Infrastructure.UserSettings } }; - public bool UseAnimation { get; set; } = true; - public bool UseSound { get; set; } = true; + public int CustomBrowserIndex { get; set; } = 0; + + [JsonIgnore] + public CustomBrowserViewModel CustomBrowser + { + get => CustomBrowserList[CustomBrowserIndex]; + set => CustomBrowserList[CustomBrowserIndex] = value; + } + + public List CustomBrowserList { get; set; } = new() + { + new() + { + Name = "Default", + Path = "*", + PrivateArg = "", + EnablePrivate = false, + Editable = false + }, + new() + { + Name = "Google Chrome", + Path = "chrome", + PrivateArg = "-incognito", + EnablePrivate = false, + Editable = false + }, + new() + { + Name = "Mozilla Firefox", + Path = "firefox", + PrivateArg = "-private", + EnablePrivate = false, + Editable = false + } + , + new() + { + Name = "MS Edge", + Path = "msedge", + PrivateArg = "-inPrivate", + EnablePrivate = false, + Editable = false + } + }; + /// /// when false Alphabet static service will always return empty results @@ -134,7 +181,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool EnableUpdateLog { get; set; } public bool StartFlowLauncherOnSystemStartup { get; set; } = false; - public bool HideOnStartup { get; set; } + public bool HideOnStartup { get; set; } = true; bool _hideNotifyIcon { get; set; } public bool HideNotifyIcon { @@ -167,7 +214,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings Preserved } - public enum DarkMode + public enum ColorSchemes { System, Light, diff --git a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj index c808052b0..6bab0583d 100644 --- a/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj +++ b/Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj @@ -1,4 +1,4 @@ - + net5.0-windows @@ -14,10 +14,10 @@ - 2.0.0 - 2.0.0 - 2.0.0 - 2.0.0 + 2.1.1 + 2.1.1 + 2.1.1 + 2.1.1 Flow.Launcher.Plugin Flow-Launcher MIT @@ -42,6 +42,7 @@ 4 AnyCPU false + ..\Output\Debug\Flow.Launcher.Plugin.xml diff --git a/Flow.Launcher.Plugin/GlyphInfo.cs b/Flow.Launcher.Plugin/GlyphInfo.cs index d24624d8f..730046e1d 100644 --- a/Flow.Launcher.Plugin/GlyphInfo.cs +++ b/Flow.Launcher.Plugin/GlyphInfo.cs @@ -7,5 +7,10 @@ using System.Windows.Media; namespace Flow.Launcher.Plugin { + /// + /// Text with FontFamily specified + /// + /// Font Family of this Glyph + /// Text/Unicode of the Glyph public record GlyphInfo(string FontFamily, string Glyph); } diff --git a/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs b/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs index e332d450e..61662b671 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPluginI18n.cs @@ -1,4 +1,6 @@ -namespace Flow.Launcher.Plugin +using System.Globalization; + +namespace Flow.Launcher.Plugin { /// /// Represent plugins that support internationalization @@ -8,5 +10,13 @@ string GetTranslatedPluginTitle(); string GetTranslatedPluginDescription(); + + /// + /// The method will be invoked when language of flow changed + /// + void OnCultureInfoChanged(CultureInfo newCulture) + { + + } } } \ No newline at end of file diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index 908284bb9..133ad25a5 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -37,6 +37,12 @@ namespace Flow.Launcher.Plugin /// Thrown when unable to find the file specified in the command /// Thrown when error occurs during the execution of the command void ShellRun(string cmd, string filename = "cmd.exe"); + + /// + /// Copy Text to clipboard + /// + /// Text to save on clipboard + public void CopyToClipboard(string text); /// /// Save everything, all of Flow Launcher and plugins' data and settings @@ -113,7 +119,21 @@ namespace Flow.Launcher.Plugin /// Fired after global keyboard events /// if you want to hook something like Ctrl+R, you should use this event /// + [Obsolete("Unable to Retrieve correct return value")] event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent; + + /// + /// Register a callback for Global Keyboard Event + /// + /// + public void RegisterGlobalKeyboardCallback(Func callback); + + /// + /// Remove a callback for Global Keyboard Event + /// + /// + public void RemoveGlobalKeyboardCallback(Func callback); + /// /// Fuzzy Search the string with the given query. This is the core search mechanism Flow uses @@ -206,5 +226,10 @@ namespace Flow.Launcher.Plugin /// Directory Path to open /// Extra FileName Info public void OpenDirectory(string DirectoryPath, string FileName = null); + + /// + /// Opens the url. The browser and mode used is based on what's configured in Flow's default browser settings. + /// + public void OpenUrl(string url, bool? inPrivate = null); } } diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 833ada9cd..fe80292be 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Windows.Media; @@ -10,11 +10,11 @@ namespace Flow.Launcher.Plugin { private string _pluginDirectory; - + private string _icoPath; /// - /// Provides the title of the result. This is always required. + /// The title of the result. This is always required. /// public string Title { get; set; } @@ -29,6 +29,18 @@ namespace Flow.Launcher.Plugin /// public string ActionKeywordAssigned { get; set; } + /// + /// This holds the text which can be provided by plugin to help Flow autocomplete text + /// for user on the plugin result. If autocomplete action for example is tab, pressing tab will have + /// the default constructed autocomplete text (result's Title), or the text provided here if not empty. + /// + public string AutoCompleteText { get; set; } + + /// + /// Image Displayed on the result + /// Relative Path to the Image File + /// GlyphInfo is prioritized if not null + /// public string IcoPath { get { return _icoPath; } @@ -53,16 +65,23 @@ namespace Flow.Launcher.Plugin public IconDelegate Icon; /// - /// Information for Glyph Icon + /// Information for Glyph Icon (Prioritized than IcoPath/Icon if user enable Glyph Icons) /// - public GlyphInfo Glyph { get; init; } + public GlyphInfo Glyph { get; init; } /// - /// return true to hide flowlauncher after select result + /// Delegate. An action to take in the form of a function call when the result has been selected + /// + /// true to hide flowlauncher after select result + /// /// public Func Action { get; set; } + /// + /// Priority of the current result + /// default: 0 + /// public int Score { get; set; } /// @@ -70,13 +89,11 @@ namespace Flow.Launcher.Plugin /// public IList TitleHighlightData { get; set; } - /// - /// A list of indexes for the characters to be highlighted in SubTitle - /// + [Obsolete("Deprecated as of Flow Launcher v1.9.1. Subtitle highlighting is no longer offered")] public IList SubTitleHighlightData { get; set; } /// - /// Only results that originQuery match with current query will be displayed in the panel + /// Query information associated with the result /// internal Query OriginQuery { get; set; } @@ -96,6 +113,7 @@ namespace Flow.Launcher.Plugin } } + /// public override bool Equals(object obj) { var r = obj as Result; @@ -103,12 +121,12 @@ namespace Flow.Launcher.Plugin var equality = string.Equals(r?.Title, Title) && string.Equals(r?.SubTitle, SubTitle) && string.Equals(r?.IcoPath, IcoPath) && - TitleHighlightData == r.TitleHighlightData && - SubTitleHighlightData == r.SubTitleHighlightData; + TitleHighlightData == r.TitleHighlightData; return equality; } + /// public override int GetHashCode() { var hashcode = (Title?.GetHashCode() ?? 0) ^ @@ -116,15 +134,17 @@ namespace Flow.Launcher.Plugin return hashcode; } + /// public override string ToString() { return Title + SubTitle; } - public Result() { } - /// - /// Additional data associate with this result + /// Additional data associated with this result + /// + /// As external information for ContextMenu + /// /// public object ContextData { get; set; } diff --git a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs index 95d057707..6c4ac8ebf 100644 --- a/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs +++ b/Flow.Launcher.Plugin/SharedCommands/SearchWeb.cs @@ -35,18 +35,21 @@ namespace Flow.Launcher.Plugin.SharedCommands /// Opens search in a new browser. If no browser path is passed in then Chrome is used. /// Leave browser path blank to use Chrome. /// - public static void NewBrowserWindow(this string url, string browserPath = "") + public static void OpenInBrowserWindow(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") { browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath; var browserExecutableName = browserPath? - .Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.None) - .Last(); + .Split(new[] + { + Path.DirectorySeparatorChar + }, StringSplitOptions.None) + .Last(); var browser = string.IsNullOrEmpty(browserExecutableName) ? "chrome" : browserPath; // Internet Explorer will open url in new browser window, and does not take the --new-window parameter - var browserArguements = browserExecutableName == "iexplore.exe" ? url : "--new-window " + url; + var browserArguements = (browserExecutableName == "iexplore.exe" ? "" : "--new-window ") + (inPrivate ? $"{privateArg} " : "") + url; var psi = new ProcessStartInfo { @@ -61,24 +64,36 @@ namespace Flow.Launcher.Plugin.SharedCommands } catch (System.ComponentModel.Win32Exception) { - Process.Start(new ProcessStartInfo { FileName = url, UseShellExecute = true }); + Process.Start(new ProcessStartInfo + { + FileName = url, UseShellExecute = true + }); } } + [Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")] + public static void NewBrowserWindow(this string url, string browserPath = "") + { + OpenInBrowserWindow(url, browserPath); + } + /// /// Opens search as a tab in the default browser chosen in Windows settings. /// - public static void NewTabInBrowser(this string url, string browserPath = "") + public static void OpenInBrowserTab(this string url, string browserPath = "", bool inPrivate = false, string privateArg = "") { browserPath = string.IsNullOrEmpty(browserPath) ? GetDefaultBrowserPath() : browserPath; - var psi = new ProcessStartInfo() { UseShellExecute = true }; + var psi = new ProcessStartInfo() + { + UseShellExecute = true + }; try { if (!string.IsNullOrEmpty(browserPath)) { psi.FileName = browserPath; - psi.Arguments = url; + psi.Arguments = (inPrivate ? $"{privateArg} " : "") + url; } else { @@ -90,8 +105,17 @@ namespace Flow.Launcher.Plugin.SharedCommands // This error may be thrown if browser path is incorrect catch (System.ComponentModel.Win32Exception) { - Process.Start(new ProcessStartInfo { FileName = url, UseShellExecute = true }); + Process.Start(new ProcessStartInfo + { + FileName = url, UseShellExecute = true + }); } } + + [Obsolete("This is provided for backwards compatibility after 1.9.0 release, e.g. GitHub plugin. Use the new method instead")] + public static void NewTabInBrowser(this string url, string browserPath = "") + { + OpenInBrowserTab(url, browserPath); + } } -} +} \ No newline at end of file diff --git a/Flow.Launcher.sln b/Flow.Launcher.sln index 21c3b47dc..b8deae553 100644 --- a/Flow.Launcher.sln +++ b/Flow.Launcher.sln @@ -13,7 +13,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{3A73 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launcher\Flow.Launcher.csproj", "{DB90F671-D861-46BB-93A3-F1304F5BA1C5}" ProjectSection(ProjectDependencies) = postProject - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} {4792A74A-0CEA-4173-A8B2-30E6764C6217} = {4792A74A-0CEA-4173-A8B2-30E6764C6217} {FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {FDB3555B-58EF-4AE6-B5F1-904719637AB4} @@ -23,6 +22,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher", "Flow.Launc {9B130CC5-14FB-41FF-B310-0A95B6894C37} = {9B130CC5-14FB-41FF-B310-0A95B6894C37} {FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {FDED22C8-B637-42E8-824A-63B5B6E05A3A} {A3DCCBCA-ACC1-421D-B16E-210896234C26} = {A3DCCBCA-ACC1-421D-B16E-210896234C26} + {5043CECE-E6A7-4867-9CBE-02D27D83747A} = {5043CECE-E6A7-4867-9CBE-02D27D83747A} {403B57F2-1856-4FC7-8A24-36AB346B763E} = {403B57F2-1856-4FC7-8A24-36AB346B763E} {588088F4-3262-4F9F-9663-A05DE12534C3} = {588088F4-3262-4F9F-9663-A05DE12534C3} EndProjectSection @@ -35,8 +35,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Progra EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.WebSearch", "Plugins\Flow.Launcher.Plugin.WebSearch\Flow.Launcher.Plugin.WebSearch.csproj", "{403B57F2-1856-4FC7-8A24-36AB346B763E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.ControlPanel", "Plugins\Flow.Launcher.Plugin.ControlPanel\Flow.Launcher.Plugin.ControlPanel.csproj", "{1EE20B48-82FB-48A2-8086-675D6DDAB4F0}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.PluginIndicator", "Plugins\Flow.Launcher.Plugin.PluginIndicator\Flow.Launcher.Plugin.PluginIndicator.csproj", "{FDED22C8-B637-42E8-824A-63B5B6E05A3A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Sys", "Plugins\Flow.Launcher.Plugin.Sys\Flow.Launcher.Plugin.Sys.csproj", "{0B9DE348-9361-4940-ADB6-F5953BFFCCEC}" @@ -68,6 +66,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.Proces EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.PluginsManager", "Plugins\Flow.Launcher.Plugin.PluginsManager\Flow.Launcher.Plugin.PluginsManager.csproj", "{4792A74A-0CEA-4173-A8B2-30E6764C6217}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Plugin.WindowsSettings", "Plugins\Flow.Launcher.Plugin.WindowsSettings\Flow.Launcher.Plugin.WindowsSettings.csproj", "{5043CECE-E6A7-4867-9CBE-02D27D83747A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -162,18 +162,6 @@ Global {403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|x64.Build.0 = Release|Any CPU {403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|x86.ActiveCfg = Release|Any CPU {403B57F2-1856-4FC7-8A24-36AB346B763E}.Release|x86.Build.0 = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x64.ActiveCfg = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x64.Build.0 = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x86.ActiveCfg = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Debug|x86.Build.0 = Debug|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|Any CPU.Build.0 = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x64.ActiveCfg = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x64.Build.0 = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x86.ActiveCfg = Release|Any CPU - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0}.Release|x86.Build.0 = Release|Any CPU {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|Any CPU.Build.0 = Debug|Any CPU {FDED22C8-B637-42E8-824A-63B5B6E05A3A}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -283,6 +271,18 @@ Global {4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x64.Build.0 = Release|Any CPU {4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.ActiveCfg = Release|Any CPU {4792A74A-0CEA-4173-A8B2-30E6764C6217}.Release|x86.Build.0 = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.ActiveCfg = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x64.Build.0 = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x86.ActiveCfg = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Debug|x86.Build.0 = Debug|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|Any CPU.Build.0 = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.ActiveCfg = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x64.Build.0 = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x86.ActiveCfg = Release|Any CPU + {5043CECE-E6A7-4867-9CBE-02D27D83747A}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -290,7 +290,6 @@ Global GlobalSection(NestedProjects) = preSolution {FDB3555B-58EF-4AE6-B5F1-904719637AB4} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {403B57F2-1856-4FC7-8A24-36AB346B763E} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} - {1EE20B48-82FB-48A2-8086-675D6DDAB4F0} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {FDED22C8-B637-42E8-824A-63B5B6E05A3A} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {0B9DE348-9361-4940-ADB6-F5953BFFCCEC} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {A3DCCBCA-ACC1-421D-B16E-210896234C26} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} @@ -300,6 +299,7 @@ Global {F9C4C081-4CC3-4146-95F1-E102B4E10A5F} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {588088F4-3262-4F9F-9663-A05DE12534C3} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} {4792A74A-0CEA-4173-A8B2-30E6764C6217} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} + {5043CECE-E6A7-4867-9CBE-02D27D83747A} = {3A73F5A7-0335-40D8-BF7C-F20BE5D0BA87} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F26ACB50-3F6C-4907-B0C9-1ADACC1D0DED} diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 9ee486b3b..4ebff16a9 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -69,8 +69,6 @@ namespace Flow.Launcher PluginManager.LoadPlugins(_settings.PluginSettings); _mainVM = new MainViewModel(_settings); - HotKeyMapper.Initialize(_mainVM); - API = new PublicAPIInstance(_settingsVM, _mainVM, _alphabet); Http.API = API; @@ -83,6 +81,8 @@ namespace Flow.Launcher Current.MainWindow = window; Current.MainWindow.Title = Constant.FlowLauncher; + + HotKeyMapper.Initialize(_mainVM); // happlebao todo temp fix for instance code logic // load plugin before change language, because plugin language also needs be changed @@ -153,7 +153,6 @@ namespace Flow.Launcher DispatcherUnhandledException += ErrorReporting.DispatcherUnhandledException; } - /// /// let exception throw as normal is better for Debug /// @@ -179,4 +178,4 @@ namespace Flow.Launcher Current.MainWindow.Show(); } } -} \ No newline at end of file +} diff --git a/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs b/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs index c70796a6d..ecdfc5851 100644 --- a/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs +++ b/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs @@ -1,6 +1,8 @@ using System; using System.Globalization; +using System.Windows.Controls; using System.Windows.Data; +using System.Windows.Media; using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.ViewModel; @@ -10,13 +12,13 @@ namespace Flow.Launcher.Converters { public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { - if (values.Length != 2) + if (values.Length != 3) { return string.Empty; } + var QueryTextBox = values[0] as TextBox; - // first prop is the current query string - var queryText = (string)values[0]; + var queryText = (string)values[2]; if (string.IsNullOrEmpty(queryText)) return string.Empty; @@ -43,8 +45,23 @@ namespace Flow.Launcher.Converters if (!selectedResultPossibleSuggestion.StartsWith(queryText, StringComparison.CurrentCultureIgnoreCase)) return string.Empty; + + // For AutocompleteQueryCommand. // When user typed lower case and result title is uppercase, we still want to display suggestion - return queryText + selectedResultPossibleSuggestion.Substring(queryText.Length); + selectedItem.QuerySuggestionText = queryText + selectedResultPossibleSuggestion.Substring(queryText.Length); + + // Check if Text will be larger then our QueryTextBox + System.Windows.Media.Typeface typeface = new Typeface(QueryTextBox.FontFamily, QueryTextBox.FontStyle, QueryTextBox.FontWeight, QueryTextBox.FontStretch); + System.Windows.Media.FormattedText ft = new FormattedText(QueryTextBox.Text, System.Globalization.CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, typeface, QueryTextBox.FontSize, Brushes.Black); + + var offset = QueryTextBox.Padding.Right; + + if ((ft.Width + offset) > QueryTextBox.ActualWidth || QueryTextBox.HorizontalOffset != 0) + { + return string.Empty; + }; + + return selectedItem.QuerySuggestionText; } catch (Exception e) { diff --git a/Flow.Launcher/CustomQueryHotkeySetting.xaml b/Flow.Launcher/CustomQueryHotkeySetting.xaml index 4ba55b110..187f99d18 100644 --- a/Flow.Launcher/CustomQueryHotkeySetting.xaml +++ b/Flow.Launcher/CustomQueryHotkeySetting.xaml @@ -4,7 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:flowlauncher="clr-namespace:Flow.Launcher" Title="{DynamicResource customeQueryHotkeyTitle}" - Width="500" + Width="530" Background="{DynamicResource PopuBGColor}" Foreground="{DynamicResource PopupTextColor}" Icon="Images\app.png" @@ -79,56 +79,70 @@ - - - - - - - - - diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index f431504c2..35a6389ca 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -88,6 +88,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Flow.Launcher/HotkeyControl.xaml b/Flow.Launcher/HotkeyControl.xaml index 94cdc6703..9b5f671d8 100644 --- a/Flow.Launcher/HotkeyControl.xaml +++ b/Flow.Launcher/HotkeyControl.xaml @@ -50,6 +50,7 @@ VerticalContentAlignment="Center" input:InputMethod.IsInputMethodEnabled="False" PreviewKeyDown="TbHotkey_OnPreviewKeyDown" - TabIndex="100" /> + TabIndex="100" + LostFocus="tbHotkey_LostFocus"/> \ No newline at end of file diff --git a/Flow.Launcher/HotkeyControl.xaml.cs b/Flow.Launcher/HotkeyControl.xaml.cs index 2b6e275df..bc437d862 100644 --- a/Flow.Launcher/HotkeyControl.xaml.cs +++ b/Flow.Launcher/HotkeyControl.xaml.cs @@ -8,11 +8,16 @@ using Flow.Launcher.Core.Resource; using Flow.Launcher.Helper; using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Plugin; +using System.Threading; namespace Flow.Launcher { public partial class HotkeyControl : UserControl { + private Brush tbMsgForegroundColorOriginal; + + private string tbMsgTextOriginal; + public HotkeyModel CurrentHotkey { get; private set; } public bool CurrentHotkeyAvailable { get; private set; } @@ -23,17 +28,24 @@ namespace Flow.Launcher public HotkeyControl() { InitializeComponent(); + tbMsgTextOriginal = tbMsg.Text; + tbMsgForegroundColorOriginal = tbMsg.Foreground; } - void TbHotkey_OnPreviewKeyDown(object sender, KeyEventArgs e) + private CancellationTokenSource hotkeyUpdateSource; + + private void TbHotkey_OnPreviewKeyDown(object sender, KeyEventArgs e) { + hotkeyUpdateSource?.Cancel(); + hotkeyUpdateSource?.Dispose(); + hotkeyUpdateSource = new(); + var token = hotkeyUpdateSource.Token; e.Handled = true; - tbMsg.Visibility = Visibility.Hidden; //when alt is pressed, the real key should be e.SystemKey - Key key = (e.Key == Key.System ? e.SystemKey : e.Key); + Key key = e.Key == Key.System ? e.SystemKey : e.Key; - SpecialKeyState specialKeyState = GlobalHotkey.Instance.CheckModifiers(); + SpecialKeyState specialKeyState = GlobalHotkey.CheckModifiers(); var hotkeyModel = new HotkeyModel( specialKeyState.AltPressed, @@ -49,14 +61,15 @@ namespace Flow.Launcher return; } - Dispatcher.InvokeAsync(async () => + _ = Dispatcher.InvokeAsync(async () => { - await Task.Delay(500); - SetHotkey(hotkeyModel); + await Task.Delay(500, token); + if (!token.IsCancellationRequested) + await SetHotkey(hotkeyModel); }); } - public void SetHotkey(HotkeyModel keyModel, bool triggerValidate = true) + public async Task SetHotkey(HotkeyModel keyModel, bool triggerValidate = true) { CurrentHotkey = keyModel; @@ -78,6 +91,13 @@ namespace Flow.Launcher } tbMsg.Visibility = Visibility.Visible; OnHotkeyChanged(); + + var token = hotkeyUpdateSource.Token; + await Task.Delay(500, token); + if (token.IsCancellationRequested) + return; + FocusManager.SetFocusedElement(FocusManager.GetFocusScope(this), null); + Keyboard.ClearFocus(); } } @@ -88,9 +108,12 @@ namespace Flow.Launcher private bool CheckHotkeyAvailability() => HotKeyMapper.CheckAvailability(CurrentHotkey); - public new bool IsFocused + public new bool IsFocused => tbHotkey.IsFocused; + + private void tbHotkey_LostFocus(object sender, RoutedEventArgs e) { - get { return tbHotkey.IsFocused; } + tbMsg.Text = tbMsgTextOriginal; + tbMsg.Foreground = tbMsgForegroundColorOriginal; } } -} +} \ No newline at end of file diff --git a/Flow.Launcher/Images/page_img01.png b/Flow.Launcher/Images/page_img01.png new file mode 100644 index 000000000..fdc411898 Binary files /dev/null and b/Flow.Launcher/Images/page_img01.png differ diff --git a/Flow.Launcher/Images/wizard.png b/Flow.Launcher/Images/wizard.png new file mode 100644 index 000000000..155de20bd Binary files /dev/null and b/Flow.Launcher/Images/wizard.png differ diff --git a/Flow.Launcher/Languages/da.xaml b/Flow.Launcher/Languages/da.xaml index 19e1951d8..9a6e6ebf4 100644 --- a/Flow.Launcher/Languages/da.xaml +++ b/Flow.Launcher/Languages/da.xaml @@ -126,8 +126,8 @@ Opdater Annuler Denne opdatering vil genstarte Flow Launcher - Følgende filer bliver opdateret + Følgende filer bliver opdateret Opdatereringsfiler - Opdateringsbeskrivelse + Opdateringsbeskrivelse diff --git a/Flow.Launcher/Languages/de.xaml b/Flow.Launcher/Languages/de.xaml index 39dc9b377..9572db8cb 100644 --- a/Flow.Launcher/Languages/de.xaml +++ b/Flow.Launcher/Languages/de.xaml @@ -126,8 +126,8 @@ Aktualisieren Abbrechen Diese Aktualisierung wird Flow Launcher neu starten - Folgende Dateien werden aktualisiert + Folgende Dateien werden aktualisiert Aktualisiere Dateien - Aktualisierungbeschreibung + Aktualisierungbeschreibung \ No newline at end of file diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index e7ae0218d..ec355a0ac 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -15,6 +15,9 @@ About Exit Close + Copy + Cut + Paste Game Mode Suspend the use of Hotkeys. @@ -38,6 +41,8 @@ Disable Flow Launcher activation when a full screen application is active (Recommended for games). Default File Manager Select the file manager to use when opening the folder. + Default Web Browser + Setting for New Tab, New Window, Private Mode. Python Directory Auto Update Select @@ -58,11 +63,12 @@ Action keyword Current action keyword New action keyword + Change Action Keywords Current Priority New Priority Priority Plugin Directory - Author: + by Init time: Query time: | Version @@ -87,10 +93,10 @@ Fail to load theme {0}, fallback to default theme Theme Folder Open Theme Folder - Color Scheme - System Default - Light - Dark + Color Scheme + System Default + Light + Dark Sound Effect Play a small sound when the search window opens Animation @@ -152,10 +158,11 @@ DevTools Setting Folder Log Folder + Wizard Select File Manager - Please specify the file location of the file manager you using and add arguments if necessary. The default arguments is "%d", and a path is entered at that location. For example, If a command is required such as "totalcmd.exe /A c:\windows", argument is /A "%d". + Please specify the file location of the file manager you using and add arguments if necessary. The default arguments are "%d", and a path is entered at that location. For example, If a command is required such as "totalcmd.exe /A c:\windows", argument is /A "%d". "%f" is an argument that represent the file path. It is used to emphasize the file/folder name when opening a specific file location in 3rd party file manager. This argument is only available in the "Arg for File" item. If the file manager does not have that function, you can use "%d". File Manager Profile Name @@ -163,6 +170,16 @@ Arg For Folder Arg For File + + Default Web Browser + The default setting follows the OS default browser setting. If specified separately, flow uses that browser. + Browser + Browser Name + Browser Path + New Window + New Tab + Private Mode + Change Priority Greater the number, the higher the result will be ranked. Try setting it as 5. If you want the results to be lower than any other plugin's, provide a negative number @@ -178,7 +195,7 @@ This new Action Keyword is already assigned to another plugin, please choose a different one Success Completed successfully - Enter the action keyword you need to start the plug-in. Use * if you don't want to specify an action keyword. In the case, The plug-in works without keywords. + Enter the action keyword you like to use to start the plugin. Use * if you don't want to specify any, and the plugin will be triggered without any action keywords. Custom Query Hotkey @@ -227,8 +244,45 @@ Update Failed Check your connection and try updating proxy settings to github-cloud.s3.amazonaws.com. This upgrade will restart Flow Launcher - Following files will be updated + Following files will be updated Update files - Update description + Update description + + + Skip + Welcome to Flow Launcher + Hello, this is the first time you are running Flow Launcher! + Before starting, this wizard will assist in setting up Flow Launcher. You can skip this if you wish. Please choose a language + Search and run all files and applications on your PC + Search everything from applications, files, bookmarks, YouTube, Twitter and more. All from the comfort of your keyboard without ever touching the mouse. + Flow Launcher starts with the hotkey below, go ahead and try it out now. To change it, click on the input and press the desired hotkey on the keyboard. + Hotkeys + Action Keyword and Commands + Search the web, launch applications or run various functions through Flow Launcher plugins. Certain functions start with an action keyword, and if necessary, they can be used without action keywords. Try the queries below in Flow Launcher. + Let's Start Flow Launcher + Finished. Enjoy Flow Launcher. Don't forget the hotkey to start :) + + + + Back / Context Menu + Item Navigation + Open Context Menu + Open Contaning Folder + Run as Admin + Query History + Back to Result in Context Menu + Autocomplete + Open / Run Selected Item + Open Setting Window + Reload Plugin Data + + Weather + Weather in Google Result + > ping 8.8.8.8 + Shell Command + Bluetooth + Bluetooth in Windows Settings + sn + Sticky Notes diff --git a/Flow.Launcher/Languages/fr.xaml b/Flow.Launcher/Languages/fr.xaml index a8f280bd1..d9c46e6b9 100644 --- a/Flow.Launcher/Languages/fr.xaml +++ b/Flow.Launcher/Languages/fr.xaml @@ -132,8 +132,8 @@ Mettre à jour Annuler Flow Launcher doit redémarrer pour installer cette mise à jour - Les fichiers suivants seront mis à jour + Les fichiers suivants seront mis à jour Fichiers mis à jour - Description de la mise à jour + Description de la mise à jour diff --git a/Flow.Launcher/Languages/it.xaml b/Flow.Launcher/Languages/it.xaml index e85e49933..0302a1531 100644 --- a/Flow.Launcher/Languages/it.xaml +++ b/Flow.Launcher/Languages/it.xaml @@ -135,8 +135,8 @@ Aggiorna Annulla Questo aggiornamento riavvierà Flow Launcher - I seguenti file saranno aggiornati + I seguenti file saranno aggiornati File aggiornati - Descrizione aggiornamento + Descrizione aggiornamento \ No newline at end of file diff --git a/Flow.Launcher/Languages/ja.xaml b/Flow.Launcher/Languages/ja.xaml index 937a1e504..3fc6296c1 100644 --- a/Flow.Launcher/Languages/ja.xaml +++ b/Flow.Launcher/Languages/ja.xaml @@ -138,8 +138,8 @@ アップデート キャンセル このアップデートでは、Flow Launcherの再起動が必要です - 次のファイルがアップデートされます + 次のファイルがアップデートされます 更新ファイル一覧 - アップデートの詳細 + アップデートの詳細 \ No newline at end of file diff --git a/Flow.Launcher/Languages/ko.xaml b/Flow.Launcher/Languages/ko.xaml index 6fd2eb937..7184bef34 100644 --- a/Flow.Launcher/Languages/ko.xaml +++ b/Flow.Launcher/Languages/ko.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib"> - 핫키 등록 실패: {0} + 단축키 등록 실패: {0} {0}을 실행할 수 없습니다. Flow Launcher 플러그인 파일 형식이 유효하지 않습니다. 이 쿼리의 최상위로 설정 @@ -15,8 +15,11 @@ 정보 종료 닫기 + 복사 + 잘라내기 + 붙여넣기 게임 모드 - 핫키 사용을 일시중단합니다. + 단축키 사용을 일시중단합니다. Flow Launcher 설정 @@ -34,10 +37,12 @@ 직전 쿼리 내용 선택 직전 쿼리 지우기 표시할 결과 수 - 전체화면 모드에서는 핫키 무시 + 전체화면 모드에서는 단축키 무시 게이머라면 켜는 것을 추천합니다. 기본 파일관리자 폴더를 열 때 사용할 파일관리자를 선택하세요. + 기본 웹 브라우저 + 새 탭, 새 창, 프라이빗 모드 설정 Python 디렉토리 자동 업데이트 선택 @@ -87,30 +92,30 @@ {0} 테마 로드에 실패했습니다. 기본 테마로 변경합니다. 테마 폴더 테마 폴더 열기 - 앱 색상 - 시스템 기본 - 밝게 - 어둡게 + 앱 색상 + 시스템 기본 + 밝게 + 어둡게 소리 효과 검색창을 열 때 작은 소리를 재생합니다. 애니메이션 일부 UI에 애니메이션을 사용합니다. - 핫키 - Flow Launcher 핫키 + 단축키 + Flow Launcher 단축키 Flow Launcher를 열 때 사용할 단축키를 입력합니다. 결과 선택 단축키 결과 목록을 선택하는 단축키입니다. 단축키 표시 결과창에서 결과 선택 단축키를 표시합니다. - 사용자지정 쿼리 핫키 + 사용자지정 쿼리 단축키 쿼리 삭제 편집 추가 항목을 선택하세요. - {0} 플러그인 핫키를 삭제하시겠습니까? + {0} 플러그인 단축키를 삭제하시겠습니까? 그림자 효과 그림자 효과는 GPU를 사용합니다. 컴퓨터 퍼포먼스가 제한적인 경우 사용을 추천하지 않습니다. 창 넓이 @@ -152,6 +157,7 @@ 개발자도구 설정 폴더 로그 폴더 + 마법사 파일관리자 선택 @@ -163,6 +169,16 @@ 폴더경로 인수 파일경로 인수 + + 기본 웹 브라우저r + 기본 설정은 OS의 브라우저 설정을 따릅니다. 별도 설정시 Flow Launcher가 해당 브라우저를 사용합니다. + 브라우저 + 브라우저 이름 + 브라우저 경로 + 새 창 + 새 탭 + 프라이빗 모드 + 중요도 변경 높은 수를 넣을수록 상위 결과에 표시됩니다. 5를 시도해보세요. 다른 플러그인 보다 결과를 낮춰 표시하고 싶다면, 그보다 낮은 수를 입력하세요. @@ -180,15 +196,15 @@ 플러그인을 시작하는데 필요한 액션 키워드를 입력하세요. 액션 키워드를 지정하지 않으려면 *를 사용하세요. 이 경우 키워드를 입력하지 않아도 동작합니다. - 커스텀 플러그인 핫키 + 커스텀 플러그인 단축키 단축키를 지정하여 특정 쿼리를 자동으로 입력할 수 있습니다. 사용하고 싶은 단축키를 눌러 지정한 후, 사용할 쿼리를 입력하세요. 미리보기 - 핫키를 사용할 수 없습니다. 다른 핫키를 입력하세요. - 플러그인 핫키가 유효하지 않습니다. + 단축키를 사용할 수 없습니다. 다른 단축키를 입력하세요. + 플러그인 단축키가 유효하지 않습니다. 업데이트 - 핫키를 사용할 수 없습니다. + 단축키를 사용할 수 없습니다. 버전 @@ -225,8 +241,45 @@ 업데이트 실패 Check your connection and try updating proxy settings to github-cloud.s3.amazonaws.com. 업데이트를 위해 Flow Launcher를 재시작합니다. - 아래 파일들이 업데이트됩니다. + 아래 파일들이 업데이트됩니다. 업데이트 파일 - 업데이트 설명 + 업데이트 설명 + + + + 건너뛰기 + Flow Launcher에 오신 것을 환영합니다 + 안녕하세요, Flow Launcher를 처음 실행하시네요! + 시작하기전에 이 마법사가 간단한 설정을 도와드릴겁니다. 물론 건너 뛰셔도 됩니다. 사용하시는 언어를 선택해주세요. + PC에서 모든 파일과 프로그램을 검색하고 실행합니다 + 프로그램, 파일, 즐겨찾기, YouTube, Twitter 등 모든 것을 검색하세요. 마우스에 손대지 않고 키보드만으로 모든 것을 얻을 수 있습니다. + Flow는 아래의 단축키로 실행합니다. 변경하려면 입력창을 선택하고 키보드에서 원하는 단축키를 누릅니다. + 단축키 + 액션 키워드와 명령어 + Flow Launcher는 플러그인을 통해 웹 검색, 프로그램 실행, 다양한 기능을 실행합니다. 특정 기능은 액션 키워드로 시작하며, 필요한 경우 액션 키워드 없이 사용할 수 있습니다. Flow Launcher에서 아래 쿼리를 사용해 보세요. + Flow Launcher를 시작합시다 + 끝났습니다. Flow Launcher를 즐겨주세요. 시작하는 단축키를 잊지마세요 :) + + + + 뒤로/ 콘텍스트 메뉴 + 아이템 이동 + 콘텍스트 메뉴 열기 + 포함된 폴더 열기 + 관리자 권한으로 실행 + 검색 기록 + 콘텍스트 메뉴에서 뒤로 가기 + 선택한 아이템 열기 + 설정창 열기 + 플러그인 데이터 새로고침 + + 날씨 + 구글 날씨 검색 + > ping 8.8.8.8 + 쉘 명령어 + 블루투스 + 윈도우 블루투스 설정 + 스메 + 스티커 메모 \ No newline at end of file diff --git a/Flow.Launcher/Languages/nb-NO.xaml b/Flow.Launcher/Languages/nb-NO.xaml index 19f6cc36b..859ec20a0 100644 --- a/Flow.Launcher/Languages/nb-NO.xaml +++ b/Flow.Launcher/Languages/nb-NO.xaml @@ -135,8 +135,8 @@ Oppdater Avbryt Denne opgraderingen vil starte Flow Launcher på nytt - Følgende filer vil bli oppdatert + Følgende filer vil bli oppdatert Oppdateringsfiler - Oppdateringsbeskrivelse + Oppdateringsbeskrivelse diff --git a/Flow.Launcher/Languages/nl.xaml b/Flow.Launcher/Languages/nl.xaml index ca7fed180..822af21bf 100644 --- a/Flow.Launcher/Languages/nl.xaml +++ b/Flow.Launcher/Languages/nl.xaml @@ -126,8 +126,8 @@ Update Annuleer Deze upgrade zal Flow Launcher opnieuw opstarten - Volgende bestanden zullen worden geüpdatet + Volgende bestanden zullen worden geüpdatet Update bestanden - Update beschrijving + Update beschrijving diff --git a/Flow.Launcher/Languages/pl.xaml b/Flow.Launcher/Languages/pl.xaml index 4f3042be3..a8c423de1 100644 --- a/Flow.Launcher/Languages/pl.xaml +++ b/Flow.Launcher/Languages/pl.xaml @@ -126,8 +126,8 @@ Aktualizuj Anuluj Aby dokończyć proces aktualizacji Flow Launcher musi zostać zresetowany - Następujące pliki zostaną zaktualizowane + Następujące pliki zostaną zaktualizowane Aktualizuj pliki - Opis aktualizacji + Opis aktualizacji \ No newline at end of file diff --git a/Flow.Launcher/Languages/pt-br.xaml b/Flow.Launcher/Languages/pt-br.xaml index dce921ff7..a4dfe446c 100644 --- a/Flow.Launcher/Languages/pt-br.xaml +++ b/Flow.Launcher/Languages/pt-br.xaml @@ -135,8 +135,8 @@ Atualizar Cancelar Essa atualização reiniciará o Flow Launcher - Os seguintes arquivos serão atualizados + Os seguintes arquivos serão atualizados Atualizar arquivos - Atualizar descrição + Atualizar descrição \ No newline at end of file diff --git a/Flow.Launcher/Languages/pt-pt.xaml b/Flow.Launcher/Languages/pt-pt.xaml new file mode 100644 index 000000000..764ba542b --- /dev/null +++ b/Flow.Launcher/Languages/pt-pt.xaml @@ -0,0 +1,290 @@ + + + + Falha ao registar tecla de atalho: {0} + Não foi possível iniciar {0} + Formato do ficheiro inválido como plugin + Definir como principal para esta consulta + Cancelar como principal para esta consulta + Executar consulta: {0} + Última execução: {0} + Abrir + Definições + Acerca + Sair + Fechar + Copiar + Cortar + Colar + Modo de jogo + Suspender utilização de teclas de atalho + + + Definições Flow Launcher + Geral + Modo portátil + Guardar todas as definições e dados do utilizador numa pasta (indicado se utilizar discos amovíveis ou serviços cloud) + Iniciar Flow Launcher ao arrancar o sistema + Ocultar Flow Launcher ao perder o foco + Não notificar acerca de novas versões + Memorizar localização anterior + Idioma + Estilo da última consulta + Mostrar/ocultar resultados anteriores ao reiniciar Flow Launcher + Manter última consulta + Selecionar última consulta + Limpar última consulta + Número máximo de resultados + Ignorar teclas de atalho se em ecrã completo + Desativar ativação do Flow Launcher se alguma aplicação estiver em ecrã completo (recomendado para jogos) + Gestor de ficheiros padrão + Selecione o gestor de ficheiros utilizado para abrir a página + Navegador web padrão + Definições para Novo separador, Nova Janela e Modo privado + Diretório Python + Atualização automática + Selecionar + Ocultar Flow Launcher ao arrancar + Ocultar ícone na bandeja + Precisão da pesquisa + Altera a precisão mínima necessário para obter resultados + Utilizar Pinyin + Permitir Pinyin para a pesquisa. Pinyin é o sistema padrão da ortografia romanizada para tradução de mandarim + O efeito sombra não é permitido com este tema porque o efeito desfocar está ativo + + + Plugins + Mais plugins + Ativar + Desativar + Definição de palavra-chave + Palavra-chave da ação + Palavra-chave atual + Nova palavra-chave + Alterar palavras-chave + Prioridade atual + Nova prioridade + Prioridade + Diretório de plugins + de + Tempo de arranque: + Tempo de consulta: + | Versão + Site + + + + Loja de plugins + Recarregar + Instalar + + + Tema + Galeria de temas + Como criar um tema + Olá + Tipo de letra da caixa de pesquisa + Tipo de letra dos resultados + Modo da janela + Opacidade + O tema {0} não existe e será utilizado o tema padrão + Não foi possível carregar o tema {0}, será utilizado o tema padrão + Pasta de temas + Abrir pasta de temas + Esquema de cores + Padrão do sistema + Claro + Escuro + Efeitos sonoros + Reproduzir um som ao abrir a janela de pesquisa + Animação + Utilizar animações na aplicação + + + Tecla de atalho + Tecla de atalho Flow Launcher + Introduza o atalho para mostrar/ocultar Flow Launcher + Tecla modificadora para os resultados + Selecione a tecla modificadora para abrir o resultado através do teclado + Mostrar tecla de atalho + Mostrar tecla de atalho em conjunto com os resultados. + Tecla de atalho personalizada + Consulta + Eliminar + Editar + Adicionar + Selecione um item + Tem a certeza de que deseja remover a tecla de atalho do plugin {0}? + Efeito de sombra da janela + Este efeito intensifica a utilização da GPU. Não deve ativar esta opção se o desempenho do seu computador for fraco. + Largura da janela + Utilizar ícones Segoe Fluent + Se possível, utilizar ícones Segoe Fluent para os resultados + + + Proxy HTTP + Ativar proxy HTTP + Servidor HTTP + Porta + Nome de utilizador + Palavra-passe + Testar + Guardar + Campo Servidor não pode estar vazio + Campo Porta não pode estar vazio + Formato de porta inválido + Configuração proxy guardada com sucesso + Proxy configurado corretamente + Falha na ligação ao proxy + + + Acerca + Site + GitHub + Documentos + Versão + Ativou o Flow Launcher {0} vezes + Procurar atualizações + Está disponível a versão {0}. Gostaria de reiniciar Flow Launcher para atualizar a sua versão? + Erro ao procurar atualizações. Verifique a sua ligação e as definições do proxy estabelecidas para api.github.com + + Não foi possível descarregar a atualização. Verifique a sua ligação e as definições do proxy estabelecidas para github-cloud.s3.amazonaws.com ou aceda a https://github.com/Flow-Launcher/Flow.Launcher/releases para descarregar a atualização. + + Notas da versão + Dicas de utilização + DevTools + Pasta de definições + Pasta de registos + Assistente + + + Selecione o gestor de ficheiros + Especifique a localização do executável do gestor de ficheiros e, eventualmente, alguns argumentos. Os argumentos padrão são "%d" e o caminho é introduzido nesse local. Por exemplo, se necessitar de um comando como "totalcmd.exe /A c:\windows", o argumento é /A "%d". + "%f" é o argumento que representa o caminho do ficheiro. É utilizado para dar ênfase ao nome do ficheiro ou da pasta se utilizar um gestor de ficheiros não nativo. Este argumento apenas está disponível para o item "Arg para ficheiro". Se o seu gestor de ficheiros não possuir esta funcionalidade, pode utilizar "%d". + Gestor de ficheiros + Nome do perfil + Caminho do gestor de ficheiros + Argumento para pasta + Argumento para ficheiro + + + Navegador web padrão + A definição padrão é a que for definida pelo sistema operativo. Se especificado outro, Flow Launcher utiliza esse navegador. + Navegador + Nome do navegador + Caminho do navegador + Nova janela + Novo separador + Modo privado + + + Alterar prioridade + Quanto maior for o número, melhor avaliação terá o resultado. Experimente com o número 5. Se quiser que os resultados sejam inferiores aos dos outros plugins, indique um número negativo. + Tem que indicar um valor inteiro para a prioridade! + + + Palavra-chave atual + Nova palavra-chave + Cancelar + Feito + Plugin não encontrado + A nova palavra-chave não pode estar vazia + Esta palavra-chave já está associada a um plugin. Por favor escolha outra. + Sucesso + Terminado com sucesso + Introduza a palavra-chave a utilizar para iniciar o plugin. Utilize * se não quiser utilizar esta funcionalidade e o plugin não será ativado com palavras-chave. + + + Tecla de atalho personalizada + Prima a tecla de atalho personalizada para introduzir automaticamente a consulta especificada + Antevisão + Tecla de atalho indisponível, por favor escolha outra + Tecla de atalho inválida + Atualizar + + + Tecla de atalho indisponível + + + Versão + Hora + Indique-nos, por favor, como é que o erro ocorreu para que o possamos corrigir + Enviar relatório + Cancelar + Geral + Exceções + Tipo de exceção + Origem + Stack Trace + A enviar + Relatório enviado com sucesso + Falha ao enviar o relatório + Ocorreu um erro + + + Por favor aguarde... + + + A procurar atualizações... + A sua versão de Flow Launcher é a mais recente + Atualização encontrada + A atualizar... + + Flow Launcher não conseguiu mover o seu perfil de dados para a nova versão. + Queira por favor mover a pasta do seu perfil de {0} para {1} + + Nova atualização + Está disponível a versão {0} do Flow Launcher + Ocorreu um erro ao tentar instalar as atualizações + Atualizar + Cancelar + Falha ao atualizar + Verifique a sua ligação e as definições do proxy estabelecidas para github-cloud.s3.amazonaws.com + Esta atualização irá reiniciar o Flow Launcher + Os seguintes ficheiros serão atualizados + Atualizar ficheiros + Atualizar descrição + + + Ignorar + Obrigado por utilizar Flow Launcher + Esta é a primeira vez que está a utilizar Flow Launcher! + Antes de utilizar a aplicação, este assistente ajuda a configurar Flow Launcher. Caso pretenda, pode ignorar este passo. Por favor escolha um idioma. + Pesquise ficheiros/pastas e execute aplicações no seu computador + + Pode pesquisar aplicações, ficheiros, marcadores, YouTube, Twitter e muito mais. Tudo isto é efetuado através do teclado, dispensando a utilização do rato + + Flow Launcher é iniciado com a tecla de atalho abaixo. Experimente. Para alterar esta tecla de atalho, clique no valor e escolha a combinação de teclas a utilizar. + Teclas de atalho + Palavras-chave e comandos + Pesquise na Web, inicie aplicações e execute funções através dos nossos plugins. Algumas ações são invocadas com palavras-chave mas, se quiser, podem ser invocadas sem essas palavras-chave. Teste as consultas abaixo para experimentar. + Vamos iniciar Flow Launcher + Terminado. Desfrute de Flow Launcher. Não se esqueça da tecla de atalho :-) + + + + Recuar/Menu de contexto + Navegação nos itens + Abrir menu de contexto + Abrir pasta + Executar como administrador + Histórico de consultas + Voltar aos resultados no menu de contexto + Conclusão automática + Abrir/Executar item selecionado + Abrir janela de definições + Recarregar dados do plugin + + Meteorologia + Meteorologia no Google + > ping 8.8.8.8 + Comando de consola + Bluetooth + Bluetooth nas definições do Windows + sn + Sticky Notes + + diff --git a/Flow.Launcher/Languages/ru.xaml b/Flow.Launcher/Languages/ru.xaml index d0d6ff0e5..63c8d46ee 100644 --- a/Flow.Launcher/Languages/ru.xaml +++ b/Flow.Launcher/Languages/ru.xaml @@ -126,8 +126,8 @@ Обновить Отмена Это обновление перезапустит Flow Launcher - Следующие файлы будут обновлены + Следующие файлы будут обновлены Обновить файлы - Описание обновления + Описание обновления \ No newline at end of file diff --git a/Flow.Launcher/Languages/sk.xaml b/Flow.Launcher/Languages/sk.xaml index 8c0a96f98..dac746d0f 100644 --- a/Flow.Launcher/Languages/sk.xaml +++ b/Flow.Launcher/Languages/sk.xaml @@ -1,217 +1,286 @@ - - - Nepodarilo sa registrovať klávesovú skratku {0} - Nepodarilo sa spustiť {0} - Neplatný formát súboru pre plugin Flow Launchera - Pri tomto zadaní umiestniť navrchu - Zrušiť umiestnenie navrchu pri tomto zadaní - Spustiť dopyt: {0} - Posledný čas realizácie: {0} - Otvoriť - Nastavenia - O aplikácii - Ukončiť - Zavrieť - - - Nastavenia Flow Launchera - Všeobecné - Prenosný režim - Uloží všetky nastavenia a používateľské údaje do jedného priečinka (Užitočné pri vyberateľných diskoch a cloudových službách). - Spustiť Flow Launcher po štarte systému - Schovať Flow Launcher po strate fokusu - Nezobrazovať upozornenia na novú verziu - Zapamätať si posledné umiestnenie - Jazyk - Posledné vyhľadávanie - Zobrazí/skryje predchádzajúce výsledky pri opätovnej aktivácii Flow Launchera. - Ponechať - Označiť - Vymazať - Max. výsledkov - Ignorovať klávesové skratky v režime na celú obrazovku - Zakázať aktiváciu Flow Launchera, keď je aktívna aplikácia na celú obrazovku (odporúčané pre hry). - Predvolený správca súborov - Vyberte správcu súborov, ktorý sa má použiť pri otváraní priečinka. - Priečinok s Pythonom - Automatická aktualizácia - Vybrať - Schovať Flow Launcher po spustení - Schovať ikonu z oblasti oznámení - Presnosť vyhľadávania - Mení minimálne skóre zhody potrebné na zobrazenie výsledkov. - Použiť Pinyin - Umožňuje vyhľadávanie pomocou Pinyin. Pinyin je štandardný systém romanizovaného pravopisu pre transliteráciu čínštiny - Efekt tieňa nie je povolený, kým má aktuálny motív povolený efekt rozostrenia - - - Pluginy - Nájsť ďalšie pluginy - Zap. - Vyp. - Nastavenie kľúčového slova akcie - Skratka akcie - Aktuálna akcia skratky: - Nová akcia skratky: - Aktuálna priorita: - Nová priorita: - Priorita - Priečinok s pluginmi - Autor: - Príprava: - Čas dopytu: - - - - Repozitár pluginov - Obnoviť - Inštalovať - - - Motív - Galéria motívov - Ako vytvoriť motív - Ahojte - Písmo vyhľadávacieho poľa - Písmo výsledkov - Režim okno - Nepriehľadnosť - Motív {0} neexistuje, návrat na predvolený motív - Nepodarilo sa nečítať motív {0}, návrat na predvolený motív - Priečinok s motívmi - Otvoriť priečinok s motívmi - - - Klávesové skratky - Klávesová skratka pre Flow Launcher - Zadajte skratku na zobrazenie/skrytie Flow Launchera. - Modifikačný kláves na otvorenie výsledkov - Vyberte modifikačný kláves na otvorenie vybraného výsledku pomocou klávesnice. - Zobraziť klávesovú skratku - Zobrazí klávesovú skratku spolu s výsledkami. - Vlastná klávesová skratka na vyhľadávanie - Dopyt - Odstrániť - Upraviť - Pridať - Vyberte položku, prosím - Ste si istý, že chcete odstrániť klávesovú skratku {0} pre plugin? - Tieňový efekt v poli vyhľadávania - Tieňový efekt významne využíva GPU. Neodporúča sa, ak je výkon počítača obmedzený. - Veľkosť šírky okna - Použiť ikony Segoe Fluent - Použiť ikony Segoe Fluent, ak sú podporované - - - HTTP Proxy - Povoliť HTTP Proxy - HTTP Server - Port - Používateľské meno - Heslo - Test Proxy - Uložiť - Pole Server nemôže byť prázdne - Pole Port nemôže byť prázdne - Neplatný formát portu - Nastavenie proxy úspešne uložené - Nastavenie proxy je v poriadku - Pripojenie proxy zlyhalo - - - O aplikácii - Webstránka - Verzia - Flow Launcher bol aktivovaný {0}-krát - Skontrolovať aktualizácie - Je dostupná nová verzia {0}, chcete reštartovať Flow Launcher, aby sa mohol aktualizovať? - Kontrola aktualizácií zlyhala, prosím, skontrolujte pripojenie na internet a nastavenie proxy k api.github.com. - - Sťahovanie aktualizácií zlyhalo, skontrolujte pripojenie na internet a nastavenie proxy k github-cloud.s3.amazonaws.com, - alebo prejdite na https://github.com/Flow-Launcher/Flow.Launcher/releases pre manuálne stiahnutie aktualizácie. - - Poznámky k vydaniu - Tipy na používanie: - - - Vyberte správcu súborov - Zadajte umiestnenie súboru správcu súborov, ktorého používate, a v prípade potreby pridajte argumenty. Predvolené argumenty sú "%d" a cesta sa zadáva na tomto mieste. Napríklad, ak sa vyžaduje príkaz, ako napríklad "totalcmd.exe /A c:\windows", argument je /A "%d". - "%f" je argument, ktorý predstavuje cestu k súboru. Používa sa na zvýraznenie názvu súboru/priečinka pri otváraní konkrétneho umiestnenia súboru v správcovi súborov tretej strany. Tento argument je k dispozícii len v položke "Arg pre súbor". Ak správca súborov nemá túto funkciu, môžete použiť "%d". - Správca súborov - Názov profilu - Cesta k správcovi súborov - Arg. pre priečinok - Arg. pre súbor - - - Zmena priority - Vyššie číslo znamená, že výsledok bude vyššie. Skúste nastaviť napr. 5. Ak chcete, aby boli výsledky nižšie ako ktorékoľvek iné doplnky, zadajte záporné číslo - Prosím, zadajte platné číslo pre prioritu! - - - Stará skratka akcie - Nová skratka akcie - Zrušiť - Hotovo - Nepodarilo sa nájsť zadaný plugin - Nová skratka pre akciu nemôže byť prázdna - Nová skratka pre akciu bola priradená pre iný plugin, prosím, zvoľte inú skratku - Úspešné - Úspešne dokončené - Zadajte skratku akcie, ktorá je potrebná na spustenie pluginu. Ak nechcete zadať skratku akcie, použite *. V tom prípade plugin funguje bez kľúčových slov. - - - Klávesová skratka pre vlastné vyhľadávanie - Stlačením klávesovej skratky sa automaticky vloží zadaný výraz. - Náhľad - Klávesová skratka je nedostupná, prosím, zadajte novú - Neplatná klávesová skratka pluginu - Aktualizovať - - - Klávesová skratka nedostupná - - - Verzia - Čas - Prosím, napíšte nám, ako došlo k pádu aplikácie, aby sme to mohli opraviť - Odoslať hlásenie - Zrušiť - Všeobecné - Výnimky - Typ výnimky - Zdroj - Stack Trace - Odosiela sa - Hlásenie bolo úspešne odoslané - Odoslanie hlásenia zlyhalo - Flow Launcher zaznamenal chybu - - - Čakajte, prosím… - - - Kontrolujú sa aktualizácie - Už máte najnovšiu verziu Flow Launchera - Bola nájdená aktualizácia - Aktualizuje sa… - - Flow Launcher nedokázal presunúť používateľské údaje do aktualizovanej verzie. - Prosím, presuňte profilový priečinok data z {0} do {1} - - Nová aktualizácia - Je dostupná nová verzia Flow Launchera {0} - Počas inštalácie aktualizácií došlo k chybe - Aktualizovať - Zrušiť - Aktualizácia zlyhala - Skontrolujte pripojenie a skúste aktualizovať nastavenia servera proxy na github-cloud.s3.amazonaws.com. - Tento upgrade reštartuje Flow Launcher - Nasledujúce súbory budú aktualizované - Aktualizovať súbory - Aktualizovať popis - - + + + + Nepodarilo sa registrovať klávesovú skratku {0} + Nepodarilo sa spustiť {0} + Neplatný formát súboru pre plugin Flow Launchera + Pri tomto výraze umiestniť navrchu + Zrušiť umiestnenie navrchu pri tomto výraze + Spustiť dopyt: {0} + Posledný čas spustenia: {0} + Otvoriť + Nastavenia + O aplikácii + Ukončiť + Zavrieť + Kopírovať + Vystrihnúť + Prilepiť + Herný režim + Pozastaviť používanie klávesových skratiek. + + + Nastavenia Flow Launchera + Všeobecné + Prenosný režim + Uloží všetky nastavenia a používateľské údaje do jedného priečinka (Užitočné pri vymeniteľných diskoch a cloudových službách). + Spustiť Flow Launcher pri spustení systému + Schovať Flow Launcher po strate fokusu + Nezobrazovať upozornenia na novú verziu + Zapamätať si posledné umiestnenie + Jazyk + Posledné vyhľadávanie + Zobrazí/skryje predchádzajúce výsledky pri opätovnej aktivácii Flow Launchera. + Ponechať + Označiť + Vymazať + Maximum výsledkov + Ignorovať klávesové skratky v režime na celú obrazovku + Zakázať aktiváciu Flow Launchera, keď je aktívna aplikácia na celú obrazovku (odporúčané pre hry). + Predvolený správca súborov + Vyberte správcu súborov, ktorý sa má použiť pri otváraní priečinka. + Predvolený webový prehliadač + Nastavenie pre novú kartu, nové okno, privátny režim. + Priečinok s Pythonom + Automatická aktualizácia + Vybrať + Schovať Flow Launcher po spustení + Schovať ikonu z oblasti oznámení + Presnosť vyhľadávania + Mení minimálne skóre zhody potrebné na zobrazenie výsledkov. + Použiť Pinyin + Umožňuje vyhľadávanie pomocou Pinyin. Pinyin je štandardný systém romanizovaného pravopisu pre transliteráciu čínštiny + Efekt tieňa nie je povolený, kým má aktuálny motív povolený efekt rozostrenia + + + Pluginy + Nájsť ďalšie pluginy + Zap. + Vyp. + Nastavenie akčného príkazu + Aktivačný príkaz + Aktuálny aktivačný príkaz + Nový aktivačný príkaz + Upraviť aktivačný príkaz + Aktuálna priorita + Nová priorita + Priorita + Priečinok s pluginmi + od + Inicializácia: + Trvanie dopytu: + | Verzia + Webstránka + + + + Repozitár pluginov + Obnoviť + Inštalovať + + + Motív + Galéria motívov + Ako vytvoriť motív + Ahojte + Písmo vyhľadávacieho poľa + Písmo výsledkov + Režim okno + Nepriehľadnosť + Motív {0} neexistuje, použije sa predvolený motív + Nepodarilo sa nečítať motív {0}, použije sa predvolený motív + Priečinok s motívmi + Otvoriť priečinok s motívmi + Farebná schéma + Predvolené systémom + Svetlý + Tmavý + Zvukový efekt + Po otvorení okna vyhľadávania prehrať krátky zvuk + Animácia + Animovať používateľské rozhranie + + + Klávesové skratky + Klávesová skratka pre Flow Launcher + Zadajte skratku na zobrazenie/skrytie Flow Launchera. + Modifikačný kláves na otvorenie výsledkov + Vyberte modifikačný kláves na otvorenie vybraného výsledku pomocou klávesnice. + Zobraziť klávesovú skratku + Zobrazí klávesovú skratku spolu s výsledkami. + Klávesová skratka vlastného vyhľadávania + Dopyt + Odstrániť + Upraviť + Pridať + Vyberte položku, prosím + Ste si istý, že chcete odstrániť klávesovú skratku {0} pre plugin? + Tieňový efekt v poli vyhľadávania + Tieňový efekt významne využíva GPU. Neodporúča sa, ak je výkon počítača obmedzený. + Šírka okna + Použiť ikony Segoe Fluent + Použiť ikony Segoe Fluent, ak sú podporované + + + HTTP proxy + Povoliť HTTP Proxy + HTTP server + Port + Používateľské meno + Heslo + Test proxy + Uložiť + Pole Server nemôže byť prázdne + Pole Port nemôže byť prázdne + Neplatný formát portu + Nastavenie proxy úspešne uložené + Nastavenie proxy je v poriadku + Pripojenie proxy servera zlyhalo + + + O aplikácii + Webstránka + Github + Dokumentácia + Verzia + Flow Launcher bol aktivovaný {0}-krát + Vyhľadať aktualizácie + Je dostupná nová verzia {0}, chcete reštartovať Flow Launcher, aby sa mohol aktualizovať? + Vyhľadávanie aktualizácií zlyhalo, prosím, skontrolujte pripojenie na internet a nastavenie proxy server k api.github.com. + + Sťahovanie aktualizácií zlyhalo, skontrolujte pripojenie na internet a nastavenie proxy servera k github-cloud.s3.amazonaws.com, + alebo prejdite na https://github.com/Flow-Launcher/Flow.Launcher/releases pre manuálne stiahnutie aktualizácie. + + Poznámky k vydaniu + Tipy na používanie + Nástroje pre vývojárov + Priečinok s nastaveniami + Priečinok s logmi + Sprievodca + + + Vyberte správcu súborov + Zadajte umiestnenie súboru správcu súborov, ktorý používate, a v prípade potreby pridajte argumenty. Predvolené argumenty sú "%d" a cesta sa zadáva na tomto mieste. Napríklad, ak sa vyžaduje príkaz, ako napríklad "totalcmd.exe /A c:\windows", argument je /A "%d". + "%f" je argument, ktorý predstavuje cestu k súboru. Používa sa na zvýraznenie názvu súboru/priečinka pri otváraní konkrétneho umiestnenia súboru v správcovi súborov tretej strany. Tento argument je k dispozícii len v položke "Arg. pre súbor". Ak správca súborov nemá túto funkciu, môžete použiť "%d". + Správca súborov + Názov profilu + Cesta k správcovi súborov + Arg. pre priečinok + Arg. pre súbor + + + Predvolený webový prehliadač + Predvolené nastavenie je podľa nastavenia v systéme. Ak je zadaný osobitne, Flow použije tento prehliadač. + Prehliadač + Názov prehliadača + Cesta k prehliadaču + Nové okno + Nová karta + Privátny režim + + + Zmena priority + Väčšie číslo znamená, že výsledok bude vyššie. Skúste nastaviť napr. 5. Ak chcete, aby boli výsledky nižšie ako ktorékoľvek iné pluginy, zadajte záporné číslo + Prosím, zadajte platné číslo pre prioritu! + + + Starý aktivačný príkaz + Nový aktivačný príkaz + Zrušiť + Hotovo + Nepodarilo sa nájsť zadaný plugin + Nový aktivačný príkaz nemôže byť prázdny + Nový aktivačný príkaz už bol priradený inému pluginu, prosím, zvoľte iný aktivačný príkaz + Úspešné + Úspešne dokončené + Zadajte aktivačný príkaz, ktorý je potrebný na spustenie pluginu. Ak nechcete zadať aktivačný príkaz, použite * a plugin bude spustený bez aktivačného príkazu. + + + Klávesová skratka vlastného vyhľadávania + Stlačením klávesovej skratky sa automaticky vloží zadaný výraz. + Náhľad + Klávesová skratka je nedostupná, prosím, zadajte novú skratku + Neplatná klávesová skratka pluginu + Aktualizovať + + + Klávesová skratka je nedostupná + + + Verzia + Čas + Prosím, napíšte nám, ako došlo k pádu aplikácie, aby sme to mohli opraviť + Odoslať hlásenie + Zrušiť + Všeobecné + Výnimky + Typ výnimky + Zdroj + Trasovanie zásobníka + Odosiela sa + Hlásenie bolo úspešne odoslané + Odoslanie hlásenia zlyhalo + Flow Launcher zaznamenal chybu + + + Čakajte, prosím... + + + Vyhľadávajú sa aktualizácie + Už máte najnovšiu verziu Flow Launchera + Bola nájdená aktualizácia + Aktualizuje sa... + + Flow Launcher nedokázal presunúť používateľské údaje do aktualizovanej verzie. + Prosím, presuňte profilový priečinok data z {0} do {1} + + Nová aktualizácia + Je dostupná nová verzia Flow Launchera {0} + Počas inštalácie aktualizácií došlo k chybe + Aktualizovať + Zrušiť + Aktualizácia zlyhala + Skontrolujte pripojenie a skúste aktualizovať nastavenia servera proxy k github-cloud.s3.amazonaws.com. + Tento upgrade reštartuje Flow Launcher + Nasledujúce súbory budú aktualizované + Aktualizovať súbory + Aktualizovať popis + + + Preskočiť + Vitajte vo Flow Launcheri + Dobrý deň, toto je prvýkrát, čo spúšťate Flow Launcher! + Pred spustením vám tento sprievodca pomôže s nastavením aplikácie Flow Launcher. Ak chcete, môžete ho preskočiť. Vyberte si jazyk + Vyhľadávajte a spúšťajte všetky súbory a aplikácie v počítači + Vyhľadávajte vo všetkých aplikáciách, súboroch, záložkách, YouTube, Twitteri a ďalších. Všetko z pohodlia klávesnice bez toho, aby ste sa dotkli myši. + Flow Launcher sa spúšťa pomocou dole uvedenej klávesovej skratky, poďte si to vyskúšať. Ak ju chcete zmeniť, kliknite na vstupné pole a stlačte požadovanú klávesovú skratku na klávesnici. + Klávesové skratky + Aktivačné príkazy a príkazy + Vyhľadávajte na webe, spúšťajte aplikácie alebo spúšťajte rôzne funkcie pomocou pluginov Flow Launchera. Niektoré funkcie sa začínajú aktivačným príkazom a v prípade potreby ich možno použiť aj bez aktivačných príkazov. Vyskúšajte nižšie uvedené výrazy v aplikácii Flow Launcher. + Spustite Flow Launcher + Hotovo. Užite si Flow Launcher. Nezabudnite na klávesovú skratku na spustenie :) + + + + Späť/kontextová ponuka + Navigácia medzi položkami + Otvoriť kontextovú ponuku + Otvoriť umiestnenie priečinka + Spustiť ako správca + História dopytov + Návrat na výsledky z kontextovej ponuky + Automatické dokončovanie + Otvoriť/spustiť vybranú položku + Otvoriť okno s nastaveniami + Znova načítať údaje pluginov + + Počasie + Počasie na Googli + > ping 8.8.8.8 + Príkazový riadok + Bluetooth + Bluetooth v nastaveniach Windowsu + sn + Sticky Notes + + diff --git a/Flow.Launcher/Languages/sr.xaml b/Flow.Launcher/Languages/sr.xaml index 0394b398d..3efe27a47 100644 --- a/Flow.Launcher/Languages/sr.xaml +++ b/Flow.Launcher/Languages/sr.xaml @@ -135,8 +135,8 @@ Ažuriraj Otkaži Ova nadogradnja će ponovo pokrenuti Flow Launcher - Sledeće datoteke će biti ažurirane + Sledeće datoteke će biti ažurirane Ažuriraj datoteke - Opis ažuriranja + Opis ažuriranja \ No newline at end of file diff --git a/Flow.Launcher/Languages/tr.xaml b/Flow.Launcher/Languages/tr.xaml index 421375df9..a39b55b23 100644 --- a/Flow.Launcher/Languages/tr.xaml +++ b/Flow.Launcher/Languages/tr.xaml @@ -139,8 +139,8 @@ Güncelle İptal Bu güncelleme Flow Launcher'u yeniden başlatacaktır - Aşağıdaki dosyalar güncelleştirilecektir + Aşağıdaki dosyalar güncelleştirilecektir Güncellenecek dosyalar - Güncelleme açıklaması + Güncelleme açıklaması \ No newline at end of file diff --git a/Flow.Launcher/Languages/uk-UA.xaml b/Flow.Launcher/Languages/uk-UA.xaml index b57676f8d..790314d0f 100644 --- a/Flow.Launcher/Languages/uk-UA.xaml +++ b/Flow.Launcher/Languages/uk-UA.xaml @@ -126,8 +126,8 @@ Оновити Скасувати Це оновлення перезавантажить Flow Launcher - Ці файли будуть оновлені + Ці файли будуть оновлені Оновити файли - Опис оновлення + Опис оновлення \ No newline at end of file diff --git a/Flow.Launcher/Languages/zh-cn.xaml b/Flow.Launcher/Languages/zh-cn.xaml index 0c2307dc5..e404c4deb 100644 --- a/Flow.Launcher/Languages/zh-cn.xaml +++ b/Flow.Launcher/Languages/zh-cn.xaml @@ -1,176 +1,269 @@ - - - 注册热键:{0} 失败 - 启动命令 {0} 失败 - Flow Launcher插件格式错误 - 在当前查询中置顶 - 取消置顶 - 执行查询:{0} - 上次执行时间:{0} - 打开 - 设置 - 关于 - 退出 - - - Flow Launcher设置 - 通用 - 便携模式 - 开机自动启动 - 失去焦点时自动隐藏Flow Launcher - 不显示新版本提示 - 记住上次启动位置 - 语言 - 上次搜索关键字模式 - 保留上次搜索关键字 - 选择上次搜索关键字 - 清空上次搜索关键字 - 最大结果显示个数 - 全屏模式下忽略热键 - Python 路径 - 自动更新 - 选择 - 启动时不显示主窗口 - 隐藏任务栏图标 - 查询搜索精度 - 启动拼音搜索 - 允许使用拼音进行搜索。 - - - 插件 - 浏览更多插件 - 启用 - 禁用 - 触发关键字 - 当前操作关键字: - 新动作关键字: - 当前优先级: - 新优先级: - 插件目录 - 作者 - 加载耗时 - 查询耗时 - - - 主题 - 浏览更多主题 - 在这里输入 - 查询框字体 - 结果项字体 - 窗口模式 - 透明度 - 无法找到主题 {0} ,切换为默认主题 - 无法加载主题 {0} ,切换为默认主题 - - - 热键 - Flow Launcher激活热键 - 开放结果修饰符 - 显示热键 - 自定义查询热键 - 删除 - 编辑 - 增加 - 请选择一项 - 你确定要删除插件 {0} 的热键吗? - 查询窗口阴影效果 - 阴影效果将占用大量的GPU资源。 如果您的计算机性能有限,则不建议使用。 - - - HTTP 代理 - 启用 HTTP 代理 - HTTP 服务器 - 端口 - 用户名 - 密码 - 测试代理 - 保存 - 服务器不能为空 - 端口不能为空 - 非法的端口格式 - 保存代理设置成功 - 代理设置正确 - 代理连接失败 - - - 关于 - 网站 - 版本 - 你已经激活了Flow Launcher {0} 次 - 检查更新 - 发现新版本 {0} , 请重启 Flow Launcher。 - 下载更新失败,请检查您与 api.github.com 的连接状态或检查代理设置。 - - 下载更新失败,请检查您与 github-cloud.s3.amazonaws.com 的连接状态或检查代理设置, - 或访问 https://github.com/Flow-Launcher/Flow.Launcher/releases 手动下载更新。 - - 更新说明: - 使用技巧: - - - 数字越大,结果排名越高。如果你想要结果比任何其他插件的低,请使用负数 - 请提供有效的整数作为优先级设置值! - - - 旧触发关键字 - 新触发关键字 - 取消 - 确定 - 找不到指定的插件 - 新触发关键字不能为空 - 新触发关键字已经被指派给其他插件了,请换一个关键字 - 成功 - 成功完成 - 如果你不想设置触发关键字,可以使用*代替 - - - 自定义插件热键 - 预览 - 热键不可用,请选择一个新的热键 - 插件热键不合法 - 更新 - - - 热键不可用 - - - 版本 - 时间 - 请告诉我们如何重现此问题,以便我们进行修复 - 发送报告 - 取消 - 基本信息 - 异常信息 - 异常类型 - 异常源 - 堆栈信息 - 发送中 - 发送成功 - 发送失败 - Flow Launcher出错啦 - - - 请稍等... - - - 检查新的更新 - 您已经拥有最新的Flow Launcher版本 - 检查到更新 - 更新中... - Flow Launcher无法将您的用户配置文件数据移动到新的更新版本中。 - 请手动将您的用户配置文件数据文件夹从 {0} 到 {1} - 新的更新 - 发现Flow Launcher新版本 V{0} - 尝试安装软件更新时发生错误 - 更新 - 取消 - 更新错误 - 检查网络是否可以连接至github-cloud.s3.amazonaws.com. - 此次更新需要重启Flow Launcher - 下列文件会被更新 - 更新文件 - 更新日志 - - \ No newline at end of file + + + + 注册热键:{0} 失败 + 启动命令 {0} 失败 + 无效的 Flow Launcher 插件文件格式 + 在当前查询中置顶 + 取消置顶 + 执行查询:{0} + 上次执行时间:{0} + 打开 + 设置 + 关于 + 退出 + 关闭 + 游戏模式 + 暂停使用快捷键。 + + + Flow Launcher设置 + 通用 + 便携模式 + 将所有设置和用户数据存储在一个文件夹中 (可用于可移除驱动器或云服务)。 + 开机自启 + 失去焦点时自动隐藏Flow Launcher + 不显示新版本提示 + 记住上次启动位置 + 语言 + 再次激活时 + 重启Flow Launcher时显示/隐藏以前的结果。 + 保留上次搜索关键字 + 选择上次搜索关键字 + 清空上次搜索关键字 + 最大结果显示个数 + 全屏模式下忽略热键 + 当全屏应用程序激活时禁用快捷键。 + 默认文件管理器 + 选择打开文件夹时要使用的文件管理器。 + Python 路径 + 自动更新 + 选择 + 系统启动时不显示主窗口 + 隐藏任务栏图标 + 查询搜索精度 + 更改匹配成功所需的最低分数。 + 启动拼音搜索 + 允许使用拼音进行搜索 + 当前主题已启用模糊效果,不允许启用阴影效果 + + + 插件 + 浏览更多插件 + 启用 + 禁用 + 动作关键字设置 + 触发关键字 + 当前触发关键字 + 新触发关键字 + 当前优先级 + 新优先级 + 优先级 + 插件目录 + 出自 + 加载耗时: + 查询耗时: + | 版本 + 官方网站 + + + + 插件商店 + 刷新 + 安装 + + + 主题 + 浏览更多主题 + 如何创建一个主题 + 你好! + 查询框字体 + 结果项字体 + 窗口模式 + 透明度 + 无法找到主题 {0} ,切换为默认主题 + 无法加载主题 {0} ,切换为默认主题 + 主题目录 + 打开主题目录... + 颜色主题 + 跟随系统 + 浅色 + 深色 + 音效 + 启用激活音效 + 动画 + 启用动画 + + + 热键 + Flow Launcher激活热键 + 输入显示/隐藏Flow Launcher的快捷键。 + 开放结果修饰符 + 指定修饰符用于打开指定的选项。 + 显示热键 + 显示热键用于快速选择选项。 + 自定义查询热键 + 查询 + 删除 + 编辑 + 增加 + 请选择一项 + 你确定要删除插件 {0} 的热键吗? + 查询窗口阴影效果 + 阴影效果将占用大量的GPU资源。 如果您的计算机性能有限,则不建议使用。 + 窗口宽度 + 使用Segoe Fluent图标 + 在支持时在选项中显示 Segoe Fluent 图标 + + + HTTP 代理 + 启用 HTTP 代理 + HTTP 服务器 + 端口 + 用户名 + 密码 + 测试代理 + 保存 + 服务器不能为空 + 端口不能为空 + 非法的端口格式 + 保存代理设置成功 + 代理设置正确 + 代理连接失败 + + + 关于 + 网站 + Github + 文档 + 版本 + 你已经激活了Flow Launcher {0} 次 + 检查更新 + 发现新版本 {0} , 请重启 Flow Launcher + 下载更新失败,请检查您与 api.github.com 的连接状态或检查代理设置 + + 下载更新失败,请检查您与 github-cloud.s3.amazonaws.com 的连接状态或检查代理设置, + 或访问 https://github.com/Flow-Launcher/Flow.Launcher/releases 手动下载更新 + + 更新说明: + 使用技巧: + 开发工具 + 设置目录 + 日志目录 + 向导 + + + 默认文件管理器 + 请指定文件管理器的文件位置,并在必要时修改参数。 默认参数是%d",作为占位符代表文件路径。 例如命令 “totalcmd.exe /A c:\winds”,参数是 /A "%d”。 + %f是一个表示文件路径的参数。 它用于在第三方文件管理器中打开特定文件位置时强调文件/文件夹名称。 此参数仅在“选中文件参数”项目中可用。 如果文件管理器没有该功能,“%d” 仍然可用。 + 文件管理器 + 档案名称 + 文件管理器路径 + 文件夹路径参数 + 选中文件路径参数 + + + 更改优先级 + 数字越大,结果排名越高。如果你想要结果比任何其他插件的低,请使用负数 + 请提供有效的整数作为优先级设置值 + + + 旧触发关键字 + 新触发关键字 + 取消 + 确认 + 找不到指定的插件 + 新触发关键字不能为空 + 此触发关键字已经被指派给其他插件了,请换一个关键字 + 成功 + 成功完成 + 如果你不想设置触发关键字,可以使用*代替 + + + 自定义插件热键 + 按下自定义快捷键激活Flow Launcher并插入指定的查询前缀。 + 预览 + 热键不可用,请选择一个新的热键 + 插件热键不合法 + 更新 + + + 热键不可用 + + + 版本 + 时间 + 请告诉我们如何重现此问题,以便我们进行修复 + 发送报告 + 取消 + 基本信息 + 异常信息 + 异常类型 + 异常源 + 堆栈信息 + 发送中 + 发送成功 + 发送失败 + Flow Launcher出错啦 + + + 请稍等... + + + 检查新的更新 + 您已经拥有最新的Flow Launcher版本 + 检查到更新 + 更新中... + + Flow Launcher无法将您的用户配置文件数据移动到新的更新版本中。 + 请手动将您的用户配置文件数据文件夹从 {0} 到 {1} + + 新的更新 + 发现Flow Launcher新版本 V{0} + 尝试安装软件更新时发生错误 + 更新 + 取消 + 更新失败 + 检查网络是否可以连接至github-cloud.s3.amazonaws.com. + 此次更新需要重启Flow Launcher + 下列文件会被更新 + 更新文件 + 更新日志 + + + 跳过 + 欢迎使用Flow Launcher + 你好,这是你第一次运行Flow Launcher! + 在启动前,这个向导将有助于设置Flow Launcher。如果您愿意,您可以跳过。请选择一种语言 + 搜索并运行您PC上的文件和应用程序 + 搜索所有应用程序、 文件、 书签、 YouTube、 Twitter等。所有都只需要键盘而不需要触摸鼠标。 + Flow Launcher默认使用下面的快捷键激活。 要更改它,请点击输入并按键盘上所需的热键。 + 快捷键 + 动作关键词和命令 + 通过Flow Launcher 插件搜索网站、启动应用程序或运行各种功能。 某些函数起始于一个动作关键词,如有必要,它们可以在没有动作关键词的情况下使用。欢迎尝试一下的查询语句。 + 开始使用Flow Launcher + 完成了!享受Flow Launcher。不要忘记激活快捷键 :) + + + + 返回/上下文菜单 + 选项导航 + 打开菜单目录 + 打开所在目录 + 以管理员身份运行 + 查询历史 + 返回查询界面 + 打开/运行选中项目 + 打开设置窗口 + 重新加载插件数据 + + 天气 + 谷歌天气结果 + > ping 8.8.8.8 + 命令行命令 + Bluetooth + Windows 设置中的蓝牙 + sn + Sticky Notes + + diff --git a/Flow.Launcher/Languages/zh-tw.xaml b/Flow.Launcher/Languages/zh-tw.xaml index 294add207..cba62ead4 100644 --- a/Flow.Launcher/Languages/zh-tw.xaml +++ b/Flow.Launcher/Languages/zh-tw.xaml @@ -126,8 +126,8 @@ 更新 取消 此更新需要重新啟動 Flow Launcher - 下列檔案會被更新 + 下列檔案會被更新 更新檔案 - 更新日誌 + 更新日誌 diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index dd8979650..5d26433b5 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -41,10 +41,10 @@ - + - + + @@ -176,9 +177,9 @@ Visibility="Visible"> - - - + + + + + Style="{DynamicResource SearchIconStyle}" + Visibility="{Binding SearchIconVisibility}" /> diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 8afc07439..57b34bc00 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -17,6 +17,7 @@ using DragEventArgs = System.Windows.DragEventArgs; using KeyEventArgs = System.Windows.Input.KeyEventArgs; using NotifyIcon = System.Windows.Forms.NotifyIcon; using Flow.Launcher.Infrastructure; +using System.Windows.Media; namespace Flow.Launcher { @@ -30,6 +31,7 @@ namespace Flow.Launcher private NotifyIcon _notifyIcon; private ContextMenu contextMenu; private MainViewModel _viewModel; + private readonly MediaPlayer animationSound = new(); private bool _animating; #endregion @@ -41,6 +43,7 @@ namespace Flow.Launcher _settings = settings; InitializeComponent(); InitializePosition(); + animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); } public MainWindow() @@ -56,6 +59,7 @@ namespace Flow.Launcher _viewModel.Save(); e.Cancel = true; await PluginManager.DisposePluginsAsync(); + Notification.Uninstall(); Environment.Exit(0); } @@ -65,10 +69,11 @@ namespace Flow.Launcher private void OnLoaded(object sender, RoutedEventArgs _) { + CheckFirstLaunch(); HideStartup(); // show notify icon when flowlauncher is hidden InitializeNotifyIcon(); - InitializeDarkMode(); + InitializeColorScheme(); WindowsInteropHelper.DisableControlBox(this); InitProgressbarAnimation(); // since the default main window visibility is visible @@ -83,6 +88,12 @@ namespace Flow.Launcher { if (_viewModel.MainWindowVisibilityStatus) { + if (_settings.UseSound) + { + animationSound.Position = TimeSpan.Zero; + animationSound.Play(); + } + UpdatePosition(); Activate(); QueryTextBox.Focus(); @@ -98,6 +109,9 @@ namespace Flow.Launcher _progressBarStoryboard.Begin(ProgressBar, true); isProgressBarStoryboardPaused = false; } + + if(_settings.UseAnimation) + WindowAnimator(); } else if (!isProgressBarStoryboardPaused) { @@ -146,6 +160,9 @@ namespace Flow.Launcher case nameof(Settings.Language): UpdateNotifyIconText(); break; + case nameof(Settings.Hotkey): + UpdateNotifyIconText(); + break; } }; } @@ -167,7 +184,7 @@ namespace Flow.Launcher private void UpdateNotifyIconText() { var menu = contextMenu; - ((MenuItem)menu.Items[1]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen"); + ((MenuItem)menu.Items[1]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen") + " (" + _settings.Hotkey + ")"; ((MenuItem)menu.Items[2]).Header = InternationalizationManager.Instance.GetTranslation("GameMode"); ((MenuItem)menu.Items[3]).Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings"); ((MenuItem)menu.Items[4]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit"); @@ -190,7 +207,7 @@ namespace Flow.Launcher }; var open = new MenuItem { - Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen") + Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen") + " (" +_settings.Hotkey + ")" }; var gamemode = new MenuItem { @@ -232,6 +249,20 @@ namespace Flow.Launcher }; } + private void CheckFirstLaunch() + { + if (_settings.FirstLaunch) + { + _settings.FirstLaunch = false; + PluginManager.API.SaveAppAllSettings(); + OpenWelcomeWindow(); + } + } + private void OpenWelcomeWindow() + { + var WelcomeWindow = new WelcomeWindow(_settings); + WelcomeWindow.Show(); + } private void ToggleGameMode() { if (_viewModel.GameModeStatus) @@ -259,7 +290,6 @@ namespace Flow.Launcher _viewModel.ProgressBarVisibility = Visibility.Hidden; isProgressBarStoryboardPaused = true; } - public void WindowAnimator() { if (_animating) @@ -477,16 +507,16 @@ namespace Flow.Launcher private void MoveQueryTextToEnd() { - QueryTextBox.CaretIndex = QueryTextBox.Text.Length; + Dispatcher.Invoke(() => QueryTextBox.CaretIndex = QueryTextBox.Text.Length); } - public void InitializeDarkMode() + public void InitializeColorScheme() { - if (_settings.DarkMode == Constant.Light) + if (_settings.ColorScheme == Constant.Light) { ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Light; } - else if (_settings.DarkMode == Constant.Dark) + else if (_settings.ColorScheme == Constant.Dark) { ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark; } diff --git a/Flow.Launcher/Notification.cs b/Flow.Launcher/Notification.cs index d8f9fd45e..3f5565eeb 100644 --- a/Flow.Launcher/Notification.cs +++ b/Flow.Launcher/Notification.cs @@ -1,4 +1,5 @@ using Flow.Launcher.Infrastructure; +using Microsoft.Toolkit.Uwp.Notifications; using System; using System.IO; using Windows.Data.Xml.Dom; @@ -8,10 +9,17 @@ namespace Flow.Launcher { internal static class Notification { + internal static bool legacy = Environment.OSVersion.Version.Build < 19041; + [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "")] + internal static void Uninstall() + { + if (!legacy) + ToastNotificationManagerCompat.Uninstall(); + } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Interoperability", "CA1416:Validate platform compatibility", Justification = "")] public static void Show(string title, string subTitle, string iconPath) { - var legacy = Environment.OSVersion.Version.Build < 19041; // Handle notification for win7/8/early win10 if (legacy) { @@ -24,13 +32,11 @@ namespace Flow.Launcher ? Path.Combine(Constant.ProgramDirectory, "Images\\app.png") : iconPath; - var xml = $"\"meziantou\"/{title}" + - $"{subTitle}"; - var toastXml = new XmlDocument(); - toastXml.LoadXml(xml); - var toast = new ToastNotification(toastXml); - ToastNotificationManager.CreateToastNotifier("Flow Launcher").Show(toast); - + new ToastContentBuilder() + .AddText(title, hintMaxLines: 1) + .AddText(subTitle) + .AddAppLogoOverride(new Uri(Icon)) + .Show(); } private static void LegacyShow(string title, string subTitle, string iconPath) diff --git a/Flow.Launcher/PriorityChangeWindow.xaml b/Flow.Launcher/PriorityChangeWindow.xaml index 8fb27c470..d50bf82db 100644 --- a/Flow.Launcher/PriorityChangeWindow.xaml +++ b/Flow.Launcher/PriorityChangeWindow.xaml @@ -90,7 +90,6 @@ HorizontalAlignment="Left" VerticalAlignment="Center" CornerRadius="4" - Minimum="0" SmallChange="1" SpinButtonPlacementMode="Inline" /> diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 49788bfac..5b490bede 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -41,7 +41,7 @@ namespace Flow.Launcher _settingsVM = settingsVM; _mainVM = mainVM; _alphabet = alphabet; - GlobalHotkey.Instance.hookedKeyboardCallback += KListener_hookedKeyboardCallback; + GlobalHotkey.hookedKeyboardCallback = KListener_hookedKeyboardCallback; WebRequest.RegisterPrefix("data", new DataWebRequestFactory()); } @@ -115,6 +115,11 @@ namespace Flow.Launcher ShellCommand.Execute(startInfo); } + public void CopyToClipboard(string text) + { + Clipboard.SetDataObject(text); + } + public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible; public void StopLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Collapsed; @@ -191,7 +196,7 @@ namespace Flow.Launcher public void OpenDirectory(string DirectoryPath, string FileName = null) { - using Process explorer = new Process(); + using var explorer = new Process(); var explorerInfo = _settingsVM.Settings.CustomExplorer; explorer.StartInfo = new ProcessStartInfo { @@ -199,27 +204,54 @@ namespace Flow.Launcher Arguments = FileName is null ? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) : explorerInfo.FileArgument.Replace("%d", DirectoryPath).Replace("%f", - Path.IsPathRooted(FileName) ? FileName : Path.Combine(DirectoryPath, FileName)) + Path.IsPathRooted(FileName) ? FileName : Path.Combine(DirectoryPath, FileName)) }; explorer.Start(); } + public void OpenUrl(string url, bool? inPrivate = null) + { + var browserInfo = _settingsVM.Settings.CustomBrowser; + + var path = browserInfo.Path == "*" ? "" : browserInfo.Path; + + if (browserInfo.OpenInTab) + { + url.OpenInBrowserTab(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg); + } + else + { + url.OpenInBrowserWindow(path, inPrivate ?? browserInfo.EnablePrivate, browserInfo.PrivateArg); + } + + } + public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent; + private readonly List> _globalKeyboardHandlers = new(); + + public void RegisterGlobalKeyboardCallback(Func callback) => _globalKeyboardHandlers.Add(callback); + public void RemoveGlobalKeyboardCallback(Func callback) => _globalKeyboardHandlers.Remove(callback); + #endregion #region Private Methods private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, SpecialKeyState state) { + var continueHook = true; if (GlobalKeyboardEvent != null) { - return GlobalKeyboardEvent((int)keyevent, vkcode, state); + continueHook = GlobalKeyboardEvent((int)keyevent, vkcode, state); + } + foreach (var x in _globalKeyboardHandlers) + { + continueHook &= x((int)keyevent, vkcode, state); } - return true; + return continueHook; } #endregion } -} \ No newline at end of file +} diff --git a/Flow.Launcher/ReportWindow.xaml.cs b/Flow.Launcher/ReportWindow.xaml.cs index 7318fe4cd..6a9fd60e0 100644 --- a/Flow.Launcher/ReportWindow.xaml.cs +++ b/Flow.Launcher/ReportWindow.xaml.cs @@ -52,8 +52,8 @@ namespace Flow.Launcher var link = new Hyperlink { IsEnabled = true }; link.Inlines.Add(url); link.NavigateUri = new Uri(url); - link.RequestNavigate += (s, e) => SearchWeb.NewTabInBrowser(e.Uri.ToString()); - link.Click += (s, e) => SearchWeb.NewTabInBrowser(url); + link.RequestNavigate += (s, e) => SearchWeb.OpenInBrowserTab(e.Uri.ToString()); + link.Click += (s, e) => SearchWeb.OpenInBrowserTab(url); paragraph.Inlines.Add(textBeforeUrl); paragraph.Inlines.Add(link); diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index dd9dba391..b4d7e78a7 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -1469,6 +1469,7 @@ - + @@ -1486,7 +1487,7 @@ @@ -1520,6 +1519,7 @@ Grid.RowSpan="3" Grid.ColumnSpan="3" Margin="0,5" + HorizontalAlignment="Right" ui:FocusVisualHelper.IsTemplateFocusTarget="True" Background="{DynamicResource ToggleSwitchContainerBackground}" /> + + + + + + + + + + + + + + + + + + + + + + + + + Flow Launcher + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePage1.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage1.xaml.cs new file mode 100644 index 000000000..98fb47288 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage1.xaml.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Windows.Navigation; +using Flow.Launcher.Infrastructure.UserSettings; +using Flow.Launcher.Core.Resource; + +namespace Flow.Launcher.Resources.Pages +{ + public partial class WelcomePage1 + { + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if (e.ExtraData is Settings settings) + Settings = settings; + else + throw new ArgumentException("Unexpected Navigation Parameter for Settings"); + InitializeComponent(); + } + private Internationalization _translater => InternationalizationManager.Instance; + public List Languages => _translater.LoadAvailableLanguages(); + + public Settings Settings { get; set; } + + public string CustomLanguage + { + get + { + return Settings.Language; + } + set + { + InternationalizationManager.Instance.ChangeLanguage(value); + + if (InternationalizationManager.Instance.PromptShouldUsePinyin(value)) + Settings.ShouldUsePinyin = true; + } + } + + } +} \ No newline at end of file diff --git a/Flow.Launcher/Resources/Pages/WelcomePage2.xaml b/Flow.Launcher/Resources/Pages/WelcomePage2.xaml new file mode 100644 index 000000000..033f9fe66 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage2.xaml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePage2.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage2.xaml.cs new file mode 100644 index 000000000..a433611f6 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage2.xaml.cs @@ -0,0 +1,52 @@ +using Flow.Launcher.Helper; +using Flow.Launcher.Infrastructure.Hotkey; +using Flow.Launcher.Infrastructure.UserSettings; +using System; +using System.Windows; +using System.Windows.Media; +using System.Windows.Navigation; + +namespace Flow.Launcher.Resources.Pages +{ + public partial class WelcomePage2 + { + private Settings Settings { get; set; } + + private Brush tbMsgForegroundColorOriginal; + + private string tbMsgTextOriginal; + + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if (e.ExtraData is Settings settings) + Settings = settings; + else + throw new ArgumentException("Unexpected Parameter setting."); + + InitializeComponent(); + tbMsgTextOriginal = HotkeyControl.tbMsg.Text; + tbMsgForegroundColorOriginal = HotkeyControl.tbMsg.Foreground; + + HotkeyControl.SetHotkey(new Infrastructure.Hotkey.HotkeyModel(Settings.Hotkey), false); + } + private void HotkeyControl_OnGotFocus(object sender, RoutedEventArgs args) + { + HotKeyMapper.RemoveHotkey(Settings.Hotkey); + } + private void HotkeyControl_OnLostFocus(object sender, RoutedEventArgs args) + { + if (HotkeyControl.CurrentHotkeyAvailable) + { + HotKeyMapper.SetHotkey(HotkeyControl.CurrentHotkey, HotKeyMapper.OnToggleHotkey); + Settings.Hotkey = HotkeyControl.CurrentHotkey.ToString(); + } + else + { + HotKeyMapper.SetHotkey(new HotkeyModel(Settings.Hotkey), HotKeyMapper.OnToggleHotkey); + } + + HotkeyControl.tbMsg.Text = tbMsgTextOriginal; + HotkeyControl.tbMsg.Foreground = tbMsgForegroundColorOriginal; + } + } +} \ No newline at end of file diff --git a/Flow.Launcher/Resources/Pages/WelcomePage3.xaml b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml new file mode 100644 index 000000000..e7920d34e --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + + + + + + + + + + + + + , + + + + + + + + + + + + + + + Enter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs new file mode 100644 index 000000000..9051e7c27 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs @@ -0,0 +1,20 @@ +using System; +using System.Windows.Navigation; +using Flow.Launcher.Infrastructure.UserSettings; + +namespace Flow.Launcher.Resources.Pages +{ + public partial class WelcomePage3 + { + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if (e.ExtraData is Settings settings) + Settings = settings; + else if(Settings is null) + throw new ArgumentException("Unexpected Navigation Parameter for Settings"); + InitializeComponent(); + } + + public Settings Settings { get; set; } + } +} diff --git a/Flow.Launcher/Resources/Pages/WelcomePage4.xaml b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml new file mode 100644 index 000000000..13f003086 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs new file mode 100644 index 000000000..11bbcd6ed --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs @@ -0,0 +1,20 @@ +using Flow.Launcher.Infrastructure.UserSettings; +using System; +using System.Windows.Navigation; + +namespace Flow.Launcher.Resources.Pages +{ + public partial class WelcomePage4 + { + protected override void OnNavigatedTo(NavigationEventArgs e) + { + if (e.ExtraData is Settings settings) + Settings = settings; + else + throw new ArgumentException("Unexpected Navigation Parameter for Settings"); + InitializeComponent(); + } + + public Settings Settings { get; set; } + } +} diff --git a/Flow.Launcher/Resources/Pages/WelcomePage5.xaml b/Flow.Launcher/Resources/Pages/WelcomePage5.xaml new file mode 100644 index 000000000..c898ac9a0 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePage5.xaml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -57,10 +57,7 @@ MinWidth="20" MaxWidth="60" /> - + @@ -102,7 +99,7 @@ TargetType="{x:Type CheckBox}"> - + @@ -115,7 +112,12 @@ BasedOn="{StaticResource DefaultToggleSwitch}" TargetType="{x:Type ui:ToggleSwitch}"> - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml index 1ee02fa43..09ad2101b 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml @@ -10,71 +10,12 @@ mc:Ignorable="d"> - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs index 23f8f13cd..27e4a0b9a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs @@ -100,6 +100,10 @@ namespace Flow.Launcher.Plugin.Explorer.Views MessageBox.Show(settingsViewModel.Context.API.GetTranslation("newActionKeywordsHasBeenAssigned")); } + private void BtnCancel_OnClick(object sender, RoutedEventArgs e) + { + Close(); + } private void TxtCurrentActionKeyword_OnKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml index 50171a363..bbaacc18c 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml @@ -1,82 +1,145 @@ - + - + - + - + - - + + + + + + + + + + - - + + - + - - + + - + + Drop="lbxAccessLinks_Drop" + ItemTemplate="{StaticResource ListViewTemplateAccessLinks}" /> - + + Drop="lbxAccessLinks_Drop" + ItemTemplate="{StaticResource ListViewTemplateExcludedPaths}" /> - - + + - - + + + + + + + + + + + + + + + + + + + + + +