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 873
873
SelectedValuePath =" LanguageCode" />
874
874
</ItemsControl >
875
875
</Border >
876
+ <Border Style =" {DynamicResource SettingGroupBox}" >
877
+ <StackPanel Margin =" 10" Orientation =" Vertical" >
878
+ <TextBlock Margin =" 10" Text =" ShortCut" />
879
+ <ListView ItemsSource =" {Binding ShortCuts}" >
880
+ <ListView .View>
881
+ <GridView >
882
+ <GridViewColumn Header =" Key" >
883
+ <GridViewColumn .CellTemplate>
884
+ <DataTemplate >
885
+ <TextBlock Text =" {Binding Key}" />
886
+ </DataTemplate >
887
+ </GridViewColumn .CellTemplate>
888
+ </GridViewColumn >
889
+ <GridViewColumn Header =" Mapped Value" >
890
+ <GridViewColumn .CellTemplate>
891
+ <DataTemplate >
892
+ <TextBlock Text =" {Binding Value}" />
893
+ </DataTemplate >
894
+ </GridViewColumn .CellTemplate>
895
+ </GridViewColumn >
896
+ </GridView >
897
+ </ListView .View>
898
+ </ListView >
899
+ </StackPanel >
900
+ </Border >
876
901
</StackPanel >
877
902
</ScrollViewer >
878
903
</TabItem >
Original file line number Diff line number Diff line change @@ -529,6 +529,16 @@ private async void QueryResults()
529
529
return ;
530
530
}
531
531
532
+ string query = QueryText ;
533
+
534
+ foreach ( var shortcut in _settings . ShortCuts )
535
+ {
536
+ if ( QueryText == shortcut . Key )
537
+ {
538
+ query = shortcut . Value ;
539
+ }
540
+ }
541
+
532
542
_updateSource ? . Dispose ( ) ;
533
543
534
544
var currentUpdateSource = new CancellationTokenSource ( ) ;
@@ -545,7 +555,7 @@ private async void QueryResults()
545
555
if ( currentCancellationToken . IsCancellationRequested )
546
556
return ;
547
557
548
- var query = QueryBuilder . Build ( QueryText . Trim ( ) , PluginManager . NonGlobalPlugins ) ;
558
+ var query = QueryBuilder . Build ( query . Trim ( ) , PluginManager . NonGlobalPlugins ) ;
549
559
550
560
// handle the exclusiveness of plugin using action keyword
551
561
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