Skip to content

Commit 2843236

Browse files
committed
Improve documents & Improve code quality
1 parent 27d7ef5 commit 2843236

File tree

8 files changed

+10
-3
lines changed

8 files changed

+10
-3
lines changed

Flow.Launcher/CustomQueryHotkeySetting.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public void UpdateItem(CustomPluginHotkey item)
7676

7777
private void BtnTestActionKeyword_OnClick(object sender, RoutedEventArgs e)
7878
{
79+
// if user happens to open context menu, we need to return back to query results before changing query
7980
App.API.BackToQueryResults();
8081
App.API.ChangeQuery(tbAction.Text);
8182
Application.Current.MainWindow.Show();

Flow.Launcher/CustomShortcutSetting.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ private void cmdEsc_OnPress(object sender, ExecutedRoutedEventArgs e)
6464

6565
private void BtnTestShortcut_OnClick(object sender, RoutedEventArgs e)
6666
{
67+
// if user happens to open context menu, we need to return back to query results before changing query
6768
App.API.BackToQueryResults();
6869
App.API.ChangeQuery(tbExpand.Text);
6970
Application.Current.MainWindow.Show();

Flow.Launcher/ResultListBox.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ private void ResultList_MouseMove(object sender, MouseEventArgs e)
150150
var effect = DragDrop.DoDragDrop((DependencyObject)sender, data, DragDropEffects.Move | DragDropEffects.Copy);
151151
if (effect == DragDropEffects.Move)
152152
{
153+
// if user happens to open context menu, we need to return back to query results before changing query
153154
App.API.BackToQueryResults();
154155
App.API.ChangeQuery(rawQuery, true);
155156
}

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,7 @@ private Result ContextMenuTopMost(Result result)
12661266
{
12671267
_topMostRecord.Remove(result);
12681268
App.API.ShowMsg(InternationalizationManager.Instance.GetTranslation("success"));
1269+
// if user happens to open context menu, we need to return back to query results before changing query
12691270
App.API.BackToQueryResults();
12701271
App.API.ReQuery();
12711272
return false;
@@ -1284,6 +1285,7 @@ private Result ContextMenuTopMost(Result result)
12841285
{
12851286
_topMostRecord.AddOrUpdate(result);
12861287
App.API.ShowMsg(InternationalizationManager.Instance.GetTranslation("success"));
1288+
// if user happens to open context menu, we need to return back to query results before changing query
12871289
App.API.BackToQueryResults();
12881290
App.API.ReQuery();
12891291
return false;

Flow.Launcher/ViewModel/PluginStoreItemViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public string Category
6464
private void ShowCommandQuery(string action)
6565
{
6666
var actionKeyword = PluginManagerData.Metadata.ActionKeywords.Any() ? PluginManagerData.Metadata.ActionKeywords[0] + " " : String.Empty;
67+
// if user happens to open context menu, we need to return back to query results before changing query
6768
App.API.BackToQueryResults();
6869
App.API.ChangeQuery($"{actionKeyword}{action} {_plugin.Name}");
6970
App.API.ShowMainWindow();

Flow.Launcher/ViewModel/PluginViewModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ private void OpenSourceCodeLink()
146146
[RelayCommand]
147147
private void OpenDeletePluginWindow()
148148
{
149+
// if user happens to open context menu, we need to return back to query results before changing query
149150
PluginManager.API.BackToQueryResults();
150151
PluginManager.API.ChangeQuery($"{PluginManagerActionKeyword} uninstall {PluginPair.Metadata.Name}".Trim(), true);
151152
PluginManager.API.ShowMainWindow();

Plugins/Flow.Launcher.Plugin.PluginsManager/ContextMenu.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public List<Result> LoadContextMenus(Result selectedResult)
5959
var link = pluginManifestInfo.UrlSourceCode.StartsWith("https://github.com")
6060
? Regex.Replace(pluginManifestInfo.UrlSourceCode, @"\/tree\/\w+$", "") + "/issues"
6161
: pluginManifestInfo.UrlSourceCode;
62-
6362
Context.API.OpenUrl(link);
6463
return true;
6564
}

Plugins/Flow.Launcher.Plugin.Shell/Main.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using System.IO;
66
using System.Linq;
77
using System.Threading.Tasks;
8-
using System.Windows;
98
using WindowsInput;
109
using WindowsInput.Native;
1110
using Flow.Launcher.Infrastructure.Hotkey;
@@ -379,9 +378,11 @@ bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state)
379378
private void OnWinRPressed()
380379
{
381380
// show the main window and set focus to the query box
382-
Task.Run(() =>
381+
_ = Task.Run(() =>
383382
{
384383
context.API.ShowMainWindow();
384+
// if user happens to open context menu, we need to return back to query results before changing query
385+
context.API.BackToQueryResults();
385386
context.API.ChangeQuery($"{context.CurrentPluginMetadata.ActionKeywords[0]}{Plugin.Query.TermSeparator}");
386387
});
387388

0 commit comments

Comments
 (0)