mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Draft Query Shortcut
This commit is contained in:
parent
16e032ea55
commit
0d355bdef8
5 changed files with 51 additions and 1 deletions
|
|
@ -205,6 +205,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
|
||||
// This needs to be loaded last by staying at the bottom
|
||||
public PluginsSettings PluginSettings { get; set; } = new PluginsSettings();
|
||||
internal List<ShortCutModel> ShortCuts { get; set; } = new List<ShortCutModel>();
|
||||
}
|
||||
|
||||
public enum LastQueryMode
|
||||
|
|
|
|||
12
Flow.Launcher.Infrastructure/UserSettings/ShortCutModel.cs
Normal file
12
Flow.Launcher.Infrastructure/UserSettings/ShortCutModel.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Flow.Launcher.Infrastructure.UserSettings
|
||||
{
|
||||
public record ShortCutModel(string Key, string Value)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -875,6 +875,31 @@
|
|||
SelectedValuePath="LanguageCode" />
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
<Border Style="{DynamicResource SettingGroupBox}">
|
||||
<StackPanel Margin="10" Orientation="Vertical">
|
||||
<TextBlock Margin="10" Text="ShortCut" />
|
||||
<ListView ItemsSource="{Binding ShortCuts}">
|
||||
<ListView.View>
|
||||
<GridView>
|
||||
<GridViewColumn Header="Key">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Key}" />
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="Mapped Value">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Value}" />
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
|
|
|||
|
|
@ -553,6 +553,16 @@ namespace Flow.Launcher.ViewModel
|
|||
return;
|
||||
}
|
||||
|
||||
string query = QueryText;
|
||||
|
||||
foreach (var shortcut in _settings.ShortCuts)
|
||||
{
|
||||
if (QueryText == shortcut.Key)
|
||||
{
|
||||
query = shortcut.Value;
|
||||
}
|
||||
}
|
||||
|
||||
_updateSource?.Dispose();
|
||||
|
||||
var currentUpdateSource = new CancellationTokenSource();
|
||||
|
|
@ -569,7 +579,7 @@ namespace Flow.Launcher.ViewModel
|
|||
if (currentCancellationToken.IsCancellationRequested)
|
||||
return;
|
||||
|
||||
var query = QueryBuilder.Build(QueryText.Trim(), PluginManager.NonGlobalPlugins);
|
||||
var query = QueryBuilder.Build(query.Trim(), PluginManager.NonGlobalPlugins);
|
||||
|
||||
// handle the exclusiveness of plugin using action keyword
|
||||
RemoveOldQueryResults(query);
|
||||
|
|
|
|||
|
|
@ -170,6 +170,8 @@ namespace Flow.Launcher.ViewModel
|
|||
public List<Language> Languages => _translater.LoadAvailableLanguages();
|
||||
public IEnumerable<int> MaxResultsRange => Enumerable.Range(2, 16);
|
||||
|
||||
public List<ShortCutModel> ShortCuts => Settings.ShortCuts;
|
||||
|
||||
public string TestProxy()
|
||||
{
|
||||
var proxyServer = Settings.Proxy.Server;
|
||||
|
|
|
|||
Loading…
Reference in a new issue