Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Plugin Manager Issue #3365

Merged
merged 2 commits into from
Mar 23, 2025
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
Contributor Author

Choose a reason for hiding this comment

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

okay

Copy link
Contributor 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