[Plugin system] Initialize plugin base on application load.

This commit is contained in:
2023-10-05 15:26:44 +01:00
parent a50d892f2a
commit e693238a7c
2 changed files with 18 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ public sealed class SplashWindowViewModel(SplashWindow view) : ViewModelBase
internal void OnOpened()
{
Message = UI.Welcome_to_Aaru;
MaxProgress = 9;
MaxProgress = 10;
CurrentProgress = 0;
Dispatcher.UIThread.Post(InitializeConsole);
@@ -268,6 +268,20 @@ public sealed class SplashWindowViewModel(SplashWindow view) : ViewModelBase
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
Dispatcher.UIThread.Post(RegisterPlugins);
});
}
// There are too many places that depend on this being inited to be sure all are covered, so init it here.
void RegisterPlugins()
{
CurrentProgress++;
Message = UI.Registering_plugins;
AaruConsole.WriteLine(UI.Registering_plugins);
Task.Run(() =>
{
PluginBase.Init();
Dispatcher.UIThread.Post(SaveStatistics);
});
}