Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Flow.Launcher/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,15 @@ await Stopwatch.NormalAsync("|App.OnStartup|Startup cost", async () =>

AbstractPluginEnvironment.PreStartPluginExecutablePathUpdate(_settings);

PluginManager.LoadPlugins(_settings.PluginSettings);

// Register ResultsUpdated event after all plugins are loaded
Ioc.Default.GetRequiredService<MainViewModel>().RegisterResultsUpdatedEvent();

// Change language after all plugins are initialized
// TODO: Clean InternationalizationManager.Instance and InternationalizationManager.Instance.GetTranslation in future
Ioc.Default.GetRequiredService<Internationalization>().ChangeLanguage(_settings.Language);

PluginManager.LoadPlugins(_settings.PluginSettings);

Http.Proxy = _settings.Proxy;

await PluginManager.InitializePluginsAsync();
Expand Down
3 changes: 1 addition & 2 deletions Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public MainViewModel()
};

RegisterViewUpdate();
RegisterResultsUpdatedEvent();
_ = RegisterClockAndDateUpdateAsync();
}

Expand Down Expand Up @@ -213,7 +212,7 @@ void continueAction(Task t)
}
}

private void RegisterResultsUpdatedEvent()
public void RegisterResultsUpdatedEvent()
Copy link
Member

@taooceros taooceros Mar 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually maybe we can move this to PluginManager?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh we cannot do that. since PluginManager is in core project, it cannot access function in main project (MainViewModel.RegisterResultsUpdatedEvent)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, sorry for that.

{
foreach (var pair in PluginManager.GetPluginsForInterface<IResultUpdated>())
{
Expand Down
Loading