From 003df049e1c7f32313df55fccadab171b6833277 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 17 May 2025 20:40:40 +1000 Subject: [PATCH 01/56] add dedicated clear result indicator for query and non-query usage --- Flow.Launcher/ViewModel/MainViewModel.cs | 36 ++++++++++++++++++------ 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 401f71ae3..64fb85296 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -267,7 +267,7 @@ namespace Flow.Launcher.ViewModel if (token.IsCancellationRequested) return; - if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, pair.Metadata, e.Query, + if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(resultsCopy, pair.Metadata, e.Query, token))) { App.API.LogError(ClassName, "Unable to add item to Result Update Queue"); @@ -793,7 +793,7 @@ namespace Flow.Launcher.ViewModel public Visibility ProgressBarVisibility { get; set; } public Visibility MainWindowVisibility { get; set; } - + // This is to be used for determining the visibility status of the main window instead of MainWindowVisibility // because it is more accurate and reliable representation than using Visibility as a condition check public bool MainWindowVisibilityStatus { get; set; } = true; @@ -1070,7 +1070,7 @@ namespace Flow.Launcher.ViewModel path = QueryResultsPreviewed() ? Results.SelectedItem?.Result?.Preview.FilePath : string.Empty; return !string.IsNullOrEmpty(path); } - + private bool QueryResultsPreviewed() { var previewed = PreviewSelectedItem == Results.SelectedItem; @@ -1280,7 +1280,7 @@ namespace Flow.Launcher.ViewModel // Update the query's IsReQuery property to true if this is a re-query query.IsReQuery = isReQuery; - + ICollection plugins = Array.Empty(); if (currentIsHomeQuery) @@ -1312,8 +1312,7 @@ namespace Flow.Launcher.ViewModel } } - var validPluginNames = plugins.Select(x => $"<{x.Metadata.Name}>"); - App.API.LogDebug(ClassName, $"Valid <{plugins.Count}> plugins: {string.Join(" ", validPluginNames)}"); + App.API.LogDebug(ClassName, $"Valid <{plugins.Count}> plugins: {string.Join(" ", plugins.Select(x => $"<{x.Metadata.Name}>"))}"); // Do not wait for performance improvement /*if (string.IsNullOrEmpty(query.ActionKeyword)) @@ -1341,6 +1340,9 @@ namespace Flow.Launcher.ViewModel Task[] tasks; if (currentIsHomeQuery) { + if (ShouldClearExistingResultsForNonQuery(plugins)) + Results.Clear(); + tasks = plugins.Select(plugin => plugin.Metadata.HomeDisabled switch { false => QueryTaskAsync(plugin, currentCancellationToken), @@ -1432,7 +1434,7 @@ namespace Flow.Launcher.ViewModel App.API.LogDebug(ClassName, $"Update results for plugin <{plugin.Metadata.Name}>"); // Indicate if to clear existing results so to show only ones from plugins with action keywords - var shouldClearExistingResults = ShouldClearExistingResults(query, currentIsHomeQuery); + var shouldClearExistingResults = ShouldClearExistingResultsForQuery(query, currentIsHomeQuery); _lastQuery = query; _previousIsHomeQuery = currentIsHomeQuery; @@ -1454,8 +1456,13 @@ namespace Flow.Launcher.ViewModel App.API.LogDebug(ClassName, $"Update results for history"); + // Indicate if to clear existing results so to show only ones from plugins with action keywords + var shouldClearExistingResults = ShouldClearExistingResultsForQuery(query, currentIsHomeQuery); + _lastQuery = query; + _previousIsHomeQuery = currentIsHomeQuery; + if (!_resultsUpdateChannelWriter.TryWrite(new ResultsForUpdate(results, _historyMetadata, query, - token))) + token, reSelect, shouldClearExistingResults))) { App.API.LogError(ClassName, "Unable to add item to Result Update Queue"); } @@ -1552,7 +1559,7 @@ namespace Flow.Launcher.ViewModel /// The current query. /// A flag indicating if the current query is a home query. /// True if the existing results should be cleared, false otherwise. - private bool ShouldClearExistingResults(Query query, bool currentIsHomeQuery) + private bool ShouldClearExistingResultsForQuery(Query query, bool currentIsHomeQuery) { // If previous or current results are from home query, we need to clear them if (_previousIsHomeQuery || currentIsHomeQuery) @@ -1571,6 +1578,17 @@ namespace Flow.Launcher.ViewModel return false; } + private bool ShouldClearExistingResultsForNonQuery(ICollection plugins) + { + if (!Settings.ShowHistoryResultsForHomePage && (plugins.Count == 0 || plugins.All(x => x.Metadata.HomeDisabled == true))) + { + App.API.LogDebug(ClassName, $"Cleared old results"); + return true; + } + + return false; + } + private Result ContextMenuTopMost(Result result) { Result menu; From b4955f7474ac7b07658fb40220551865cb9d96aa Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 17 May 2025 20:41:25 +1000 Subject: [PATCH 02/56] add subscriber for show history result toggle in settings --- .../UserSettings/Settings.cs | 15 ++++++++++++++- Flow.Launcher/MainWindow.xaml.cs | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 34bf4f90e..387469d24 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -173,7 +173,20 @@ namespace Flow.Launcher.Infrastructure.UserSettings } } - public bool ShowHistoryResultsForHomePage { get; set; } = false; + public bool _showHistoryResultsForHomePage { get; set; } = false; + public bool ShowHistoryResultsForHomePage + { + get => _showHistoryResultsForHomePage; + set + { + if(_showHistoryResultsForHomePage != value) + { + _showHistoryResultsForHomePage = value; + OnPropertyChanged(); + } + } + } + public int MaxHistoryResultsToShowForHomePage { get; set; } = 5; public int CustomExplorerIndex { get; set; } = 0; diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index e243549e3..18bceedd8 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -275,6 +275,7 @@ namespace Flow.Launcher InitializeContextMenu(); break; case nameof(Settings.ShowHomePage): + case nameof(Settings.ShowHistoryResultsForHomePage): if (_viewModel.QueryResultsSelected() && string.IsNullOrEmpty(_viewModel.QueryText)) { _viewModel.QueryResults(); From 2941e036bc864507211ed37ed9ba2ec140862daf Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 17 May 2025 21:08:18 +1000 Subject: [PATCH 03/56] add logging and method summaries --- Flow.Launcher/ViewModel/MainViewModel.cs | 23 +++++++++++++++++---- Flow.Launcher/ViewModel/ResultsViewModel.cs | 3 +++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 64fb85296..bfda18b9a 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1341,7 +1341,11 @@ namespace Flow.Launcher.ViewModel if (currentIsHomeQuery) { if (ShouldClearExistingResultsForNonQuery(plugins)) + { Results.Clear(); + App.API.LogDebug(ClassName, $"Existing results are cleared for non-query"); + } + tasks = plugins.Select(plugin => plugin.Metadata.HomeDisabled switch { @@ -1548,7 +1552,9 @@ namespace Flow.Launcher.ViewModel /// /// Determines whether the existing search results should be cleared based on the current query and the previous query type. - /// This is needed because of the design that treats plugins with action keywords and global action keywords separately. Results are gathered + /// This is used to indicate to QueryTaskAsync or QueryHistoryTask whether to clear results. If both QueryTaskAsync and QueryHistoryTask + /// are not called then use ShouldClearExistingResultsForNonQuery instead. + /// This method needed because of the design that treats plugins with action keywords and global action keywords separately. Results are gathered /// either from plugins with matching action keywords or global action keyword, but not both. So when the current results are from plugins /// with a matching action keyword and a new result set comes from a new query with the global action keyword, the existing results need to be cleared, /// and vice versa. The same applies to home page query results. @@ -1564,25 +1570,34 @@ namespace Flow.Launcher.ViewModel // If previous or current results are from home query, we need to clear them if (_previousIsHomeQuery || currentIsHomeQuery) { - App.API.LogDebug(ClassName, $"Cleared old results"); + App.API.LogDebug(ClassName, $"Existing results should be cleared for query"); return true; } // If the last and current query are not home query type, we need to check the action keyword if (_lastQuery?.ActionKeyword != query?.ActionKeyword) { - App.API.LogDebug(ClassName, $"Cleared old results"); + App.API.LogDebug(ClassName, $"Existing results should be cleared for query"); return true; } return false; } + /// + /// Determines whether existing results should be cleared for non-query calls. + /// A non-query call is where QueryTaskAsync and QueryHistoryTask methods are both not called. + /// QueryTaskAsync and QueryHistoryTask both handle result updating (clearing if required) so directly calling + /// Results.Clear() is not required. However when both are not called, we need to directly clear results and this + /// method determines on the condition when clear results should happen. + /// + /// The collection of plugins to check. + /// True if existing results should be cleared, false otherwise. private bool ShouldClearExistingResultsForNonQuery(ICollection plugins) { if (!Settings.ShowHistoryResultsForHomePage && (plugins.Count == 0 || plugins.All(x => x.Metadata.HomeDisabled == true))) { - App.API.LogDebug(ClassName, $"Cleared old results"); + App.API.LogDebug(ClassName, $"Existing results should be cleared for non-query"); return true; } diff --git a/Flow.Launcher/ViewModel/ResultsViewModel.cs b/Flow.Launcher/ViewModel/ResultsViewModel.cs index cd2736afa..46a92f750 100644 --- a/Flow.Launcher/ViewModel/ResultsViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultsViewModel.cs @@ -235,7 +235,10 @@ namespace Flow.Launcher.ViewModel var newResults = resultsForUpdates.SelectMany(u => u.Results, (u, r) => new ResultViewModel(r, _settings)); if (resultsForUpdates.Any(x => x.shouldClearExistingResults)) + { + App.API.LogDebug("NewResults", $"Existing results are cleared for query"); return newResults.OrderByDescending(rv => rv.Result.Score).ToList(); + } return Results.Where(r => r?.Result != null && resultsForUpdates.All(u => u.ID != r.Result.PluginID)) .Concat(newResults) From 50fced959e768c333895af98e8323d6f1e67595a Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 17 May 2025 21:10:47 +1000 Subject: [PATCH 04/56] remove async warning --- Flow.Launcher/MainWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 18bceedd8..f91d9d559 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -105,7 +105,7 @@ namespace Flow.Launcher Win32Helper.DisableControlBox(this); } - private async void OnLoaded(object sender, RoutedEventArgs _) + private void OnLoaded(object sender, RoutedEventArgs _) { // Check first launch if (_settings.FirstLaunch) From 073594fdeb365a504ac29927898136f3bcf0c076 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 17 May 2025 22:02:45 +1000 Subject: [PATCH 05/56] formatting --- Flow.Launcher/ViewModel/MainViewModel.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index bfda18b9a..658eabde7 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1280,8 +1280,6 @@ namespace Flow.Launcher.ViewModel // Update the query's IsReQuery property to true if this is a re-query query.IsReQuery = isReQuery; - - ICollection plugins = Array.Empty(); if (currentIsHomeQuery) { @@ -1345,7 +1343,6 @@ namespace Flow.Launcher.ViewModel Results.Clear(); App.API.LogDebug(ClassName, $"Existing results are cleared for non-query"); } - tasks = plugins.Select(plugin => plugin.Metadata.HomeDisabled switch { From 0b4409711115abb8baa34d7e82b7acd4aa467f99 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 17 May 2025 22:12:35 +1000 Subject: [PATCH 06/56] fix encapsulation for show results --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 387469d24..8890c4581 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -173,7 +173,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings } } - public bool _showHistoryResultsForHomePage { get; set; } = false; + private bool _showHistoryResultsForHomePage = false; public bool ShowHistoryResultsForHomePage { get => _showHistoryResultsForHomePage; From 7399d112611cf785cba2dd9afb2f15e79451ad95 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 17 May 2025 20:27:31 +0800 Subject: [PATCH 07/56] Add whitespace for if --- .../UserSettings/Settings.cs | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 8890c4581..9d2d854f4 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -179,7 +179,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings get => _showHistoryResultsForHomePage; set { - if(_showHistoryResultsForHomePage != value) + if (_showHistoryResultsForHomePage != value) { _showHistoryResultsForHomePage = value; OnPropertyChanged(); @@ -404,29 +404,29 @@ namespace Flow.Launcher.Infrastructure.UserSettings var list = FixedHotkeys(); // Customizeable hotkeys - if(!string.IsNullOrEmpty(Hotkey)) + if (!string.IsNullOrEmpty(Hotkey)) list.Add(new(Hotkey, "flowlauncherHotkey", () => Hotkey = "")); - if(!string.IsNullOrEmpty(PreviewHotkey)) + if (!string.IsNullOrEmpty(PreviewHotkey)) list.Add(new(PreviewHotkey, "previewHotkey", () => PreviewHotkey = "")); - if(!string.IsNullOrEmpty(AutoCompleteHotkey)) + if (!string.IsNullOrEmpty(AutoCompleteHotkey)) list.Add(new(AutoCompleteHotkey, "autoCompleteHotkey", () => AutoCompleteHotkey = "")); - if(!string.IsNullOrEmpty(AutoCompleteHotkey2)) + if (!string.IsNullOrEmpty(AutoCompleteHotkey2)) list.Add(new(AutoCompleteHotkey2, "autoCompleteHotkey", () => AutoCompleteHotkey2 = "")); - if(!string.IsNullOrEmpty(SelectNextItemHotkey)) + if (!string.IsNullOrEmpty(SelectNextItemHotkey)) list.Add(new(SelectNextItemHotkey, "SelectNextItemHotkey", () => SelectNextItemHotkey = "")); - if(!string.IsNullOrEmpty(SelectNextItemHotkey2)) + if (!string.IsNullOrEmpty(SelectNextItemHotkey2)) list.Add(new(SelectNextItemHotkey2, "SelectNextItemHotkey", () => SelectNextItemHotkey2 = "")); - if(!string.IsNullOrEmpty(SelectPrevItemHotkey)) + if (!string.IsNullOrEmpty(SelectPrevItemHotkey)) list.Add(new(SelectPrevItemHotkey, "SelectPrevItemHotkey", () => SelectPrevItemHotkey = "")); - if(!string.IsNullOrEmpty(SelectPrevItemHotkey2)) + if (!string.IsNullOrEmpty(SelectPrevItemHotkey2)) list.Add(new(SelectPrevItemHotkey2, "SelectPrevItemHotkey", () => SelectPrevItemHotkey2 = "")); - if(!string.IsNullOrEmpty(SettingWindowHotkey)) + if (!string.IsNullOrEmpty(SettingWindowHotkey)) list.Add(new(SettingWindowHotkey, "SettingWindowHotkey", () => SettingWindowHotkey = "")); - if(!string.IsNullOrEmpty(OpenContextMenuHotkey)) + if (!string.IsNullOrEmpty(OpenContextMenuHotkey)) list.Add(new(OpenContextMenuHotkey, "OpenContextMenuHotkey", () => OpenContextMenuHotkey = "")); - if(!string.IsNullOrEmpty(SelectNextPageHotkey)) + if (!string.IsNullOrEmpty(SelectNextPageHotkey)) list.Add(new(SelectNextPageHotkey, "SelectNextPageHotkey", () => SelectNextPageHotkey = "")); - if(!string.IsNullOrEmpty(SelectPrevPageHotkey)) + if (!string.IsNullOrEmpty(SelectPrevPageHotkey)) list.Add(new(SelectPrevPageHotkey, "SelectPrevPageHotkey", () => SelectPrevPageHotkey = "")); if (!string.IsNullOrEmpty(CycleHistoryUpHotkey)) list.Add(new(CycleHistoryUpHotkey, "CycleHistoryUpHotkey", () => CycleHistoryUpHotkey = "")); From b878532cdddfef9833ac384d0ff7672782c0803d Mon Sep 17 00:00:00 2001 From: Jeremy Date: Mon, 19 May 2025 22:19:35 +1000 Subject: [PATCH 08/56] unify plugin versions to flow main version --- appveyor.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index af5aaefdc..74b86fc50 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,6 +8,14 @@ init: { $env:prereleaseTag = "{0}.{1}.{2}.{3}" -f $version.Major, $version.Minor, $version.Build, $version.Revision } + + $jsonFiles = Get-ChildItem -Path ".\Plugins\*\plugin.json" + foreach ($file in $jsonFiles) { + $plugin_old_ver = Get-Content $file.FullName -Raw | ConvertFrom-Json + (Get-Content $file) -replace '"Version"\s*:\s*".*?"', "`"Version`": `"$env:flowVersion`"" | Set-Content $file + $plugin_new_ver = Get-Content $file.FullName -Raw | ConvertFrom-Json + Write-Host "Updated" $plugin_old_ver.Name "version from" $plugin_old_ver.Version "to" $plugin_new_ver.Version + } - sc config WSearch start= auto # Starts Windows Search service- Needed for running ExplorerTest - net start WSearch From 94cec8aa1bdbec9f435de64e0a8c27237362e1b3 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 20 May 2025 12:43:26 +1000 Subject: [PATCH 09/56] move plugin version bump to build step --- appveyor.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 74b86fc50..5902f09f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,14 +8,6 @@ init: { $env:prereleaseTag = "{0}.{1}.{2}.{3}" -f $version.Major, $version.Minor, $version.Build, $version.Revision } - - $jsonFiles = Get-ChildItem -Path ".\Plugins\*\plugin.json" - foreach ($file in $jsonFiles) { - $plugin_old_ver = Get-Content $file.FullName -Raw | ConvertFrom-Json - (Get-Content $file) -replace '"Version"\s*:\s*".*?"', "`"Version`": `"$env:flowVersion`"" | Set-Content $file - $plugin_new_ver = Get-Content $file.FullName -Raw | ConvertFrom-Json - Write-Host "Updated" $plugin_old_ver.Name "version from" $plugin_old_ver.Version "to" $plugin_new_ver.Version - } - sc config WSearch start= auto # Starts Windows Search service- Needed for running ExplorerTest - net start WSearch @@ -34,7 +26,16 @@ image: Visual Studio 2022 platform: Any CPU configuration: Release before_build: -- ps: nuget restore +- ps: | + nuget restore + + $jsonFiles = Get-ChildItem -Path ".\Plugins\*\plugin.json" + foreach ($file in $jsonFiles) { + $plugin_old_ver = Get-Content $file.FullName -Raw | ConvertFrom-Json + (Get-Content $file) -replace '"Version"\s*:\s*".*?"', "`"Version`": `"$env:flowVersion`"" | Set-Content $file + $plugin_new_ver = Get-Content $file.FullName -Raw | ConvertFrom-Json + Write-Host "Updated" $plugin_old_ver.Name "version from" $plugin_old_ver.Version "to" $plugin_new_ver.Version + } build: project: Flow.Launcher.sln verbosity: minimal From 2b9529d2f97eb767117350d07f5ceef2e8d225ba Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 20 May 2025 09:06:11 +0000 Subject: [PATCH 10/56] set all of plugins' version to default 1.0.0 --- Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.Calculator/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.Explorer/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.Program/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.Shell/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.Sys/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.Url/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json | 2 +- Plugins/Flow.Launcher.Plugin.WindowsSettings/plugin.json | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json index 519141f6c..30e34f62d 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/plugin.json @@ -4,7 +4,7 @@ "Name": "Browser Bookmarks", "Description": "Search your browser bookmarks", "Author": "qianlifeng, Ioannis G.", - "Version": "3.3.4", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.BrowserBookmark.dll", diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json index 99e185928..485babd26 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json @@ -4,7 +4,7 @@ "Name": "Calculator", "Description": "Provide mathematical calculations.(Try 5*3-2 in Flow Launcher)", "Author": "cxfksword", - "Version": "3.1.5", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Calculator.dll", diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json index d2440ab61..5eea2646e 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Explorer/plugin.json @@ -11,7 +11,7 @@ "Name": "Explorer", "Description": "Find and manage files and folders via Windows Search or Everything", "Author": "Jeremy Wu", - "Version": "3.2.4", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll", diff --git a/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json index 2b4870792..7e6a2e613 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.PluginIndicator/plugin.json @@ -4,7 +4,7 @@ "Name": "Plugin Indicator", "Description": "Provides plugin action keyword suggestions", "Author": "qianlifeng", - "Version": "3.0.7", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.PluginIndicator.dll", diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json index df5a2c784..327011ac3 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/plugin.json @@ -6,7 +6,7 @@ "Name": "Plugins Manager", "Description": "Management of installing, uninstalling or updating Flow Launcher plugins", "Author": "Jeremy Wu", - "Version": "3.2.4", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.PluginsManager.dll", diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json b/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json index 956c4b4e1..0379194c4 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json @@ -4,7 +4,7 @@ "Name":"Process Killer", "Description":"Kill running processes from Flow", "Author":"Flow-Launcher", - "Version":"3.0.8", + "Version": "1.0.0", "Language":"csharp", "Website":"https://github.com/Flow-Launcher/Flow.Launcher.Plugin.ProcessKiller", "IcoPath":"Images\\app.png", diff --git a/Plugins/Flow.Launcher.Plugin.Program/plugin.json b/Plugins/Flow.Launcher.Plugin.Program/plugin.json index 5a95e75f4..0316a2397 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Program/plugin.json @@ -4,7 +4,7 @@ "Name": "Program", "Description": "Search programs in Flow.Launcher", "Author": "qianlifeng", - "Version": "3.3.4", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Program.dll", diff --git a/Plugins/Flow.Launcher.Plugin.Shell/plugin.json b/Plugins/Flow.Launcher.Plugin.Shell/plugin.json index 681e8f751..36f9b8e00 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Shell/plugin.json @@ -4,7 +4,7 @@ "Name": "Shell", "Description": "Provide executing commands from Flow Launcher", "Author": "qianlifeng", - "Version": "3.2.5", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Shell.dll", diff --git a/Plugins/Flow.Launcher.Plugin.Sys/plugin.json b/Plugins/Flow.Launcher.Plugin.Sys/plugin.json index 90ca264cc..68ce6feb1 100644 --- a/Plugins/Flow.Launcher.Plugin.Sys/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Sys/plugin.json @@ -4,7 +4,7 @@ "Name": "System Commands", "Description": "Provide System related commands. e.g. shutdown,lock, setting etc.", "Author": "qianlifeng", - "Version": "3.1.7", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Sys.dll", diff --git a/Plugins/Flow.Launcher.Plugin.Url/plugin.json b/Plugins/Flow.Launcher.Plugin.Url/plugin.json index 73d9bff30..9f5576ba9 100644 --- a/Plugins/Flow.Launcher.Plugin.Url/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Url/plugin.json @@ -4,7 +4,7 @@ "Name": "URL", "Description": "Open the typed URL from Flow Launcher", "Author": "qianlifeng", - "Version": "3.0.8", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Url.dll", diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json index c8b6310a7..b4153feb1 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/plugin.json @@ -27,7 +27,7 @@ "Name": "Web Searches", "Description": "Provide the web search ability", "Author": "qianlifeng", - "Version": "3.1.4", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.WebSearch.dll", diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/plugin.json b/Plugins/Flow.Launcher.Plugin.WindowsSettings/plugin.json index 413a555d3..64743b3d8 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/plugin.json @@ -4,7 +4,7 @@ "Description": "Search settings inside Control Panel and Settings App", "Name": "Windows Settings", "Author": "TobiasSekan", - "Version": "4.0.12", + "Version": "1.0.0", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.WindowsSettings.dll", From 037b800f4a6d673f163e83e4c121c86f3fe777ac Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 20 May 2025 17:56:24 +0900 Subject: [PATCH 11/56] Add file manager path validation and error handling in SelectFileManagerWindow --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 027eb3f92..f00f42ac0 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -226,8 +226,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings new() { Name = "Files", - Path = "Files", - DirectoryArgument = "-select \"%d\"", + Path = "Files-Stable", + DirectoryArgument = "\"%d\"", FileArgument = "-select \"%f\"" } }; From 2c7fb93d3710bd4cee3437b7bd4e090d23d37e2a Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 20 May 2025 18:49:38 +0900 Subject: [PATCH 12/56] Add error handling and validation for custom file manager paths --- Flow.Launcher/Languages/en.xaml | 6 ++ Flow.Launcher/PublicAPIInstance.cs | 83 ++++++++++++------- Flow.Launcher/SelectFileManagerWindow.xaml.cs | 56 ++++++++++++- 3 files changed, 114 insertions(+), 31 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 22ab2016c..299fe3029 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -373,6 +373,8 @@ File Manager Path Arg For Folder Arg For File + The path for the file manager '{0}' could not be found: {1}\n\nDo you want to continue? + File Manager Path Error Default Web Browser @@ -462,6 +464,10 @@ 1. Upload log file: {0} 2. Copy below exception message + + An error occurred while opening the folder.:\n{0} + Error + Please wait... diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 796f65ae6..84448a685 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -316,40 +316,63 @@ namespace Flow.Launcher public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null) { - using var explorer = new Process(); - var explorerInfo = _settings.CustomExplorer; - var explorerPath = explorerInfo.Path.Trim().ToLowerInvariant(); - var targetPath = FileNameOrFilePath is null - ? DirectoryPath - : Path.IsPathRooted(FileNameOrFilePath) - ? FileNameOrFilePath - : Path.Combine(DirectoryPath, FileNameOrFilePath); + try + { + using var explorer = new Process(); + var explorerInfo = _settings.CustomExplorer; + var explorerPath = explorerInfo.Path.Trim().ToLowerInvariant(); + var targetPath = FileNameOrFilePath is null + ? DirectoryPath + : Path.IsPathRooted(FileNameOrFilePath) + ? FileNameOrFilePath + : Path.Combine(DirectoryPath, FileNameOrFilePath); - if (Path.GetFileNameWithoutExtension(explorerPath) == "explorer") - { - // Windows File Manager - // We should ignore and pass only the path to Shell to prevent zombie explorer.exe processes - explorer.StartInfo = new ProcessStartInfo + if (Path.GetFileNameWithoutExtension(explorerPath) == "explorer") { - FileName = targetPath, // Not explorer, Only path. - UseShellExecute = true // Must be true to open folder - }; - } - else - { - // Custom File Manager - explorer.StartInfo = new ProcessStartInfo + // Windows File Manager + explorer.StartInfo = new ProcessStartInfo + { + FileName = targetPath, + UseShellExecute = true + }; + } + else { - FileName = explorerInfo.Path.Replace("%d", DirectoryPath), - UseShellExecute = true, - Arguments = FileNameOrFilePath is null - ? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) - : explorerInfo.FileArgument - .Replace("%d", DirectoryPath) - .Replace("%f", targetPath) - }; + // Custom File Manager + explorer.StartInfo = new ProcessStartInfo + { + FileName = explorerInfo.Path.Replace("%d", DirectoryPath), + UseShellExecute = true, + Arguments = FileNameOrFilePath is null + ? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) + : explorerInfo.FileArgument + .Replace("%d", DirectoryPath) + .Replace("%f", targetPath) + }; + } + + explorer.Start(); + } + catch (System.ComponentModel.Win32Exception ex) when (ex.NativeErrorCode == 2) + { + // File Manager not found + MessageBoxEx.Show( + string.Format(GetTranslation("fileManagerNotFound"), ex.Message), + GetTranslation("fileManagerNotFoundTitle"), + MessageBoxButton.OK, + MessageBoxImage.Error + ); + } + catch (Exception ex) + { + // Other exceptions + MessageBoxEx.Show( + string.Format(GetTranslation("folderOpenError"), ex.Message), + GetTranslation("errorTitle"), + MessageBoxButton.OK, + MessageBoxImage.Error + ); } - explorer.Start(); } private void OpenUri(Uri uri, bool? inPrivate = null) diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml.cs b/Flow.Launcher/SelectFileManagerWindow.xaml.cs index bf94ddacb..d2f7ae764 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml.cs +++ b/Flow.Launcher/SelectFileManagerWindow.xaml.cs @@ -1,5 +1,8 @@ -using System.Collections.ObjectModel; +using System; +using System.Collections.ObjectModel; using System.ComponentModel; +using System.Diagnostics; +using System.IO; using System.Linq; using System.Windows; using System.Windows.Controls; @@ -43,11 +46,62 @@ namespace Flow.Launcher private void btnDone_Click(object sender, RoutedEventArgs e) { + // Check if the selected file manager path is valid + if (!IsFileManagerValid(CustomExplorer.Path)) + { + MessageBoxResult result = MessageBoxEx.Show( + string.Format((string)Application.Current.FindResource("fileManagerPathNotFound"), + CustomExplorer.Name, CustomExplorer.Path), + (string)Application.Current.FindResource("fileManagerPathError"), + MessageBoxButton.YesNo, + MessageBoxImage.Warning); + + if (result == MessageBoxResult.No) + { + return; + } + } + _settings.CustomExplorerList = CustomExplorers.ToList(); _settings.CustomExplorerIndex = SelectedCustomExplorerIndex; Close(); } + private bool IsFileManagerValid(string path) + { + if (string.Equals(path, "explorer", StringComparison.OrdinalIgnoreCase)) + return true; + + if (Path.IsPathRooted(path)) + { + return File.Exists(path); + } + + try + { + var process = new Process + { + StartInfo = new ProcessStartInfo + { + FileName = "where", + Arguments = path, + RedirectStandardOutput = true, + UseShellExecute = false, + CreateNoWindow = true + } + }; + process.Start(); + string output = process.StandardOutput.ReadToEnd(); + process.WaitForExit(); + + return !string.IsNullOrEmpty(output); + } + catch + { + return false; + } + } + private void btnAdd_Click(object sender, RoutedEventArgs e) { CustomExplorers.Add(new() From cc80221903577e21cc8123159d0f15ddde60a250 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 20 May 2025 20:00:13 +1000 Subject: [PATCH 13/56] Version bump for release --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 5902f09f1..fa0b5956b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: '1.19.5.{build}' +version: '1.20.0.{build}' init: - ps: | From aadfde09d5745c14af96af70227360967b39edd4 Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 20 May 2025 20:32:46 +0900 Subject: [PATCH 14/56] Add tips for file manager usage and improve error messages --- Flow.Launcher/Languages/en.xaml | 10 +++- Flow.Launcher/SelectFileManagerWindow.xaml | 15 ++++-- Flow.Launcher/SelectFileManagerWindow.xaml.cs | 46 +++++++++++++++++++ 3 files changed, 66 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 299fe3029..186f6bd3e 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -366,6 +366,8 @@ Select File Manager + Do you use Files? + Depending on the version, Files may use either "Files" or "Files-stable" as its path. (This can vary depending on which version you're using.) For more details, see: Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. File Manager @@ -373,7 +375,7 @@ File Manager Path Arg For Folder Arg For File - The path for the file manager '{0}' could not be found: {1}\n\nDo you want to continue? + The path for the file manager '{0}' could not be found: '{1}' Do you want to continue? File Manager Path Error @@ -465,8 +467,12 @@ 2. Copy below exception message - An error occurred while opening the folder.:\n{0} + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings >General. + Error + An error occurred while opening the folder. {0} Please wait... diff --git a/Flow.Launcher/SelectFileManagerWindow.xaml b/Flow.Launcher/SelectFileManagerWindow.xaml index 0287af9b0..fbdc2c3b2 100644 --- a/Flow.Launcher/SelectFileManagerWindow.xaml +++ b/Flow.Launcher/SelectFileManagerWindow.xaml @@ -73,9 +73,18 @@ + void ShowMainWindow(); + + /// + /// Focus the query text box in the main window + /// + void FocusQueryTextBox(); /// /// Hide MainWindow diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index a0614d90f..7b80ec480 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -33,6 +33,7 @@ using JetBrains.Annotations; using Squirrel; using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch; using System.ComponentModel; +using System.Windows.Input; namespace Flow.Launcher { @@ -92,6 +93,18 @@ namespace Flow.Launcher } public void ShowMainWindow() => _mainVM.Show(); + + public void FocusQueryTextBox() + { + Application.Current.Dispatcher.Invoke(new Action(() => + { + if (Application.Current.MainWindow is MainWindow mw) + { + mw.QueryTextBox.Focus(); + Keyboard.Focus(mw.QueryTextBox); + } + })); + } public void HideMainWindow() => _mainVM.Hide(); diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs index 0d395c053..758ad09d5 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs @@ -378,10 +378,13 @@ namespace Flow.Launcher.Plugin.Shell private void OnWinRPressed() { + Context.API.ShowMainWindow(); // show the main window and set focus to the query box - _ = Task.Run(() => + _ = Task.Run(async () => { - Context.API.ShowMainWindow(); + await Task.Delay(50); // 💡 키보드 이벤트 처리가 끝난 뒤 + Context.API.FocusQueryTextBox(); + Context.API.ChangeQuery($"{Context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeparator}"); }); } From 3718ae5640bbe5e9af2a389964386d9d81444114 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 22 May 2025 10:39:09 +0800 Subject: [PATCH 32/56] Improve code quality & Improve code comments --- Flow.Launcher/PublicAPIInstance.cs | 18 ++++-------------- Flow.Launcher/ViewModel/MainViewModel.cs | 15 +++++++++++++++ Plugins/Flow.Launcher.Plugin.Shell/Main.cs | 9 ++++++--- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 7b80ec480..66e11f881 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -2,6 +2,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Collections.Specialized; +using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; @@ -10,6 +11,7 @@ using System.Runtime.CompilerServices; using System.Threading; using System.Threading.Tasks; using System.Windows; +using System.Windows.Input; using System.Windows.Media; using CommunityToolkit.Mvvm.DependencyInjection; using Flow.Launcher.Core; @@ -32,8 +34,6 @@ using Flow.Launcher.ViewModel; using JetBrains.Annotations; using Squirrel; using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch; -using System.ComponentModel; -using System.Windows.Input; namespace Flow.Launcher { @@ -93,18 +93,8 @@ namespace Flow.Launcher } public void ShowMainWindow() => _mainVM.Show(); - - public void FocusQueryTextBox() - { - Application.Current.Dispatcher.Invoke(new Action(() => - { - if (Application.Current.MainWindow is MainWindow mw) - { - mw.QueryTextBox.Focus(); - Keyboard.Focus(mw.QueryTextBox); - } - })); - } + + public void FocusQueryTextBox() => _mainVM.FocusQueryTextBox(); public void HideMainWindow() => _mainVM.Hide(); diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 807275fcb..6e1b0dd93 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1926,6 +1926,21 @@ namespace Flow.Launcher.ViewModel Results.AddResults(resultsForUpdates, token, reSelect); } + [System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "")] + public void FocusQueryTextBox() + { + // When application is exiting, the Application.Current will be null + Application.Current?.Dispatcher.Invoke(() => + { + // When application is exiting, the Application.Current will be null + if (Application.Current?.MainWindow is MainWindow window) + { + window.QueryTextBox.Focus(); + Keyboard.Focus(window.QueryTextBox); + } + }); + } + #endregion #region IDisposable diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs index 758ad09d5..2613c770b 100644 --- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs @@ -382,10 +382,13 @@ namespace Flow.Launcher.Plugin.Shell // show the main window and set focus to the query box _ = Task.Run(async () => { - await Task.Delay(50); // 💡 키보드 이벤트 처리가 끝난 뒤 - Context.API.FocusQueryTextBox(); - Context.API.ChangeQuery($"{Context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeparator}"); + + // Win+R is a system-reserved shortcut, and though the plugin intercepts the keyboard event and + // shows the main window, Windows continues to process the Win key and briefly reclaims focus. + // So we need to wait until the keyboard event processing is completed and then set focus + await Task.Delay(50); + Context.API.FocusQueryTextBox(); }); } From 8aae92e61da289815da6d8f5291b5718c6741340 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 22 May 2025 10:47:07 +0800 Subject: [PATCH 33/56] Fix main window null when checking exitting --- Flow.Launcher/App.xaml.cs | 2 +- Flow.Launcher/SettingWindow.xaml.cs | 2 +- Flow.Launcher/ViewModel/MainViewModel.cs | 2 +- Flow.Launcher/WelcomeWindow.xaml.cs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/App.xaml.cs b/Flow.Launcher/App.xaml.cs index 969bb75bb..cedced181 100644 --- a/Flow.Launcher/App.xaml.cs +++ b/Flow.Launcher/App.xaml.cs @@ -32,7 +32,7 @@ namespace Flow.Launcher #region Public Properties public static IPublicAPI API { get; private set; } - public static bool Exiting => _mainWindow.CanClose; + public static bool LoadingOrExiting => _mainWindow == null || _mainWindow.CanClose; #endregion diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index c53a4ea80..c1c0f96a7 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -82,7 +82,7 @@ public partial class SettingWindow _viewModel.PropertyChanged -= ViewModel_PropertyChanged; // If app is exiting, settings save is not needed because main window closing event will handle this - if (App.Exiting) return; + if (App.LoadingOrExiting) return; // Save settings when window is closed _settings.Save(); App.API.SavePluginSettings(); diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 807275fcb..c4da384f8 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -1729,7 +1729,7 @@ namespace Flow.Launcher.ViewModel public void Show() { // When application is exiting, we should not show the main window - if (App.Exiting) return; + if (App.LoadingOrExiting) return; // When application is exiting, the Application.Current will be null Application.Current?.Dispatcher.Invoke(() => diff --git a/Flow.Launcher/WelcomeWindow.xaml.cs b/Flow.Launcher/WelcomeWindow.xaml.cs index ef0706765..fe8a63e52 100644 --- a/Flow.Launcher/WelcomeWindow.xaml.cs +++ b/Flow.Launcher/WelcomeWindow.xaml.cs @@ -96,7 +96,7 @@ namespace Flow.Launcher private void Window_Closed(object sender, EventArgs e) { // If app is exiting, settings save is not needed because main window closing event will handle this - if (App.Exiting) return; + if (App.LoadingOrExiting) return; // Save settings when window is closed _settings.Save(); } From 087a45c66458c700b5f9f0e28278fe2abd34938a Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 22 May 2025 20:41:04 +1000 Subject: [PATCH 34/56] New Crowdin updates (#3559) --- Flow.Launcher/Languages/ar.xaml | 11 +++++++++++ Flow.Launcher/Languages/cs.xaml | 11 +++++++++++ Flow.Launcher/Languages/da.xaml | 11 +++++++++++ Flow.Launcher/Languages/de.xaml | 11 +++++++++++ Flow.Launcher/Languages/es-419.xaml | 11 +++++++++++ Flow.Launcher/Languages/es.xaml | 11 +++++++++++ Flow.Launcher/Languages/fr.xaml | 11 +++++++++++ Flow.Launcher/Languages/he.xaml | 11 +++++++++++ Flow.Launcher/Languages/it.xaml | 11 +++++++++++ Flow.Launcher/Languages/ja.xaml | 11 +++++++++++ Flow.Launcher/Languages/ko.xaml | 11 +++++++++++ Flow.Launcher/Languages/nb.xaml | 11 +++++++++++ Flow.Launcher/Languages/nl.xaml | 11 +++++++++++ Flow.Launcher/Languages/pl.xaml | 11 +++++++++++ Flow.Launcher/Languages/pt-br.xaml | 11 +++++++++++ Flow.Launcher/Languages/pt-pt.xaml | 11 +++++++++++ Flow.Launcher/Languages/ru.xaml | 11 +++++++++++ Flow.Launcher/Languages/sk.xaml | 13 ++++++++++++- Flow.Launcher/Languages/sr.xaml | 11 +++++++++++ Flow.Launcher/Languages/tr.xaml | 11 +++++++++++ Flow.Launcher/Languages/uk-UA.xaml | 11 +++++++++++ Flow.Launcher/Languages/vi.xaml | 11 +++++++++++ Flow.Launcher/Languages/zh-cn.xaml | 11 +++++++++++ Flow.Launcher/Languages/zh-tw.xaml | 11 +++++++++++ .../Properties/Resources.ja-JP.resx | 6 +++--- 25 files changed, 268 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/Languages/ar.xaml b/Flow.Launcher/Languages/ar.xaml index b81c5c9b5..42cfdf3eb 100644 --- a/Flow.Launcher/Languages/ar.xaml +++ b/Flow.Launcher/Languages/ar.xaml @@ -371,6 +371,7 @@ اختر مدير الملفات + Learn more يرجى تحديد موقع ملف مدير الملفات الذي تستخدمه وإضافة الحجج حسب الحاجة. يمثل "%d" مسار الدليل المفتوح، ويستخدمه الحقل "الحجة للمجلد" للأوامر التي تفتح أدلة محددة. يمثل "%f" مسار الملف المفتوح، ويستخدمه الحقل "الحجة للملف" للأوامر التي تفتح ملفات محددة. على سبيل المثال، إذا كان مدير الملفات يستخدم أمرًا مثل "totalcmd.exe /A c:\windows" لفتح دليل c:\windows، فإن مسار مدير الملفات سيكون totalcmd.exe، وحجة المجلد ستكون /A "%d". قد تحتاج بعض مديري الملفات مثل QTTabBar فقط إلى توفير مسار، في هذه الحالة استخدم "%d" كمسار مدير الملفات واترك باقي الحقول فارغة. مدير الملفات @@ -378,6 +379,8 @@ مسار مدير الملفات حجة للمجلد حجة للملف + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error متصفح الويب الافتراضي @@ -469,6 +472,14 @@ 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + خطأ + An error occurred while opening the folder. {0} + يرجى الانتظار... diff --git a/Flow.Launcher/Languages/cs.xaml b/Flow.Launcher/Languages/cs.xaml index 71c9c8c6b..bfcd92360 100644 --- a/Flow.Launcher/Languages/cs.xaml +++ b/Flow.Launcher/Languages/cs.xaml @@ -371,6 +371,7 @@ Vybrat správce souborů + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Správce souborů @@ -378,6 +379,8 @@ Cesta k správci souborů Argumenty pro složku Argumenty pro Soubor + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Výchozí prohlížeč @@ -469,6 +472,14 @@ Pokud před zkratku při zadávání přidáte znak "@", bude odpovíd 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Chyba + An error occurred while opening the folder. {0} + Počkejte prosím... diff --git a/Flow.Launcher/Languages/da.xaml b/Flow.Launcher/Languages/da.xaml index 37723dc9b..9a4cbc003 100644 --- a/Flow.Launcher/Languages/da.xaml +++ b/Flow.Launcher/Languages/da.xaml @@ -371,6 +371,7 @@ Select File Manager + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Filhåndtering @@ -378,6 +379,8 @@ Sti til filhåndtering Arg for mappe Arg for fil + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Default Web Browser @@ -469,6 +472,14 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + Please wait... diff --git a/Flow.Launcher/Languages/de.xaml b/Flow.Launcher/Languages/de.xaml index 895a2dab6..88c5b84d4 100644 --- a/Flow.Launcher/Languages/de.xaml +++ b/Flow.Launcher/Languages/de.xaml @@ -371,6 +371,7 @@ Dateimanager auswählen + Learn more Bitte geben Sie den Dateiort des von Ihnen verwendeten Dateimanagers an und fügen Sie bei Bedarf Argumente hinzu. Das „%d“ repräsentiert den dafür zu öffnenden Verzeichnispfad, der vom Feld Arg for Folder und für Befehle zum Öffnen bestimmter Verzeichnisse verwendet wird. Das „%f“ repräsentiert den dafür zu öffnenden Dateipfad, der vom Feld Arg for File und für Befehle zum Öffnen bestimmter Dateien verwendet wird. Zum Beispiel, wenn der Dateimanager einen Befehl wie „totalcmd.exe /A c:\windows“ verwendet, um das Verzeichnis c:\windows zu öffnen, lautet der Dateimanager-Pfad „totalcmd.exe“ und der Arg for Folder „/A %d“. Bestimmte Dateimanager wie QTTabBar kann nur die Angabe eines Pfades erfordern, in diesem Fall verwenden Sie „%d“ als den Dateimanager-Pfad und lassen den Rest der Felder blank. Dateimanager @@ -378,6 +379,8 @@ Dateimanager-Pfad Arg For Folder Arg For File + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Webbrowser per Default @@ -469,6 +472,14 @@ Wenn Sie bei der Eingabe eines Shortcuts ein '@'-Präfix hinzufügen, stimmt die 1. Logdatei hochladen: {0} 2. Kopieren Sie die Ausnahmemeldung unterhalb + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Fehler + An error occurred while opening the folder. {0} + Bitte warten Sie ... diff --git a/Flow.Launcher/Languages/es-419.xaml b/Flow.Launcher/Languages/es-419.xaml index 902811a56..b73a1ef12 100644 --- a/Flow.Launcher/Languages/es-419.xaml +++ b/Flow.Launcher/Languages/es-419.xaml @@ -371,6 +371,7 @@ Seleccionar Gestor de Archivos + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Gestor de Archivos @@ -378,6 +379,8 @@ Ruta del Gestor de Archivos Arg para Carpeta Arg para Archivo + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Navegador Web Predeterminado @@ -469,6 +472,14 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + Por favor espere... diff --git a/Flow.Launcher/Languages/es.xaml b/Flow.Launcher/Languages/es.xaml index 0dc6833af..2b6074f06 100644 --- a/Flow.Launcher/Languages/es.xaml +++ b/Flow.Launcher/Languages/es.xaml @@ -371,6 +371,7 @@ Seleccionar administrador de archivos + Learn more Especifique la ubicación del archivo del administrador de archivos que está utilizando y añada los argumentos necesarios. El argumento "%d" representa la ruta del directorio a abrir, utilizada por el campo Argumentos de la carpeta y por comandos que abren directorios específicos. El "%f" representa la ruta del archivo a abrir, utilizada por el campo Argumentos del archivo y por comandos que abren archivos específicos. Por ejemplo, si el administrador de archivos utiliza un comando como "totalcmd.exe /A c:\windows" para abrir el directorio c:\windows, la ruta del administrador de archivos será totalcmd.exe, y los Argumentos de la carpeta serán /A "%d". Ciertos administradores de archivos como QTTabBar pueden requerir solo la ruta, en este caso utilice "%d" como la ruta del administrador de archivos y deje el resto de los campos en blanco. Administrador de archivos @@ -378,6 +379,8 @@ Ruta del administrador de archivos Argumentos de la carpeta Argumentos del archivo + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Navegador web predeterminado @@ -469,6 +472,14 @@ Si añade un prefijo "@" al introducir un acceso directo, éste coinci 1. Subir archivo de registro: {0} 2. Copiar el siguiente mensaje de excepción + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + Por favor espere... diff --git a/Flow.Launcher/Languages/fr.xaml b/Flow.Launcher/Languages/fr.xaml index 41fdbaa51..cd6d8c01f 100644 --- a/Flow.Launcher/Languages/fr.xaml +++ b/Flow.Launcher/Languages/fr.xaml @@ -370,6 +370,7 @@ Sélectionner le gestionnaire de fichiers + Learn more Veuillez spécifier l'emplacement du fichier de l'explorateur de fichiers que vous utilisez et ajouter des arguments si nécessaire. Le "%d" représente le chemin du répertoire à ouvrir, utilisé par le champ Arg for Folder et pour les commandes ouvrant des répertoires spécifiques. Le "%f" représente le chemin du fichier à ouvrir, utilisé par le champ Arg for File et pour les commandes ouvrant des fichiers spécifiques. Par exemple, si l'explorateur de fichiers utilise une commande telle que "totalcmd.exe /A c:\windows" pour ouvrir le répertoire c:\windows, le chemin de l'explorateur de fichiers sera totalcmd.exe et l'argument Arg For Folder sera /A "%d"". Certains explorateurs de fichiers comme QTTabBar peuvent simplement nécessiter qu'un chemin soit fourni, dans ce cas, utilisez "%d" comme chemin de l'explorateur de fichiers et laissez le reste des fichiers vides. Gestionnaire de fichiers @@ -377,6 +378,8 @@ Chemin du gestionnaire de fichiers Arguments pour le répertoire Arguments pour le fichier + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Navigateur web par défaut @@ -468,6 +471,14 @@ Si vous ajoutez un préfixe "@" lors de la saisie d'un raccourci, celu 1. Télécharger le fichier journal : {0} 2. Copiez le message d’exception ci-dessous + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Erreur + An error occurred while opening the folder. {0} + Veuillez patienter... diff --git a/Flow.Launcher/Languages/he.xaml b/Flow.Launcher/Languages/he.xaml index 52eaf5e9f..b98c2ec73 100644 --- a/Flow.Launcher/Languages/he.xaml +++ b/Flow.Launcher/Languages/he.xaml @@ -370,6 +370,7 @@ בחר מנהל קבצים + Learn more אנא ציין את מיקום הקובץ של מנהל הקבצים שבו אתה משתמש והוסף ארגומנטים כנדרש. "%d" מייצג את נתיב התיקייה שיש לפתוח, ומשמש בשדה ארגומנט לתיקייה ובפקודות לפתיחת תיקיות מסוימות. "%f" מייצג את נתיב הקובץ שיש לפתוח, ומשמש בשדה ארגומנט לקובץ ובפקודות לפתיחת קבצים מסוימים. לדוגמה, אם מנהל הקבצים משתמש בפקודה כגון "totalcmd.exe /A c:\windows" כדי לפתוח את התיקייה c:\windows, נתיב מנהל הקבצים יהיה totalcmd.exe, והארגומנט לתיקייה יהיה /A "%d". מנהלי קבצים מסוימים, כגון QTTabBar, עשויים לדרוש רק ציון נתיב, במקרה כזה השתמש ב-"%d" כנתיב מנהל הקבצים והשאר את שאר השדות ריקים. מנהל קבצים @@ -377,6 +378,8 @@ נתיב מנהל קבצים ארגומנט לתיקייה ארגומנט לקובץ + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error דפדפן ברירת מחדל @@ -468,6 +471,14 @@ 1. העלה קובץ יומן: {0} 2. העתק את הודעת החריגה למטה + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + שגיאה + An error occurred while opening the folder. {0} + אנא המתן... diff --git a/Flow.Launcher/Languages/it.xaml b/Flow.Launcher/Languages/it.xaml index 1a356ad65..7ea797fa9 100644 --- a/Flow.Launcher/Languages/it.xaml +++ b/Flow.Launcher/Languages/it.xaml @@ -371,6 +371,7 @@ Seleziona Gestore File + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Gestore File @@ -378,6 +379,8 @@ Percorso Gestore File Arg Per Cartella Arg Per Cartella + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Browser predefinito @@ -469,6 +472,14 @@ Se si aggiunge un prefisso '@' mentre si inserisce una scorciatoia, corrisponde 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + Attendere prego... diff --git a/Flow.Launcher/Languages/ja.xaml b/Flow.Launcher/Languages/ja.xaml index 949fe5c99..33673d60f 100644 --- a/Flow.Launcher/Languages/ja.xaml +++ b/Flow.Launcher/Languages/ja.xaml @@ -371,6 +371,7 @@ デフォルトのファイルマネージャー + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. File Manager @@ -378,6 +379,8 @@ File Manager Path Arg For Folder Arg For File + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error デフォルトのウェブブラウザー @@ -469,6 +472,14 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + Please wait... diff --git a/Flow.Launcher/Languages/ko.xaml b/Flow.Launcher/Languages/ko.xaml index 9ae2e0195..9e8f9a73b 100644 --- a/Flow.Launcher/Languages/ko.xaml +++ b/Flow.Launcher/Languages/ko.xaml @@ -362,6 +362,7 @@ 파일관리자 선택 + Learn more 사용 중인 파일 관리자의 파일 위치를 지정하고, 필요한 경우 인수를 추가하세요. "%d"는 열고자 하는 디렉터리 경로를 나타내며, 폴더용 인수 필드 및 특정 디렉터리를 여는 명령어에서 사용됩니다. "%f"는 열고자 하는 파일 경로를 나타내며, 파일용 인수 필드 및 특정 파일을 여는 명령어에서 사용됩니다. 예를 들어, 파일 관리자가 totalcmd.exe /A c:\windows와 같은 명령어로 c:\windows 디렉터리를 연다면, 파일 관리자 경로는 totalcmd.exe가 되고, 폴더용 인수는 /A "%d"가 됩니다. QTTabBar와 같은 일부 파일 관리자는 경로만 전달하면 되는 경우가 있으므로, 이 경우에는 파일 관리자 경로에 "%d"를 입력하고 나머지 필드는 비워두세요. 파일관리자 @@ -369,6 +370,8 @@ 파일관리자 경로 폴더경로 인수 파일경로 인수 + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error 기본 웹 브라우저 @@ -460,6 +463,14 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + 잠시 기다려주세요... diff --git a/Flow.Launcher/Languages/nb.xaml b/Flow.Launcher/Languages/nb.xaml index 58571a1c4..8d5ac7a94 100644 --- a/Flow.Launcher/Languages/nb.xaml +++ b/Flow.Launcher/Languages/nb.xaml @@ -371,6 +371,7 @@ Velg filbehandler + Learn more Vennligst spesifiser filplasseringen til filbehandleren du bruker, og legg til argumenter etter behov. "%d" representerer katalogbanen som skal åpnes for, brukt av Arg for mappe-feltet og for kommandoer som åpner spesifikke kataloger. "%f" representerer filbanen som skal åpnes for, brukt av Arg for fil-feltet og for kommandoer som åpner spesifikke filer. For eksempel, hvis filbehandleren bruker en kommando som "totalcmd.exe /A c:windows" for å åpne c:windows-katalogen, vil filbehandlingsbanen bli totalcmd.exe, og Arg For Folder vil være /A "%d". Enkelte filbehandlere som QTTabBar kan bare kreve at en bane oppgis, i dette tilfellet bruker du "%d" som filbehandlingsbane og lar resten av feltene stå tomme. Filbehandler @@ -378,6 +379,8 @@ Filbehandler sti Arg for mappe Arg for fil + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Standard nettleser @@ -469,6 +472,14 @@ Hvis du legger til et @-prefiks mens du legger inn en snarvei, samsvarer det med 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Feil + An error occurred while opening the folder. {0} + Vennligst vent... diff --git a/Flow.Launcher/Languages/nl.xaml b/Flow.Launcher/Languages/nl.xaml index 70a58e322..0f6ad436d 100644 --- a/Flow.Launcher/Languages/nl.xaml +++ b/Flow.Launcher/Languages/nl.xaml @@ -371,6 +371,7 @@ Bestandsbeheerder selecteren + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Bestandsbeheerder @@ -378,6 +379,8 @@ Bestandsbeheerder pad Arg voor map Arg voor bestand + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Standaard webbrowser @@ -469,6 +472,14 @@ Als u een '@' voorvoegsel toevoegt tijdens het invoeren van een snelkoppeling, m 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + Please wait... diff --git a/Flow.Launcher/Languages/pl.xaml b/Flow.Launcher/Languages/pl.xaml index 081c8e90e..1397afa25 100644 --- a/Flow.Launcher/Languages/pl.xaml +++ b/Flow.Launcher/Languages/pl.xaml @@ -371,6 +371,7 @@ Kliknij "nie", jeśli jest już zainstalowany. Zostaniesz wtedy popros Wybierz menedżer plików + Learn more Proszę określić lokalizację pliku menedżera plików, którego używasz i dodać argumenty według potrzeb. Symbol "%d" reprezentuje ścieżkę katalogu do otwarcia, używaną w polu Arg dla Folderu oraz dla poleceń otwierających konkretne katalogi. Symbol "%f" reprezentuje ścieżkę pliku do otwarcia, używaną w polu Arg dla Pliku oraz dla poleceń otwierających konkretne pliki. Na przykład, jeśli menedżer plików używa polecenia takiego jak „totalcmd.exe /A c:\windows" do otwarcia katalogu c:\windows, Ścieżka Menedżera Plików będzie totalcmd.exe, a Argument dla Folderu będzie /A "%d". Niektóre menedżery plików, takie jak QTTabBar, mogą wymagać jedynie podania ścieżki; w takim przypadku użyj "%d" jako Ścieżki Menedżera Plików, a pozostałe pola pozostaw puste. Menadżer plików @@ -378,6 +379,8 @@ Kliknij "nie", jeśli jest już zainstalowany. Zostaniesz wtedy popros Ścieżka menedżera plików Arg dla folderu Arg dla pliku + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Domyślna przeglądarka @@ -469,6 +472,14 @@ Jeśli dodasz prefiks '@' podczas wprowadzania skrótu, będzie on pasował do d 1. Prześlij plik dziennika: {0} 2. Skopiuj poniższą wiadomość wyjątku + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Błąd + An error occurred while opening the folder. {0} + Proszę czekać... diff --git a/Flow.Launcher/Languages/pt-br.xaml b/Flow.Launcher/Languages/pt-br.xaml index bd74d1d5f..232134290 100644 --- a/Flow.Launcher/Languages/pt-br.xaml +++ b/Flow.Launcher/Languages/pt-br.xaml @@ -371,6 +371,7 @@ Selecione o Gerenciador de Arquivos + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Gerenciador de Arquivos @@ -378,6 +379,8 @@ Caminho do Gerenciador de Arquivos Arg para Pasta Arg para Arquivo + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Navegador da Web Padrão @@ -469,6 +472,14 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + Por favor, aguarde... diff --git a/Flow.Launcher/Languages/pt-pt.xaml b/Flow.Launcher/Languages/pt-pt.xaml index cf7312956..f98fdf64b 100644 --- a/Flow.Launcher/Languages/pt-pt.xaml +++ b/Flow.Launcher/Languages/pt-pt.xaml @@ -369,6 +369,7 @@ Selecione o gestor de ficheiros + Saber mais Por favor, especifique a localização do executável do seu gestor de ficheiros e adicione os argumentos necessários. "%d" representa o caminho do diretório a abrir, usado pelo argumento do campo Pasta e para comandos que abrem diretórios específicos. "%f" representa o caminho do ficheiro a abrir, usado pelo argumento do campo Ficheiro e para comandos que abrem ficheiros específicos. Por exemplo, se o gestor de ficheiros utilizar o comando "totalcmd.exe /A c:\windows" para abrir o diretório c:\windows , o caminho para o gestor de ficheiros será totalcmd. exe e os argumentos para a Pasta serão /A "%d". Alguns gestores de ficheiros, como QTTabBar podem apenas exigir que especifique o caminho. Para estes, deve utilizar "%d" como caminho para o gestor de ficheiros e deixar o resto dos campos em branco. Gestor de ficheiros @@ -376,6 +377,8 @@ Caminho do gestor de ficheiros Argumento para pasta Argumento para ficheiro + Não foi possível encontrar o gestor de ficheiros '{0}' em '{1}'. Deseja continuar? + Erro no caminho do gestor de ficheiros Navegador web padrão @@ -467,6 +470,14 @@ Se adicionar o prefixo '@' durante a introdução do atalho, será utilizada qua 1. Carregue o ficheiro de registos: {0} 2. Copie a mensagem abaixo + + Erro do gestor de ficheiros + + Não foi possível encontrar o gestor de ficheiros. Verifique a definição 'Gestor de ficheiros personalizado' em Definições -> Geral. + + Erro + Ocorreu um erro ao abrir a pasta: {0} + Por favor aguarde... diff --git a/Flow.Launcher/Languages/ru.xaml b/Flow.Launcher/Languages/ru.xaml index 69069c5ec..2a9b5c26b 100644 --- a/Flow.Launcher/Languages/ru.xaml +++ b/Flow.Launcher/Languages/ru.xaml @@ -371,6 +371,7 @@ Выбор менеджера файлов + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Файловый менеджер @@ -378,6 +379,8 @@ Путь к файловому менеджеру Аргумент для папки Аргумент для файла + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Браузер по умолчанию @@ -469,6 +472,14 @@ 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Ошибка + An error occurred while opening the folder. {0} + Пожалуйста, подождите... diff --git a/Flow.Launcher/Languages/sk.xaml b/Flow.Launcher/Languages/sk.xaml index 88ed1c9df..934b0747a 100644 --- a/Flow.Launcher/Languages/sk.xaml +++ b/Flow.Launcher/Languages/sk.xaml @@ -371,6 +371,7 @@ Vyberte správcu súborov + Viac informácií Zadajte umiestnenie súboru správcu súborov, ktorý používate, a podľa potreby pridajte argumenty. "%d" predstavuje cestu k priečinku, ktorý sa má otvoriť, používa sa v poli Arg pre priečinok a pri príkazoch na otvorenie konkrétnych priečinkov. "%f" predstavuje cestu k súboru, ktorá sa má otvoriť a používa sa v poli Arg pre súbor a pri príkazoch na otvorenie konkrétnych súborov. Napríklad, ak správca súborov používa príkaz ako "totalcmd.exe /A c:\windows" na otvorenie priečinka c:\windows, cesta správcu súborov bude totalcmd.exe a Arg pre priečinok bude /A "%d". Niektorí správcovia súborov, ako napríklad QTTabBar, môžu vyžadovať len zadanie cesty, v tomto prípade použite "%d" ako cestu správcu súborov a zvyšok súborov nechajte prázdny. Správca súborov @@ -378,6 +379,8 @@ Cesta k správcovi súborov Arg. pre priečinok Arg. pre súbor + Správca súborov '{0}' sa nenachádza na '{1}'. Chcete pokračovať? + Chyba v ceste k správcovi súborov Predvolený webový prehliadač @@ -445,7 +448,7 @@ Ak pri zadávaní skratky pred ňu pridáte "@", bude sa zhodovať s Zrušiť Resetovať Odstrániť - Aktualizovať + OK Áno Nie Pozadie @@ -469,6 +472,14 @@ Ak pri zadávaní skratky pred ňu pridáte "@", bude sa zhodovať s 1. Nahrajte súbor logu: {0} 2. Skopírujte nižšie uvedenú správu o výnimke + + Chyba správcu súborov + + Zadaný správca súborov sa nenašiel. Skontrolujte nastavenie vlastného správcu súborov v Nastavenia > Všeobecné. + + Chyba + Počas otvárania priečinka sa vyskytla chyba. {0} + Čakajte, prosím... diff --git a/Flow.Launcher/Languages/sr.xaml b/Flow.Launcher/Languages/sr.xaml index 4b3e3bc0c..0d2c04513 100644 --- a/Flow.Launcher/Languages/sr.xaml +++ b/Flow.Launcher/Languages/sr.xaml @@ -371,6 +371,7 @@ Select File Manager + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. File Manager @@ -378,6 +379,8 @@ File Manager Path Arg For Folder Arg For File + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Default Web Browser @@ -469,6 +472,14 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + Please wait... diff --git a/Flow.Launcher/Languages/tr.xaml b/Flow.Launcher/Languages/tr.xaml index 665694ace..ab9aa31e6 100644 --- a/Flow.Launcher/Languages/tr.xaml +++ b/Flow.Launcher/Languages/tr.xaml @@ -371,6 +371,7 @@ Dosya Yöneticisi Seçenekleri + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Dosya Yöneticisi @@ -378,6 +379,8 @@ Dosya Yöneticisi Yolu Klasör Açarken Dosya Açarken + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error İnternet Tarayıcı Seçenekleri @@ -467,6 +470,14 @@ 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + Lütfen bekleyin... diff --git a/Flow.Launcher/Languages/uk-UA.xaml b/Flow.Launcher/Languages/uk-UA.xaml index b3dc2cd16..f7cc7b0ed 100644 --- a/Flow.Launcher/Languages/uk-UA.xaml +++ b/Flow.Launcher/Languages/uk-UA.xaml @@ -371,6 +371,7 @@ Виберіть файловий менеджер + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Файловий менеджер @@ -378,6 +379,8 @@ Шлях до файлового менеджера Аргумент для папки Аргумент для файлу + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Веб-браузер за замовчуванням @@ -469,6 +472,14 @@ 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Помилка + An error occurred while opening the folder. {0} + Будь ласка, зачекайте... diff --git a/Flow.Launcher/Languages/vi.xaml b/Flow.Launcher/Languages/vi.xaml index b7b56213b..95e43e297 100644 --- a/Flow.Launcher/Languages/vi.xaml +++ b/Flow.Launcher/Languages/vi.xaml @@ -373,6 +373,7 @@ Chọn trình quản lý tệp + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. Trình quản lý ngày tháng @@ -380,6 +381,8 @@ Đường dẫn quản lý tệp Đối số cho thư mục Đối số cho tệp + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error Trình duyệt web tiêu chuẩn @@ -473,6 +476,14 @@ 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Lỗi + An error occurred while opening the folder. {0} + Cảnh báo nhỏ... diff --git a/Flow.Launcher/Languages/zh-cn.xaml b/Flow.Launcher/Languages/zh-cn.xaml index bd3142992..f6576070f 100644 --- a/Flow.Launcher/Languages/zh-cn.xaml +++ b/Flow.Launcher/Languages/zh-cn.xaml @@ -371,6 +371,7 @@ 默认文件管理器 + Learn more 请指定您使用的文件管理器的文件位置并根据需要添加参数。“%d”表示要打开的目录路径,由文件夹字段的参数和打开特定目录的命令使用。“%f”表示要打开的文件路径,由文件字段的参数和打开特定文件的命令使用。 例如,如果文件管理器使用诸如“totalcmd.exe /A c:\windows”之类的命令来打开 c:\windows 目录,则文件管理器路径将为 totalcmd.exe,文件夹参数将为 /A "%d"。某些文件管理器(如 QTTabBar)可能只需要提供路径,在本例中,使用“%d”作为文件管理器路径,其余字段留空。 文件管理器 @@ -378,6 +379,8 @@ 文件管理器路径 文件夹路径参数 选中文件路径参数 + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error 默认浏览器 @@ -469,6 +472,14 @@ 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + 错误 + An error occurred while opening the folder. {0} + 请稍等... diff --git a/Flow.Launcher/Languages/zh-tw.xaml b/Flow.Launcher/Languages/zh-tw.xaml index 1a71ae135..42810f590 100644 --- a/Flow.Launcher/Languages/zh-tw.xaml +++ b/Flow.Launcher/Languages/zh-tw.xaml @@ -371,6 +371,7 @@ 選擇檔案管理器 + Learn more Please specify the file location of the file manager you using and add arguments as required. The "%d" represents the directory path to open for, used by the Arg for Folder field and for commands opening specific directories. The "%f" represents the file path to open for, used by the Arg for File field and for commands opening specific files. For example, if the file manager uses a command such as "totalcmd.exe /A c:\windows" to open the c:\windows directory, the File Manager Path will be totalcmd.exe, and the Arg For Folder will be /A "%d". Certain file managers like QTTabBar may just require a path to be supplied, in this instance use "%d" as the File Manager Path and leave the rest of the fileds blank. 檔案管理器 @@ -378,6 +379,8 @@ 檔案管理器路徑 資料夾參數 檔案參數 + The file manager '{0}' could not be located at '{1}'. Would you like to continue? + File Manager Path Error 預設瀏覽器 @@ -469,6 +472,14 @@ If you add an '@' prefix while inputting a shortcut, it matches any position in 1. Upload log file: {0} 2. Copy below exception message + + File Manager Error + + The specified file manager could not be found. Please check the Custom File Manager setting under Settings > General. + + Error + An error occurred while opening the folder. {0} + 請稍後... diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.ja-JP.resx b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.ja-JP.resx index 2e2de0681..91be8a392 100644 --- a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.ja-JP.resx +++ b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Properties/Resources.ja-JP.resx @@ -456,7 +456,7 @@ Area Personalization - + The command to direct start a setting @@ -1117,7 +1117,7 @@ Area Control Panel (legacy settings) - + password.cpl @@ -1572,7 +1572,7 @@ Area Control Panel (legacy settings) - + Means The "Windows Version" From 90ad72ca30ca7e99e3e84c4cac4e507f91b47a4c Mon Sep 17 00:00:00 2001 From: 01Dri Date: Fri, 23 May 2025 16:33:47 -0300 Subject: [PATCH 35/56] Diff Time in Created At and LastModifiedAt --- .../Views/PreviewPanel.xaml.cs | 47 ++++++++++++++----- 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs index aaf1efdc1..1981a8b0e 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs @@ -1,4 +1,5 @@ -using System.ComponentModel; +using System; +using System.ComponentModel; using System.Globalization; using System.IO; using System.Runtime.CompilerServices; @@ -65,22 +66,22 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged if (Settings.ShowCreatedDateInPreviewPanel) { - CreatedAt = File - .GetCreationTime(filePath) - .ToString( - $"{Settings.PreviewPanelDateFormat} {Settings.PreviewPanelTimeFormat}", - CultureInfo.CurrentCulture - ); + DateTime createdDate = File.GetCreationTime(filePath); + string formattedDate = createdDate.ToString( + $"{Settings.PreviewPanelDateFormat} {Settings.PreviewPanelTimeFormat}", + CultureInfo.CurrentCulture + ); + CreatedAt = $"{GetDiffTimeString(createdDate)} - {formattedDate}"; } if (Settings.ShowModifiedDateInPreviewPanel) { - LastModifiedAt = File - .GetLastWriteTime(filePath) - .ToString( - $"{Settings.PreviewPanelDateFormat} {Settings.PreviewPanelTimeFormat}", - CultureInfo.CurrentCulture - ); + DateTime lastModifiedDate = File.GetLastWriteTime(filePath); + string formattedDate = lastModifiedDate.ToString( + $"{Settings.PreviewPanelDateFormat} {Settings.PreviewPanelTimeFormat}", + CultureInfo.CurrentCulture + ); + LastModifiedAt = $"{GetDiffTimeString(lastModifiedDate)} - {formattedDate}"; } _ = LoadImageAsync(); @@ -90,7 +91,27 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged { PreviewImage = await Main.Context.API.LoadImageAsync(FilePath, true).ConfigureAwait(false); } + + private string GetDiffTimeString(DateTime fileDateTime) + { + DateTime now = DateTime.Now; + TimeSpan difference = now - fileDateTime; + if (difference.TotalDays < 1) + return "Today"; + if (difference.TotalDays < 30) + return $"{(int)difference.TotalDays} days ago"; + + int monthsDiff = (now.Year - fileDateTime.Year) * 12 + now.Month - fileDateTime.Month; + if (monthsDiff < 12) + return monthsDiff == 1 ? "1 month ago" : $"{monthsDiff} months ago"; + + int yearsDiff = now.Year - fileDateTime.Year; + if (now.Month < fileDateTime.Month || (now.Month == fileDateTime.Month && now.Day < fileDateTime.Day)) + yearsDiff--; + + return yearsDiff == 1 ? "1 year ago" : $"{yearsDiff} years ago"; + } public event PropertyChangedEventHandler? PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) From 35e71c6f510256bdad0692919cdbfa1578d5ee87 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Sat, 24 May 2025 00:12:56 -0300 Subject: [PATCH 36/56] Relative Date checkbox --- .../Flow.Launcher.Plugin.Explorer/Languages/en.xaml | 3 +++ .../Languages/pt-br.xaml | 5 +++-- Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs | 3 +++ .../ViewModels/SettingsViewModel.cs | 12 ++++++++++++ .../Views/ExplorerSettings.xaml | 5 +++++ .../Views/PreviewPanel.xaml.cs | 11 ++++++++--- 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index 79f8a5848..6680aacff 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -33,6 +33,7 @@ Size Date Created Date Modified + Relative Date Display File Info Date and time format Sort Option: @@ -125,6 +126,8 @@ Use '>' to search in this directory, '*' to search for file extensions or '>*' to combine both searches. + + Failed to load Everything SDK diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml index 2754a5a99..59770a29d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml @@ -29,8 +29,9 @@ Everything Setting Preview Panel Tamanho - Date Created - Date Modified + Data Criação + Data Modificação + Data Relativa Display File Info Date and time format Sort Option: diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 3d30bcf29..0a91c024c 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -66,6 +66,9 @@ namespace Flow.Launcher.Plugin.Explorer public bool ShowCreatedDateInPreviewPanel { get; set; } = true; public bool ShowModifiedDateInPreviewPanel { get; set; } = true; + + public bool ShowRelativeDateInPreviewPanel { get; set; } = true; + public string PreviewPanelDateFormat { get; set; } = "yyyy-MM-dd"; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index cf9ebd33f..baa2c6c28 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -169,6 +169,18 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels } } + public bool ShowRelativeDateInPreviewPanel + { + get => Settings.ShowRelativeDateInPreviewPanel; + set + { + Settings.ShowRelativeDateInPreviewPanel = value; + OnPropertyChanged(); + OnPropertyChanged(nameof(ShowPreviewPanelDateTimeChoices)); + OnPropertyChanged(nameof(PreviewPanelDateTimeChoicesVisibility)); + } + } + public string PreviewPanelDateFormat { get => Settings.PreviewPanelDateFormat; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml index e5999da41..c16dc4f51 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml @@ -505,6 +505,11 @@ Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}" Content="{DynamicResource plugin_explorer_previewpanel_display_file_modification_checkbox}" IsChecked="{Binding ShowModifiedDateInPreviewPanel}" /> + + diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs index 1981a8b0e..aa5ba6cc7 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs @@ -71,7 +71,10 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged $"{Settings.PreviewPanelDateFormat} {Settings.PreviewPanelTimeFormat}", CultureInfo.CurrentCulture ); - CreatedAt = $"{GetDiffTimeString(createdDate)} - {formattedDate}"; + + string result = formattedDate; + if (Settings.ShowRelativeDateInPreviewPanel) result = $"{GetFileAge(createdDate)} - {formattedDate}"; + CreatedAt = result; } if (Settings.ShowModifiedDateInPreviewPanel) @@ -81,7 +84,9 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged $"{Settings.PreviewPanelDateFormat} {Settings.PreviewPanelTimeFormat}", CultureInfo.CurrentCulture ); - LastModifiedAt = $"{GetDiffTimeString(lastModifiedDate)} - {formattedDate}"; + string result = formattedDate; + if (Settings.ShowRelativeDateInPreviewPanel) result = $"{GetFileAge(lastModifiedDate)} - {formattedDate}"; + LastModifiedAt = result; } _ = LoadImageAsync(); @@ -92,7 +97,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged PreviewImage = await Main.Context.API.LoadImageAsync(FilePath, true).ConfigureAwait(false); } - private string GetDiffTimeString(DateTime fileDateTime) + private string GetFileAge(DateTime fileDateTime) { DateTime now = DateTime.Now; TimeSpan difference = now - fileDateTime; From 02ddcaa0642a123ee1ac7caf747783651d4fc2f5 Mon Sep 17 00:00:00 2001 From: 01Dri Date: Sat, 24 May 2025 00:15:08 -0300 Subject: [PATCH 37/56] Function name changed to GetRelativeDate --- .../Views/PreviewPanel.xaml.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs index aa5ba6cc7..05dfd66f3 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs @@ -73,7 +73,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged ); string result = formattedDate; - if (Settings.ShowRelativeDateInPreviewPanel) result = $"{GetFileAge(createdDate)} - {formattedDate}"; + if (Settings.ShowRelativeDateInPreviewPanel) result = $"{GetRelativeDate(createdDate)} - {formattedDate}"; CreatedAt = result; } @@ -85,7 +85,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged CultureInfo.CurrentCulture ); string result = formattedDate; - if (Settings.ShowRelativeDateInPreviewPanel) result = $"{GetFileAge(lastModifiedDate)} - {formattedDate}"; + if (Settings.ShowRelativeDateInPreviewPanel) result = $"{GetRelativeDate(lastModifiedDate)} - {formattedDate}"; LastModifiedAt = result; } @@ -97,7 +97,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged PreviewImage = await Main.Context.API.LoadImageAsync(FilePath, true).ConfigureAwait(false); } - private string GetFileAge(DateTime fileDateTime) + private string GetRelativeDate(DateTime fileDateTime) { DateTime now = DateTime.Now; TimeSpan difference = now - fileDateTime; From a711ce4ec793158c6586ec70e5e0cd913c77319b Mon Sep 17 00:00:00 2001 From: 01Dri Date: Sat, 24 May 2025 01:10:12 -0300 Subject: [PATCH 38/56] Translate pt br --- Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml index 59770a29d..3ab958506 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml @@ -29,8 +29,8 @@ Everything Setting Preview Panel Tamanho - Data Criação - Data Modificação + Data de Criação + Data de Modificação Data Relativa Display File Info Date and time format From f6103b1105d9c741c87ed0f954622c271a87620a Mon Sep 17 00:00:00 2001 From: 01Dri Date: Sat, 24 May 2025 03:16:03 -0300 Subject: [PATCH 39/56] Relative Date -> File Age --- Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml | 2 +- Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml | 2 +- Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs | 2 +- .../ViewModels/SettingsViewModel.cs | 6 +++--- .../Views/ExplorerSettings.xaml | 4 ++-- .../Views/PreviewPanel.xaml.cs | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index 6680aacff..aa86d96cf 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -33,7 +33,7 @@ Size Date Created Date Modified - Relative Date + File Age Display File Info Date and time format Sort Option: diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml index 3ab958506..ca7d9b48e 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml @@ -31,7 +31,7 @@ Tamanho Data de Criação Data de Modificação - Data Relativa + Idade do Arquivo Display File Info Date and time format Sort Option: diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 0a91c024c..158cf0347 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -67,7 +67,7 @@ namespace Flow.Launcher.Plugin.Explorer public bool ShowModifiedDateInPreviewPanel { get; set; } = true; - public bool ShowRelativeDateInPreviewPanel { get; set; } = true; + public bool ShowFileAgeInPreviewPanel { get; set; } = true; public string PreviewPanelDateFormat { get; set; } = "yyyy-MM-dd"; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index baa2c6c28..fb33dacab 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -169,12 +169,12 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels } } - public bool ShowRelativeDateInPreviewPanel + public bool ShowFileAgeInPreviewPanel { - get => Settings.ShowRelativeDateInPreviewPanel; + get => Settings.ShowFileAgeInPreviewPanel; set { - Settings.ShowRelativeDateInPreviewPanel = value; + Settings.ShowFileAgeInPreviewPanel = value; OnPropertyChanged(); OnPropertyChanged(nameof(ShowPreviewPanelDateTimeChoices)); OnPropertyChanged(nameof(PreviewPanelDateTimeChoicesVisibility)); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml index c16dc4f51..4302e721a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml @@ -508,8 +508,8 @@ + Content="{DynamicResource plugin_explorer_previewpanel_display_file_age_checkbox}" + IsChecked="{Binding ShowFileAgeInPreviewPanel}" /> diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs index 05dfd66f3..801510eb7 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs @@ -73,7 +73,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged ); string result = formattedDate; - if (Settings.ShowRelativeDateInPreviewPanel) result = $"{GetRelativeDate(createdDate)} - {formattedDate}"; + if (Settings.ShowFileAgeInPreviewPanel) result = $"{GetRelativeDate(createdDate)} - {formattedDate}"; CreatedAt = result; } @@ -85,7 +85,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged CultureInfo.CurrentCulture ); string result = formattedDate; - if (Settings.ShowRelativeDateInPreviewPanel) result = $"{GetRelativeDate(lastModifiedDate)} - {formattedDate}"; + if (Settings.ShowFileAgeInPreviewPanel) result = $"{GetRelativeDate(lastModifiedDate)} - {formattedDate}"; LastModifiedAt = result; } From d726455b047c380179243ff85ee132e7d601ba0c Mon Sep 17 00:00:00 2001 From: 01Dri Date: Sat, 24 May 2025 03:16:51 -0300 Subject: [PATCH 40/56] Relative Date - FileAge --- .../Views/PreviewPanel.xaml.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs index 801510eb7..28ceb5e96 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs @@ -73,7 +73,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged ); string result = formattedDate; - if (Settings.ShowFileAgeInPreviewPanel) result = $"{GetRelativeDate(createdDate)} - {formattedDate}"; + if (Settings.ShowFileAgeInPreviewPanel) result = $"{GetFileAge(createdDate)} - {formattedDate}"; CreatedAt = result; } @@ -85,7 +85,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged CultureInfo.CurrentCulture ); string result = formattedDate; - if (Settings.ShowFileAgeInPreviewPanel) result = $"{GetRelativeDate(lastModifiedDate)} - {formattedDate}"; + if (Settings.ShowFileAgeInPreviewPanel) result = $"{GetFileAge(lastModifiedDate)} - {formattedDate}"; LastModifiedAt = result; } @@ -97,7 +97,7 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged PreviewImage = await Main.Context.API.LoadImageAsync(FilePath, true).ConfigureAwait(false); } - private string GetRelativeDate(DateTime fileDateTime) + private string GetFileAge(DateTime fileDateTime) { DateTime now = DateTime.Now; TimeSpan difference = now - fileDateTime; From 2ff0fc8a7d8de2306229f8439b530932974f4519 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 24 May 2025 15:28:51 +0900 Subject: [PATCH 41/56] Disable ShowFileAgeInPreviewPanel by default --- Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 158cf0347..49ad2d358 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -67,7 +67,7 @@ namespace Flow.Launcher.Plugin.Explorer public bool ShowModifiedDateInPreviewPanel { get; set; } = true; - public bool ShowFileAgeInPreviewPanel { get; set; } = true; + public bool ShowFileAgeInPreviewPanel { get; set; } = false; public string PreviewPanelDateFormat { get; set; } = "yyyy-MM-dd"; From 03d3c9292dcfc3814a890b9e0806e975f3abff59 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 24 May 2025 15:55:37 +0800 Subject: [PATCH 42/56] Fix blnak lie --- Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml | 2 -- Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs | 1 - 2 files changed, 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index aa86d96cf..ca994455a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -126,8 +126,6 @@ Use '>' to search in this directory, '*' to search for file extensions or '>*' to combine both searches. - - Failed to load Everything SDK diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 49ad2d358..4f83fc72e 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -27,7 +27,6 @@ namespace Flow.Launcher.Plugin.Explorer public string ExcludedFileTypes { get; set; } = ""; - public bool UseLocationAsWorkingDir { get; set; } = false; public bool ShowInlinedWindowsContextMenu { get; set; } = false; From 65e0a0220b07bf58ff6ffed2a796ea1094a66b5c Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 24 May 2025 15:56:02 +0800 Subject: [PATCH 43/56] Revert changes in pt-br.xaml --- Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml index ca7d9b48e..2754a5a99 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/pt-br.xaml @@ -29,9 +29,8 @@ Everything Setting Preview Panel Tamanho - Data de Criação - Data de Modificação - Idade do Arquivo + Date Created + Date Modified Display File Info Date and time format Sort Option: From 0f718e5d920bab13a285f42b4fb9ac83c759a9af Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 24 May 2025 15:59:24 +0800 Subject: [PATCH 44/56] Code quality --- .../Views/PreviewPanel.xaml.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs index 28ceb5e96..eabe1ad41 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs @@ -97,26 +97,27 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged PreviewImage = await Main.Context.API.LoadImageAsync(FilePath, true).ConfigureAwait(false); } - private string GetFileAge(DateTime fileDateTime) + private static string GetFileAge(DateTime fileDateTime) { - DateTime now = DateTime.Now; - TimeSpan difference = now - fileDateTime; + var now = DateTime.Now; + var difference = now - fileDateTime; if (difference.TotalDays < 1) return "Today"; if (difference.TotalDays < 30) return $"{(int)difference.TotalDays} days ago"; - int monthsDiff = (now.Year - fileDateTime.Year) * 12 + now.Month - fileDateTime.Month; + var monthsDiff = (now.Year - fileDateTime.Year) * 12 + now.Month - fileDateTime.Month; if (monthsDiff < 12) return monthsDiff == 1 ? "1 month ago" : $"{monthsDiff} months ago"; - int yearsDiff = now.Year - fileDateTime.Year; + var yearsDiff = now.Year - fileDateTime.Year; if (now.Month < fileDateTime.Month || (now.Month == fileDateTime.Month && now.Day < fileDateTime.Day)) yearsDiff--; return yearsDiff == 1 ? "1 year ago" : $"{yearsDiff} years ago"; } + public event PropertyChangedEventHandler? PropertyChanged; protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null) From 62d7256db43d03eb56084fe82e21641ef8fa1ceb Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 24 May 2025 16:07:15 +0800 Subject: [PATCH 45/56] Support transaltion for preview information --- .../Flow.Launcher.Plugin.Explorer/Languages/en.xaml | 8 ++++++++ .../Views/PreviewPanel.xaml.cs | 11 +++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index ca994455a..eefd6f4eb 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -167,4 +167,12 @@ Display native context menu (experimental) Below you can specify items you want to include in the context menu, they can be partial (e.g. 'pen wit') or complete ('Open with'). Below you can specify items you want to exclude from context menu, they can be partial (e.g. 'pen wit') or complete ('Open with'). + + + Today + {0} days ago + 1 month ago + {0} months ago + 1 year ago + {0} years ago diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs index eabe1ad41..e1a957199 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/PreviewPanel.xaml.cs @@ -103,19 +103,22 @@ public partial class PreviewPanel : UserControl, INotifyPropertyChanged var difference = now - fileDateTime; if (difference.TotalDays < 1) - return "Today"; + return Main.Context.API.GetTranslation("Today"); if (difference.TotalDays < 30) - return $"{(int)difference.TotalDays} days ago"; + return string.Format(Main.Context.API.GetTranslation("DaysAgo"), (int)difference.TotalDays); var monthsDiff = (now.Year - fileDateTime.Year) * 12 + now.Month - fileDateTime.Month; + if (monthsDiff == 1) + return Main.Context.API.GetTranslation("OneMonthAgo"); if (monthsDiff < 12) - return monthsDiff == 1 ? "1 month ago" : $"{monthsDiff} months ago"; + return string.Format(Main.Context.API.GetTranslation("MonthsAgo"), monthsDiff); var yearsDiff = now.Year - fileDateTime.Year; if (now.Month < fileDateTime.Month || (now.Month == fileDateTime.Month && now.Day < fileDateTime.Day)) yearsDiff--; - return yearsDiff == 1 ? "1 year ago" : $"{yearsDiff} years ago"; + return yearsDiff == 1 ? Main.Context.API.GetTranslation("OneYearAgo") : + string.Format(Main.Context.API.GetTranslation("YearsAgo"), yearsDiff); } public event PropertyChangedEventHandler? PropertyChanged; From 47878f3829a9cb10f87d5429d07fad097efec3dd Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 27 May 2025 14:08:32 +0900 Subject: [PATCH 46/56] Fix file explorer invocation to ensure correct file selection behavior --- Flow.Launcher/PublicAPIInstance.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 66e11f881..93567288c 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -338,7 +338,10 @@ namespace Flow.Launcher // Windows File Manager explorer.StartInfo = new ProcessStartInfo { - FileName = targetPath, + FileName = "explorer.exe", + Arguments = FileNameOrFilePath is null + ? DirectoryPath // only open the directory + : $"/select,\"{targetPath}\"", // open the directory and select the file UseShellExecute = true }; } From 41c5b36fba5aa1a627c153db7fa9f7ffc525dd4b Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 27 May 2025 15:20:41 +0900 Subject: [PATCH 47/56] Enhance OpenDirectory method to support folder opening and file selection using SHOpenFolderAndSelectItems --- Flow.Launcher/PublicAPIInstance.cs | 99 +++++++++++++++++++++++------- 1 file changed, 76 insertions(+), 23 deletions(-) diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 93567288c..58dbd3ff0 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Net; using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -320,47 +321,98 @@ namespace Flow.Launcher ((PluginJsonStorage)_pluginJsonStorages[type]).Save(); } - public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null) + [DllImport("shell32.dll", CharSet = CharSet.Unicode)] + private static extern int SHParseDisplayName( + [MarshalAs(UnmanagedType.LPWStr)] string name, + IntPtr bindingContext, + out IntPtr pidl, + uint sfgaoIn, + out uint psfgaoOut + ); + + [DllImport("shell32.dll")] + private static extern int SHOpenFolderAndSelectItems( + IntPtr pidlFolder, + uint cidl, + [MarshalAs(UnmanagedType.LPArray)] IntPtr[] apidl, + uint dwFlags + ); + + [DllImport("ole32.dll")] + private static extern void CoTaskMemFree(IntPtr pv); + + private void OpenFolderAndSelectItem(string filePath) + { + IntPtr pidlFolder = IntPtr.Zero; + IntPtr pidlFile = IntPtr.Zero; + uint attr; + + string folderPath = Path.GetDirectoryName(filePath); + + try + { + SHParseDisplayName(folderPath, IntPtr.Zero, out pidlFolder, 0, out attr); + SHParseDisplayName(filePath, IntPtr.Zero, out pidlFile, 0, out attr); + + if (pidlFolder != IntPtr.Zero && pidlFile != IntPtr.Zero) + { + SHOpenFolderAndSelectItems(pidlFolder, 1, new[] { pidlFile }, 0); + } + } + finally + { + if (pidlFile != IntPtr.Zero) + CoTaskMemFree(pidlFile); + if (pidlFolder != IntPtr.Zero) + CoTaskMemFree(pidlFolder); + } + } + + public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null) { try { - using var explorer = new Process(); + string targetPath = fileNameOrFilePath is null + ? directoryPath + : Path.IsPathRooted(fileNameOrFilePath) + ? fileNameOrFilePath + : Path.Combine(directoryPath, fileNameOrFilePath); + var explorerInfo = _settings.CustomExplorer; var explorerPath = explorerInfo.Path.Trim().ToLowerInvariant(); - var targetPath = FileNameOrFilePath is null - ? DirectoryPath - : Path.IsPathRooted(FileNameOrFilePath) - ? FileNameOrFilePath - : Path.Combine(DirectoryPath, FileNameOrFilePath); if (Path.GetFileNameWithoutExtension(explorerPath) == "explorer") { - // Windows File Manager - explorer.StartInfo = new ProcessStartInfo + if (fileNameOrFilePath is null) { - FileName = "explorer.exe", - Arguments = FileNameOrFilePath is null - ? DirectoryPath // only open the directory - : $"/select,\"{targetPath}\"", // open the directory and select the file - UseShellExecute = true - }; + // 폴더만 열기 + Process.Start(new ProcessStartInfo + { + FileName = directoryPath, + UseShellExecute = true + })?.Dispose(); + } + else + { + // SHOpenFolderAndSelectItems 방식 + OpenFolderAndSelectItem(targetPath); + } } else { - // Custom File Manager - explorer.StartInfo = new ProcessStartInfo + // 커스텀 파일 관리자 + var shellProcess = new ProcessStartInfo { - FileName = explorerInfo.Path.Replace("%d", DirectoryPath), + FileName = explorerInfo.Path.Replace("%d", directoryPath), UseShellExecute = true, - Arguments = FileNameOrFilePath is null - ? explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) + Arguments = fileNameOrFilePath is null + ? explorerInfo.DirectoryArgument.Replace("%d", directoryPath) : explorerInfo.FileArgument - .Replace("%d", DirectoryPath) + .Replace("%d", directoryPath) .Replace("%f", targetPath) }; + Process.Start(shellProcess)?.Dispose(); } - - explorer.Start(); } catch (Win32Exception ex) when (ex.NativeErrorCode == 2) { @@ -384,6 +436,7 @@ namespace Flow.Launcher } } + private void OpenUri(Uri uri, bool? inPrivate = null) { if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) From 086aeab6c05f4b2ab13e6d0a8239db7d83c588b1 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 27 May 2025 14:36:09 +0800 Subject: [PATCH 48/56] Use PInvoke to improve code quality --- .../NativeMethods.txt | 4 + Flow.Launcher.Infrastructure/Win32Helper.cs | 31 ++++++++ Flow.Launcher/PublicAPIInstance.cs | 76 ++++--------------- 3 files changed, 50 insertions(+), 61 deletions(-) diff --git a/Flow.Launcher.Infrastructure/NativeMethods.txt b/Flow.Launcher.Infrastructure/NativeMethods.txt index 0e50420b0..2591506c8 100644 --- a/Flow.Launcher.Infrastructure/NativeMethods.txt +++ b/Flow.Launcher.Infrastructure/NativeMethods.txt @@ -57,3 +57,7 @@ LOCALE_TRANSIENT_KEYBOARD1 LOCALE_TRANSIENT_KEYBOARD2 LOCALE_TRANSIENT_KEYBOARD3 LOCALE_TRANSIENT_KEYBOARD4 + +SHParseDisplayName +SHOpenFolderAndSelectItems +CoTaskMemFree diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 783ade14e..4952eec98 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; +using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Threading; @@ -17,6 +18,7 @@ using Windows.Win32; using Windows.Win32.Foundation; using Windows.Win32.Graphics.Dwm; using Windows.Win32.UI.Input.KeyboardAndMouse; +using Windows.Win32.UI.Shell.Common; using Windows.Win32.UI.WindowsAndMessaging; using Point = System.Windows.Point; using SystemFonts = System.Windows.SystemFonts; @@ -753,5 +755,34 @@ namespace Flow.Launcher.Infrastructure } #endregion + + #region Explorer + + public static unsafe void OpenFolderAndSelectFile(string filePath) + { + ITEMIDLIST* pidlFolder = null; + ITEMIDLIST* pidlFile = null; + + var folderPath = Path.GetDirectoryName(filePath); + + try + { + var hrFolder = PInvoke.SHParseDisplayName(folderPath, null, out pidlFolder, 0, null); + if (hrFolder.Failed) throw new COMException("Failed to parse folder path", hrFolder); + + var hrFile = PInvoke.SHParseDisplayName(filePath, null, out pidlFile, 0, null); + if (hrFile.Failed) throw new COMException("Failed to parse file path", hrFile); + + var hrSelect = PInvoke.SHOpenFolderAndSelectItems(pidlFolder, 1, &pidlFile, 0); + if (hrSelect.Failed) throw new COMException("Failed to open folder and select item", hrSelect); + } + finally + { + if (pidlFile != null) PInvoke.CoTaskMemFree(pidlFile); + if (pidlFolder != null) PInvoke.CoTaskMemFree(pidlFolder); + } + } + + #endregion } } diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs index 58dbd3ff0..c06c56039 100644 --- a/Flow.Launcher/PublicAPIInstance.cs +++ b/Flow.Launcher/PublicAPIInstance.cs @@ -8,11 +8,9 @@ using System.IO; using System.Linq; using System.Net; using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; using System.Threading; using System.Threading.Tasks; using System.Windows; -using System.Windows.Input; using System.Windows.Media; using CommunityToolkit.Mvvm.DependencyInjection; using Flow.Launcher.Core; @@ -320,88 +318,44 @@ namespace Flow.Launcher ((PluginJsonStorage)_pluginJsonStorages[type]).Save(); } - - [DllImport("shell32.dll", CharSet = CharSet.Unicode)] - private static extern int SHParseDisplayName( - [MarshalAs(UnmanagedType.LPWStr)] string name, - IntPtr bindingContext, - out IntPtr pidl, - uint sfgaoIn, - out uint psfgaoOut - ); - - [DllImport("shell32.dll")] - private static extern int SHOpenFolderAndSelectItems( - IntPtr pidlFolder, - uint cidl, - [MarshalAs(UnmanagedType.LPArray)] IntPtr[] apidl, - uint dwFlags - ); - - [DllImport("ole32.dll")] - private static extern void CoTaskMemFree(IntPtr pv); - - private void OpenFolderAndSelectItem(string filePath) - { - IntPtr pidlFolder = IntPtr.Zero; - IntPtr pidlFile = IntPtr.Zero; - uint attr; - - string folderPath = Path.GetDirectoryName(filePath); - - try - { - SHParseDisplayName(folderPath, IntPtr.Zero, out pidlFolder, 0, out attr); - SHParseDisplayName(filePath, IntPtr.Zero, out pidlFile, 0, out attr); - - if (pidlFolder != IntPtr.Zero && pidlFile != IntPtr.Zero) - { - SHOpenFolderAndSelectItems(pidlFolder, 1, new[] { pidlFile }, 0); - } - } - finally - { - if (pidlFile != IntPtr.Zero) - CoTaskMemFree(pidlFile); - if (pidlFolder != IntPtr.Zero) - CoTaskMemFree(pidlFolder); - } - } public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null) { try { - string targetPath = fileNameOrFilePath is null + var explorerInfo = _settings.CustomExplorer; + var explorerPath = explorerInfo.Path.Trim().ToLowerInvariant(); + var targetPath = fileNameOrFilePath is null ? directoryPath : Path.IsPathRooted(fileNameOrFilePath) ? fileNameOrFilePath : Path.Combine(directoryPath, fileNameOrFilePath); - var explorerInfo = _settings.CustomExplorer; - var explorerPath = explorerInfo.Path.Trim().ToLowerInvariant(); - if (Path.GetFileNameWithoutExtension(explorerPath) == "explorer") { + // Windows File Manager if (fileNameOrFilePath is null) { - // 폴더만 열기 - Process.Start(new ProcessStartInfo + // Only Open the directory + using var explorer = new Process(); + explorer.StartInfo = new ProcessStartInfo { FileName = directoryPath, UseShellExecute = true - })?.Dispose(); + }; + explorer.Start(); } else { - // SHOpenFolderAndSelectItems 방식 - OpenFolderAndSelectItem(targetPath); + // Open the directory and select the file + Win32Helper.OpenFolderAndSelectFile(targetPath); } } else { - // 커스텀 파일 관리자 - var shellProcess = new ProcessStartInfo + // Custom File Manager + using var explorer = new Process(); + explorer.StartInfo = new ProcessStartInfo { FileName = explorerInfo.Path.Replace("%d", directoryPath), UseShellExecute = true, @@ -411,7 +365,7 @@ namespace Flow.Launcher .Replace("%d", directoryPath) .Replace("%f", targetPath) }; - Process.Start(shellProcess)?.Dispose(); + explorer.Start(); } } catch (Win32Exception ex) when (ex.NativeErrorCode == 2) From eb69ce919e65b7b35fe48722f7a7ba8e9aa49096 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Tue, 27 May 2025 14:36:24 +0800 Subject: [PATCH 49/56] Add url comments --- Flow.Launcher.Infrastructure/Win32Helper.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 4952eec98..96d8e925b 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -758,6 +758,8 @@ namespace Flow.Launcher.Infrastructure #region Explorer + // https://learn.microsoft.com/en-us/windows/win32/api/shlobj_core/nf-shlobj_core-shopenfolderandselectitems + public static unsafe void OpenFolderAndSelectFile(string filePath) { ITEMIDLIST* pidlFolder = null; From c33e9dedb85b8e11fdda534edef07875cd765879 Mon Sep 17 00:00:00 2001 From: DB P Date: Fri, 30 May 2025 13:20:16 +0900 Subject: [PATCH 50/56] Update delete confirmation message for folder link in context menu --- Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index eabd118fb..db0128b3b 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -199,7 +199,7 @@ namespace Flow.Launcher.Plugin.Explorer { if (Context.API.ShowMsgBox( string.Format(Context.API.GetTranslation("plugin_explorer_delete_folder_link"), record.FullPath), - string.Empty, + Context.API.GetTranslation("plugin_explorer_deletefilefolder"), MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No) From ebb74da8b39b92c7621d201a687bc3e5efd40928 Mon Sep 17 00:00:00 2001 From: DB P Date: Fri, 30 May 2025 13:37:50 +0900 Subject: [PATCH 51/56] Refactor key press handling in MessageBoxEx to improve result assignment logic --- Flow.Launcher/MessageBoxEx.xaml.cs | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/MessageBoxEx.xaml.cs b/Flow.Launcher/MessageBoxEx.xaml.cs index c084b5149..510d14b89 100644 --- a/Flow.Launcher/MessageBoxEx.xaml.cs +++ b/Flow.Launcher/MessageBoxEx.xaml.cs @@ -159,12 +159,19 @@ namespace Flow.Launcher private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e) { - if (_button == MessageBoxButton.YesNo) - return; - else if (_button == MessageBoxButton.OK) - _result = MessageBoxResult.OK; - else - _result = MessageBoxResult.Cancel; + switch (_button) + { + case MessageBoxButton.OK: + _result = MessageBoxResult.None; + break; + case MessageBoxButton.OKCancel: + case MessageBoxButton.YesNoCancel: + _result = MessageBoxResult.Cancel; + break; + case MessageBoxButton.YesNo: + _result = MessageBoxResult.No; + break; + } DialogResult = false; Close(); } From 05486eae260622b35cb76b8dc421130144c057b6 Mon Sep 17 00:00:00 2001 From: DB P Date: Fri, 30 May 2025 14:45:19 +0900 Subject: [PATCH 52/56] Add OpenHistory hotkey functionality and binding --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 4 +++- Flow.Launcher/HotkeyControl.xaml.cs | 5 +++++ Flow.Launcher/MainWindow.xaml | 8 ++++---- Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml | 5 ++++- Flow.Launcher/ViewModel/MainViewModel.cs | 4 ++++ 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index f00f42ac0..892045994 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -50,6 +50,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public string SelectPrevPageHotkey { get; set; } = $"PageDown"; public string OpenContextMenuHotkey { get; set; } = $"Ctrl+O"; public string SettingWindowHotkey { get; set; } = $"Ctrl+I"; + public string OpenHistoryHotkey { get; set; } = $"Ctrl+H"; public string CycleHistoryUpHotkey { get; set; } = $"{KeyConstant.Alt} + Up"; public string CycleHistoryDownHotkey { get; set; } = $"{KeyConstant.Alt} + Down"; @@ -426,6 +427,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings list.Add(new(SelectPrevItemHotkey2, "SelectPrevItemHotkey", () => SelectPrevItemHotkey2 = "")); if (!string.IsNullOrEmpty(SettingWindowHotkey)) list.Add(new(SettingWindowHotkey, "SettingWindowHotkey", () => SettingWindowHotkey = "")); + if (!string.IsNullOrEmpty(OpenHistoryHotkey)) + list.Add(new(OpenHistoryHotkey, "OpenHistoryHotkey", () => OpenHistoryHotkey = "")); if (!string.IsNullOrEmpty(OpenContextMenuHotkey)) list.Add(new(OpenContextMenuHotkey, "OpenContextMenuHotkey", () => OpenContextMenuHotkey = "")); if (!string.IsNullOrEmpty(SelectNextPageHotkey)) @@ -461,7 +464,6 @@ namespace Flow.Launcher.Infrastructure.UserSettings new("Alt+Home", "HotkeySelectFirstResult"), new("Alt+End", "HotkeySelectLastResult"), new("Ctrl+R", "HotkeyRequery"), - new("Ctrl+H", "ToggleHistoryHotkey"), new("Ctrl+OemCloseBrackets", "QuickWidthHotkey"), new("Ctrl+OemOpenBrackets", "QuickWidthHotkey"), new("Ctrl+OemPlus", "QuickHeightHotkey"), diff --git a/Flow.Launcher/HotkeyControl.xaml.cs b/Flow.Launcher/HotkeyControl.xaml.cs index 262727127..e8961058c 100644 --- a/Flow.Launcher/HotkeyControl.xaml.cs +++ b/Flow.Launcher/HotkeyControl.xaml.cs @@ -100,6 +100,7 @@ namespace Flow.Launcher PreviewHotkey, OpenContextMenuHotkey, SettingWindowHotkey, + OpenHistoryHotkey, CycleHistoryUpHotkey, CycleHistoryDownHotkey, SelectPrevPageHotkey, @@ -130,6 +131,7 @@ namespace Flow.Launcher HotkeyType.PreviewHotkey => _settings.PreviewHotkey, HotkeyType.OpenContextMenuHotkey => _settings.OpenContextMenuHotkey, HotkeyType.SettingWindowHotkey => _settings.SettingWindowHotkey, + HotkeyType.OpenHistoryHotkey => _settings.OpenHistoryHotkey, HotkeyType.CycleHistoryUpHotkey => _settings.CycleHistoryUpHotkey, HotkeyType.CycleHistoryDownHotkey => _settings.CycleHistoryDownHotkey, HotkeyType.SelectPrevPageHotkey => _settings.SelectPrevPageHotkey, @@ -166,6 +168,9 @@ namespace Flow.Launcher case HotkeyType.SettingWindowHotkey: _settings.SettingWindowHotkey = value; break; + case HotkeyType.OpenHistoryHotkey: + _settings.OpenHistoryHotkey = value; + break; case HotkeyType.CycleHistoryUpHotkey: _settings.CycleHistoryUpHotkey = value; break; diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 31bc2ba50..413315faf 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -64,10 +64,6 @@ Key="R" Command="{Binding ReQueryCommand}" Modifiers="Ctrl" /> - + - + VerifyOrSetDefaultHotkey(Settings.SelectPrevPageHotkey, ""); public string OpenContextMenuHotkey => VerifyOrSetDefaultHotkey(Settings.OpenContextMenuHotkey, "Ctrl+O"); public string SettingWindowHotkey => VerifyOrSetDefaultHotkey(Settings.SettingWindowHotkey, "Ctrl+I"); + public string OpenHistoryHotkey => VerifyOrSetDefaultHotkey(Settings.OpenHistoryHotkey, "Ctrl+H"); public string CycleHistoryUpHotkey => VerifyOrSetDefaultHotkey(Settings.CycleHistoryUpHotkey, "Alt+Up"); public string CycleHistoryDownHotkey => VerifyOrSetDefaultHotkey(Settings.CycleHistoryDownHotkey, "Alt+Down"); From e6eb8c01c05672e4908e04be52649b6c027314f1 Mon Sep 17 00:00:00 2001 From: DB P Date: Fri, 30 May 2025 14:48:25 +0900 Subject: [PATCH 53/56] Revert key press handling --- Flow.Launcher/MessageBoxEx.xaml.cs | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher/MessageBoxEx.xaml.cs b/Flow.Launcher/MessageBoxEx.xaml.cs index 510d14b89..c084b5149 100644 --- a/Flow.Launcher/MessageBoxEx.xaml.cs +++ b/Flow.Launcher/MessageBoxEx.xaml.cs @@ -159,19 +159,12 @@ namespace Flow.Launcher private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e) { - switch (_button) - { - case MessageBoxButton.OK: - _result = MessageBoxResult.None; - break; - case MessageBoxButton.OKCancel: - case MessageBoxButton.YesNoCancel: - _result = MessageBoxResult.Cancel; - break; - case MessageBoxButton.YesNo: - _result = MessageBoxResult.No; - break; - } + if (_button == MessageBoxButton.YesNo) + return; + else if (_button == MessageBoxButton.OK) + _result = MessageBoxResult.OK; + else + _result = MessageBoxResult.Cancel; DialogResult = false; Close(); } From 7c718ce0614949ef2f56638efeca97e1af881909 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Fri, 30 May 2025 15:28:39 +0800 Subject: [PATCH 54/56] Add code comments --- Flow.Launcher/MessageBoxEx.xaml.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Flow.Launcher/MessageBoxEx.xaml.cs b/Flow.Launcher/MessageBoxEx.xaml.cs index c084b5149..7296ff4ca 100644 --- a/Flow.Launcher/MessageBoxEx.xaml.cs +++ b/Flow.Launcher/MessageBoxEx.xaml.cs @@ -160,6 +160,7 @@ namespace Flow.Launcher private void KeyEsc_OnPress(object sender, ExecutedRoutedEventArgs e) { if (_button == MessageBoxButton.YesNo) + // Follow System.Windows.MessageBox behavior return; else if (_button == MessageBoxButton.OK) _result = MessageBoxResult.OK; @@ -188,6 +189,7 @@ namespace Flow.Launcher private void Button_Cancel(object sender, RoutedEventArgs e) { if (_button == MessageBoxButton.YesNo) + // Follow System.Windows.MessageBox behavior return; else if (_button == MessageBoxButton.OK) _result = MessageBoxResult.OK; From abef6177998bc6ab6d03ab19fcaf93548bbe59d1 Mon Sep 17 00:00:00 2001 From: DB P Date: Fri, 30 May 2025 17:35:24 +0900 Subject: [PATCH 55/56] Change delete confirmation dialog from Yes/No to OK/Cancel --- Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index db0128b3b..896fc9922 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -200,9 +200,9 @@ namespace Flow.Launcher.Plugin.Explorer if (Context.API.ShowMsgBox( string.Format(Context.API.GetTranslation("plugin_explorer_delete_folder_link"), record.FullPath), Context.API.GetTranslation("plugin_explorer_deletefilefolder"), - MessageBoxButton.YesNo, + MessageBoxButton.OKCancel, MessageBoxImage.Warning) - == MessageBoxResult.No) + == MessageBoxResult.Cancel) return false; if (isFile) From 70fcc848932e8f8f812896bc9b0a1acefc092c87 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 31 May 2025 17:15:39 +0800 Subject: [PATCH 56/56] Use ResultContextMenu instead of ContextMenu --- Flow.Launcher/MainWindow.xaml | 6 +++--- Flow.Launcher/MainWindow.xaml.cs | 20 +++++++++---------- .../SettingPages/Views/SettingsPaneTheme.xaml | 2 +- Flow.Launcher/Themes/Base.xaml | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 413315faf..9ff38a564 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -359,7 +359,7 @@ - + @@ -373,7 +373,7 @@ - + @@ -419,7 +419,7 @@ diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index bb29d78e5..0048c8aa9 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -295,14 +295,14 @@ namespace Flow.Launcher // QueryTextBox.Text change detection (modified to only work when character count is 1 or higher) QueryTextBox.TextChanged += (s, e) => UpdateClockPanelVisibility(); - // Detecting ContextMenu.Visibility changes + // Detecting ResultContextMenu.Visibility changes DependencyPropertyDescriptor - .FromProperty(VisibilityProperty, typeof(ContextMenu)) - .AddValueChanged(ContextMenu, (s, e) => UpdateClockPanelVisibility()); + .FromProperty(VisibilityProperty, typeof(ResultListBox)) + .AddValueChanged(ResultContextMenu, (s, e) => UpdateClockPanelVisibility()); // Detect History.Visibility changes DependencyPropertyDescriptor - .FromProperty(VisibilityProperty, typeof(StackPanel)) + .FromProperty(VisibilityProperty, typeof(ResultListBox)) .AddValueChanged(History, (s, e) => UpdateClockPanelVisibility()); // Initialize query state @@ -1016,7 +1016,7 @@ namespace Flow.Launcher private void UpdateClockPanelVisibility() { - if (QueryTextBox == null || ContextMenu == null || History == null || ClockPanel == null) + if (QueryTextBox == null || ResultContextMenu == null || History == null || ClockPanel == null) { return; } @@ -1031,20 +1031,20 @@ namespace Flow.Launcher }; var animationDuration = TimeSpan.FromMilliseconds(animationLength * 2 / 3); - // ✅ Conditions for showing ClockPanel (No query input & ContextMenu, History are closed) + // ✅ Conditions for showing ClockPanel (No query input / ResultContextMenu & History are closed) var shouldShowClock = QueryTextBox.Text.Length == 0 && - ContextMenu.Visibility != Visibility.Visible && + ResultContextMenu.Visibility != Visibility.Visible && History.Visibility != Visibility.Visible; - // ✅ 1. When ContextMenu opens, immediately set Visibility.Hidden (force hide without animation) - if (ContextMenu.Visibility == Visibility.Visible) + // ✅ 1. When ResultContextMenu opens, immediately set Visibility.Hidden (force hide without animation) + if (ResultContextMenu.Visibility == Visibility.Visible) { _viewModel.ClockPanelVisibility = Visibility.Hidden; _viewModel.ClockPanelOpacity = 0.0; // Set to 0 in case Opacity animation affects it return; } - // ✅ 2. When ContextMenu is closed, keep it Hidden if there's text in the query (remember previous state) + // ✅ 2. When ResultContextMenu is closed, keep it Hidden if there's text in the query (remember previous state) else if (QueryTextBox.Text.Length > 0) { _viewModel.ClockPanelVisibility = Visibility.Hidden; diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index 700dc3a91..6e16012ac 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -374,7 +374,7 @@ IsHitTestVisible="False" Visibility="Visible" /> - + diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index 1844e25be..e531c17ad 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -479,7 +479,7 @@ + -->