File tree Expand file tree Collapse file tree 5 files changed +51
-1
lines changed
Flow.Launcher.Infrastructure/UserSettings Expand file tree Collapse file tree 5 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,7 @@ public bool HideNotifyIcon
205
205
206
206
// This needs to be loaded last by staying at the bottom
207
207
public PluginsSettings PluginSettings { get ; set ; } = new PluginsSettings ( ) ;
208
+ internal List < ShortCutModel > ShortCuts { get ; set ; } = new List < ShortCutModel > ( ) ;
208
209
}
209
210
210
211
public enum LastQueryMode
Original file line number Diff line number Diff line change
1
+ using System ;
2
+ using System . Collections . Generic ;
3
+ using System . Linq ;
4
+ using System . Text ;
5
+ using System . Threading . Tasks ;
6
+
7
+ namespace Flow . Launcher . Infrastructure . UserSettings
8
+ {
9
+ public record ShortCutModel ( string Key , string Value )
10
+ {
11
+ }
12
+ }
Original file line number Diff line number Diff line change 875
875
SelectedValuePath =" LanguageCode" />
876
876
</ItemsControl >
877
877
</Border >
878
+ <Border Style =" {DynamicResource SettingGroupBox}" >
879
+ <StackPanel Margin =" 10" Orientation =" Vertical" >
880
+ <TextBlock Margin =" 10" Text =" ShortCut" />
881
+ <ListView ItemsSource =" {Binding ShortCuts}" >
882
+ <ListView .View>
883
+ <GridView >
884
+ <GridViewColumn Header =" Key" >
885
+ <GridViewColumn .CellTemplate>
886
+ <DataTemplate >
887
+ <TextBlock Text =" {Binding Key}" />
888
+ </DataTemplate >
889
+ </GridViewColumn .CellTemplate>
890
+ </GridViewColumn >
891
+ <GridViewColumn Header =" Mapped Value" >
892
+ <GridViewColumn .CellTemplate>
893
+ <DataTemplate >
894
+ <TextBlock Text =" {Binding Value}" />
895
+ </DataTemplate >
896
+ </GridViewColumn .CellTemplate>
897
+ </GridViewColumn >
898
+ </GridView >
899
+ </ListView .View>
900
+ </ListView >
901
+ </StackPanel >
902
+ </Border >
878
903
</StackPanel >
879
904
</ScrollViewer >
880
905
</TabItem >
Original file line number Diff line number Diff line change @@ -553,6 +553,16 @@ private async void QueryResults()
553
553
return ;
554
554
}
555
555
556
+ string query = QueryText ;
557
+
558
+ foreach ( var shortcut in _settings . ShortCuts )
559
+ {
560
+ if ( QueryText == shortcut . Key )
561
+ {
562
+ query = shortcut . Value ;
563
+ }
564
+ }
565
+
556
566
_updateSource ? . Dispose ( ) ;
557
567
558
568
var currentUpdateSource = new CancellationTokenSource ( ) ;
@@ -569,7 +579,7 @@ private async void QueryResults()
569
579
if ( currentCancellationToken . IsCancellationRequested )
570
580
return ;
571
581
572
- var query = QueryBuilder . Build ( QueryText . Trim ( ) , PluginManager . NonGlobalPlugins ) ;
582
+ var query = QueryBuilder . Build ( query . Trim ( ) , PluginManager . NonGlobalPlugins ) ;
573
583
574
584
// handle the exclusiveness of plugin using action keyword
575
585
RemoveOldQueryResults ( query ) ;
Original file line number Diff line number Diff line change @@ -170,6 +170,8 @@ public List<string> QuerySearchPrecisionStrings
170
170
public List < Language > Languages => _translater . LoadAvailableLanguages ( ) ;
171
171
public IEnumerable < int > MaxResultsRange => Enumerable . Range ( 2 , 16 ) ;
172
172
173
+ public List < ShortCutModel > ShortCuts => Settings . ShortCuts ;
174
+
173
175
public string TestProxy ( )
174
176
{
175
177
var proxyServer = Settings . Proxy . Server ;
You can’t perform that action at this time.
0 commit comments