1- using System ;
1+ using System ;
22using System . Collections . Concurrent ;
33using System . Collections . Generic ;
44using System . IO ;
99using CommunityToolkit . Mvvm . DependencyInjection ;
1010using Flow . Launcher . Core . ExternalPlugins ;
1111using Flow . Launcher . Infrastructure ;
12- using Flow . Launcher . Infrastructure . QuickSwitch ;
12+ using Flow . Launcher . Infrastructure . DialogJump ;
1313using Flow . Launcher . Infrastructure . UserSettings ;
1414using Flow . Launcher . Plugin ;
1515using Flow . Launcher . Plugin . SharedCommands ;
@@ -41,8 +41,8 @@ public static class PluginManager
4141 private static IEnumerable < PluginPair > _resultUpdatePlugin ;
4242 private static IEnumerable < PluginPair > _translationPlugins ;
4343
44- private static readonly List < QuickSwitchExplorerPair > _quickSwitchExplorerPlugins = new ( ) ;
45- private static readonly List < QuickSwitchDialogPair > _quickSwitchDialogPlugins = new ( ) ;
44+ private static readonly List < DialogJumpExplorerPair > _dialogJumpExplorerPlugins = new ( ) ;
45+ private static readonly List < DialogJumpDialogPair > _dialogJumpDialogPlugins = new ( ) ;
4646
4747 /// <summary>
4848 /// Directories that will hold Flow Launcher plugin directory
@@ -191,20 +191,20 @@ public static void LoadPlugins(PluginsSettings settings)
191191 _resultUpdatePlugin = GetPluginsForInterface < IResultUpdated > ( ) ;
192192 _translationPlugins = GetPluginsForInterface < IPluginI18n > ( ) ;
193193
194- // Initialize quick switch plugin pairs
195- foreach ( var pair in GetPluginsForInterface < IQuickSwitchExplorer > ( ) )
194+ // Initialize dialog jump plugin pairs
195+ foreach ( var pair in GetPluginsForInterface < IDialogJumpExplorer > ( ) )
196196 {
197- _quickSwitchExplorerPlugins . Add ( new QuickSwitchExplorerPair
197+ _dialogJumpExplorerPlugins . Add ( new DialogJumpExplorerPair
198198 {
199- Plugin = ( IQuickSwitchExplorer ) pair . Plugin ,
199+ Plugin = ( IDialogJumpExplorer ) pair . Plugin ,
200200 Metadata = pair . Metadata
201201 } ) ;
202202 }
203- foreach ( var pair in GetPluginsForInterface < IQuickSwitchDialog > ( ) )
203+ foreach ( var pair in GetPluginsForInterface < IDialogJumpDialog > ( ) )
204204 {
205- _quickSwitchDialogPlugins . Add ( new QuickSwitchDialogPair
205+ _dialogJumpDialogPlugins . Add ( new DialogJumpDialogPair
206206 {
207- Plugin = ( IQuickSwitchDialog ) pair . Plugin ,
207+ Plugin = ( IDialogJumpDialog ) pair . Plugin ,
208208 Metadata = pair . Metadata
209209 } ) ;
210210 }
@@ -310,20 +310,20 @@ public static async Task InitializePluginsAsync()
310310 }
311311 }
312312
313- public static ICollection < PluginPair > ValidPluginsForQuery ( Query query , bool quickSwitch )
313+ public static ICollection < PluginPair > ValidPluginsForQuery ( Query query , bool dialogJump )
314314 {
315315 if ( query is null )
316316 return Array . Empty < PluginPair > ( ) ;
317317
318318 if ( ! NonGlobalPlugins . TryGetValue ( query . ActionKeyword , out var plugin ) )
319319 {
320- if ( quickSwitch )
321- return GlobalPlugins . Where ( p => p . Plugin is IAsyncQuickSwitch && ! PluginModified ( p . Metadata . ID ) ) . ToList ( ) ;
320+ if ( dialogJump )
321+ return GlobalPlugins . Where ( p => p . Plugin is IAsyncDialogJump && ! PluginModified ( p . Metadata . ID ) ) . ToList ( ) ;
322322 else
323323 return GlobalPlugins . Where ( p => ! PluginModified ( p . Metadata . ID ) ) . ToList ( ) ;
324324 }
325325
326- if ( quickSwitch && plugin . Plugin is not IAsyncQuickSwitch )
326+ if ( dialogJump && plugin . Plugin is not IAsyncDialogJump )
327327 return Array . Empty < PluginPair > ( ) ;
328328
329329 if ( API . PluginModified ( plugin . Metadata . ID ) )
@@ -413,16 +413,16 @@ public static async Task<List<Result>> QueryHomeForPluginAsync(PluginPair pair,
413413 }
414414 return results ;
415415 }
416-
417- public static async Task < List < QuickSwitchResult > > QueryQuickSwitchForPluginAsync ( PluginPair pair , Query query , CancellationToken token )
416+
417+ public static async Task < List < DialogJumpResult > > QueryDialogJumpForPluginAsync ( PluginPair pair , Query query , CancellationToken token )
418418 {
419- var results = new List < QuickSwitchResult > ( ) ;
419+ var results = new List < DialogJumpResult > ( ) ;
420420 var metadata = pair . Metadata ;
421421
422422 try
423423 {
424424 var milliseconds = await API . StopwatchLogDebugAsync ( ClassName , $ "Cost for { metadata . Name } ",
425- async ( ) => results = await ( ( IAsyncQuickSwitch ) pair . Plugin ) . QueryQuickSwitchAsync ( query , token ) . ConfigureAwait ( false ) ) ;
425+ async ( ) => results = await ( ( IAsyncDialogJump ) pair . Plugin ) . QueryDialogJumpAsync ( query , token ) . ConfigureAwait ( false ) ) ;
426426
427427 token . ThrowIfCancellationRequested ( ) ;
428428 if ( results == null )
@@ -438,7 +438,7 @@ public static async Task<List<QuickSwitchResult>> QueryQuickSwitchForPluginAsync
438438 }
439439 catch ( Exception e )
440440 {
441- API . LogException ( ClassName , $ "Failed to query quick switch for plugin: { metadata . Name } ", e ) ;
441+ API . LogException ( ClassName , $ "Failed to query dialog jump for plugin: { metadata . Name } ", e ) ;
442442 return null ;
443443 }
444444 return results ;
@@ -519,14 +519,14 @@ public static bool IsHomePlugin(string id)
519519 return _homePlugins . Where ( p => ! PluginModified ( p . Metadata . ID ) ) . Any ( p => p . Metadata . ID == id ) ;
520520 }
521521
522- public static IList < QuickSwitchExplorerPair > GetQuickSwitchExplorers ( )
522+ public static IList < DialogJumpExplorerPair > GetDialogJumpExplorers ( )
523523 {
524- return _quickSwitchExplorerPlugins . Where ( p => ! PluginModified ( p . Metadata . ID ) ) . ToList ( ) ;
524+ return _dialogJumpExplorerPlugins . Where ( p => ! PluginModified ( p . Metadata . ID ) ) . ToList ( ) ;
525525 }
526526
527- public static IList < QuickSwitchDialogPair > GetQuickSwitchDialogs ( )
527+ public static IList < DialogJumpDialogPair > GetDialogJumpDialogs ( )
528528 {
529- return _quickSwitchDialogPlugins . Where ( p => ! PluginModified ( p . Metadata . ID ) ) . ToList ( ) ;
529+ return _dialogJumpDialogPlugins . Where ( p => ! PluginModified ( p . Metadata . ID ) ) . ToList ( ) ;
530530 }
531531
532532 public static bool ActionKeywordRegistered ( string actionKeyword )
0 commit comments