mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #3240 from Jack251970/back_query_results_before_change_query
Fix ChangeQuery & ReQuery Work Issue When Results Are Not From Query Results
This commit is contained in:
commit
4b03aa477c
6 changed files with 8 additions and 13 deletions
|
|
@ -17,7 +17,8 @@ namespace Flow.Launcher.Plugin
|
|||
public interface IPublicAPI
|
||||
{
|
||||
/// <summary>
|
||||
/// Change Flow.Launcher query
|
||||
/// Change Flow.Launcher query.
|
||||
/// When current results are from context menu or history, it will go back to query results before changing query.
|
||||
/// </summary>
|
||||
/// <param name="query">query text</param>
|
||||
/// <param name="requery">
|
||||
|
|
@ -299,7 +300,7 @@ namespace Flow.Launcher.Plugin
|
|||
|
||||
/// <summary>
|
||||
/// Reloads the query.
|
||||
/// This method should run when selected item is from query results.
|
||||
/// When current results are from context menu or history, it will go back to query results before requerying.
|
||||
/// </summary>
|
||||
/// <param name="reselect">Choose the first result after reload if true; keep the last selected result if false. Default is true.</param>
|
||||
public void ReQuery(bool reselect = true);
|
||||
|
|
|
|||
|
|
@ -279,10 +279,8 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
public void ReQuery(bool reselect)
|
||||
{
|
||||
if (SelectedIsFromQueryResults())
|
||||
{
|
||||
QueryResults(isReQuery: true, reSelect: reselect);
|
||||
}
|
||||
BackToQueryResults();
|
||||
QueryResults(isReQuery: true, reSelect: reselect);
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
|
|
@ -626,6 +624,8 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
BackToQueryResults();
|
||||
|
||||
if (QueryText != queryText)
|
||||
{
|
||||
// re-query is done in QueryText's setter method
|
||||
|
|
@ -1291,7 +1291,6 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
_topMostRecord.Remove(result);
|
||||
App.API.ShowMsg(InternationalizationManager.Instance.GetTranslation("success"));
|
||||
App.API.BackToQueryResults();
|
||||
App.API.ReQuery();
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1309,7 +1308,6 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
_topMostRecord.AddOrUpdate(result);
|
||||
App.API.ShowMsg(InternationalizationManager.Instance.GetTranslation("success"));
|
||||
App.API.BackToQueryResults();
|
||||
App.API.ReQuery();
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,5 +159,4 @@ namespace Flow.Launcher.ViewModel
|
|||
changeKeywordsWindow.ShowDialog();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ namespace Flow.Launcher.Plugin.PluginsManager
|
|||
var link = pluginManifestInfo.UrlSourceCode.StartsWith("https://github.com")
|
||||
? Regex.Replace(pluginManifestInfo.UrlSourceCode, @"\/tree\/\w+$", "") + "/issues"
|
||||
: pluginManifestInfo.UrlSourceCode;
|
||||
|
||||
Context.API.OpenUrl(link);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -292,7 +292,6 @@ namespace Flow.Launcher.Plugin.Program
|
|||
Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"),
|
||||
Context.API.GetTranslation(
|
||||
"flowlauncher_plugin_program_disable_dlgtitle_success_message"));
|
||||
Context.API.BackToQueryResults();
|
||||
Context.API.ReQuery();
|
||||
return false;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using System.Diagnostics;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using WindowsInput;
|
||||
using WindowsInput.Native;
|
||||
using Flow.Launcher.Infrastructure.Hotkey;
|
||||
|
|
@ -379,7 +378,7 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
private void OnWinRPressed()
|
||||
{
|
||||
// show the main window and set focus to the query box
|
||||
Task.Run(() =>
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
context.API.ShowMainWindow();
|
||||
context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeparator}");
|
||||
|
|
|
|||
Loading…
Reference in a new issue