From 3b0def815969c24b94de1ce52b4b6d986bfc46a0 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 3 Jun 2025 23:06:24 +0800 Subject: [PATCH 01/16] Add new api OpenWebUrl --- Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 13 +++++++++++++ Flow.Launcher/PublicAPIInstance.cs | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index cb60251ed..e89839131 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -305,6 +305,19 @@ namespace Flow.Launcher.Plugin /// Extra FileName Info public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null); + /// + /// Opens the URL using the browser with the given Uri object, even if the URL is a local file. + /// The browser and mode used is based on what's configured in Flow's default browser settings. + /// + public void OpenWebUrl(Uri url, bool? inPrivate = null, bool forceBrower = false); + + /// + /// Opens the URL using the browser with the given string, even if the URL is a local file. + /// The browser and mode used is based on what's configured in Flow's default browser settings. + /// Non-C# plugins should use this method. + /// + public void OpenWebUrl(string url, bool? inPrivate = null, bool forceBrower = false); + /// /// Opens the URL with the given Uri object. /// The browser and mode used is based on what's configured in Flow's default browser settings. diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index c06c56039..b238a899d 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -391,9 +391,9 @@ namespace Flow.Launcher } - private void OpenUri(Uri uri, bool? inPrivate = null) + private void OpenUri(Uri uri, bool? inPrivate = null, bool forceBrower = false) { - if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) + if (forceBrower || uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) { var browserInfo = _settings.CustomBrowser; @@ -420,6 +420,16 @@ namespace Flow.Launcher } } + public void OpenUrl(string url, bool? inPrivate = null, bool forceBrower = false) + { + OpenUri(new Uri(url), inPrivate, forceBrower); + } + + public void OpenUrl(Uri url, bool? inPrivate = null, bool forceBrower = false) + { + OpenUri(url, inPrivate, forceBrower); + } + public void OpenUrl(string url, bool? inPrivate = null) { OpenUri(new Uri(url), inPrivate); From 54c2cd13f64b3ef42d60554e79f5365da2d243dd Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 3 Jun 2025 23:06:38 +0800 Subject: [PATCH 02/16] Force web url for WebSearch plugin --- Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs index 76aeb3250..0040cffa7 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs @@ -71,7 +71,7 @@ namespace Flow.Launcher.Plugin.WebSearch Score = score, Action = c => { - _context.API.OpenUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword))); + _context.API.OpenWebUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword))); return true; }, @@ -135,7 +135,7 @@ namespace Flow.Launcher.Plugin.WebSearch ActionKeywordAssigned = searchSource.ActionKeyword == SearchSourceGlobalPluginWildCardSign ? string.Empty : searchSource.ActionKeyword, Action = c => { - _context.API.OpenUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(o))); + _context.API.OpenWebUrl(searchSource.Url.Replace("{q}", Uri.EscapeDataString(o))); return true; }, From c001041ba8d2743617c4931a0ad72038e0fd0fb1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 3 Jun 2025 23:08:51 +0800 Subject: [PATCH 03/16] Fix build issue --- Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 4 ++-- Flow.Launcher/PublicAPIInstance.cs | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs index e89839131..b87cc52d0 100644 --- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs +++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs @@ -309,14 +309,14 @@ namespace Flow.Launcher.Plugin /// Opens the URL using the browser with the given Uri object, even if the URL is a local file. /// The browser and mode used is based on what's configured in Flow's default browser settings. /// - public void OpenWebUrl(Uri url, bool? inPrivate = null, bool forceBrower = false); + public void OpenWebUrl(Uri url, bool? inPrivate = null); /// /// Opens the URL using the browser with the given string, even if the URL is a local file. /// The browser and mode used is based on what's configured in Flow's default browser settings. /// Non-C# plugins should use this method. /// - public void OpenWebUrl(string url, bool? inPrivate = null, bool forceBrower = false); + public void OpenWebUrl(string url, bool? inPrivate = null); /// /// Opens the URL with the given Uri object. diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index b238a899d..bc82c2e8f 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -390,7 +390,6 @@ namespace Flow.Launcher } } - private void OpenUri(Uri uri, bool? inPrivate = null, bool forceBrower = false) { if (forceBrower || uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) @@ -420,14 +419,14 @@ namespace Flow.Launcher } } - public void OpenUrl(string url, bool? inPrivate = null, bool forceBrower = false) + public void OpenWebUrl(string url, bool? inPrivate = null) { - OpenUri(new Uri(url), inPrivate, forceBrower); + OpenUri(new Uri(url), inPrivate, true); } - public void OpenUrl(Uri url, bool? inPrivate = null, bool forceBrower = false) + public void OpenWebUrl(Uri url, bool? inPrivate = null) { - OpenUri(url, inPrivate, forceBrower); + OpenUri(url, inPrivate, true); } public void OpenUrl(string url, bool? inPrivate = null) From f4d6ef371a7738924b3c6a3ee857ce76544e1482 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Wed, 4 Jun 2025 18:57:20 +0800 Subject: [PATCH 04/16] Fix typos --- Flow.Launcher/PublicAPIInstance.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index bc82c2e8f..b4a6b47b7 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -390,9 +390,9 @@ namespace Flow.Launcher } } - private void OpenUri(Uri uri, bool? inPrivate = null, bool forceBrower = false) + private void OpenUri(Uri uri, bool? inPrivate = null, bool forceBrowser = false) { - if (forceBrower || uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) + if (forceBrowser || uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) { var browserInfo = _settings.CustomBrowser; From 9d5a58c395bef5ea0e026fbd26aa8a139585d044 Mon Sep 17 00:00:00 2001 From: Stefan Roelofs Date: Wed, 11 Jun 2025 07:54:07 +0200 Subject: [PATCH 05/16] Refactor ActionKeywords UI and improve keyword handling Updated `ActionKeywords.xaml` to use a new `Grid` layout, enhancing the structure and flexibility of the UI. Removed a couple of layers of nested grids and stackpanels. Changed tbOldActionKeyword from a TextBlock to a TextBox so user can copy the text. Modified `ActionKeywords.xaml.cs` so the old keywords are already filled in, in the TextBox. --- Flow.Launcher/ActionKeywords.xaml | 181 +++++++++++++-------------- Flow.Launcher/ActionKeywords.xaml.cs | 47 +++---- 2 files changed, 115 insertions(+), 113 deletions(-) diff --git a/Flow.Launcher/ActionKeywords.xaml b/Flow.Launcher/ActionKeywords.xaml index 887b13126..8636eb4c2 100644 --- a/Flow.Launcher/ActionKeywords.xaml +++ b/Flow.Launcher/ActionKeywords.xaml @@ -14,102 +14,101 @@ + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -118,14 +117,14 @@ x:Name="btnCancel" Width="145" Height="30" - Margin="10 0 5 0" + Margin="10 0 10 0" Click="BtnCancel_OnClick" Content="{DynamicResource cancel}" />