mirror of
https://github.com/azaion/annotations.git
synced 2026-04-23 00:16:30 +00:00
make python app load a bit eariler, making startup a bit faster
This commit is contained in:
@@ -8,6 +8,7 @@ using Azaion.Common.DTO;
|
||||
using Azaion.Common.DTO.Config;
|
||||
using Azaion.Common.Extensions;
|
||||
using Azaion.Common.Services;
|
||||
using Azaion.CommonSecurity.Services;
|
||||
using Azaion.Dataset;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
@@ -24,20 +25,22 @@ public partial class MainSuite
|
||||
private readonly IGalleryService _galleryService;
|
||||
private readonly IDbFactory _dbFactory;
|
||||
private readonly Dictionary<WindowEnum, Window> _openedWindows = new();
|
||||
private readonly IResourceLoader _resourceLoader;
|
||||
|
||||
public MainSuite(IOptions<AppConfig> appConfig,
|
||||
IConfigUpdater configUpdater,
|
||||
IEnumerable<IAzaionModule> modules,
|
||||
IServiceProvider sp,
|
||||
IGalleryService galleryService,
|
||||
IDbFactory dbFactory
|
||||
)
|
||||
IDbFactory dbFactory,
|
||||
IResourceLoader resourceLoader)
|
||||
{
|
||||
_configUpdater = configUpdater;
|
||||
_modules = modules;
|
||||
_sp = sp;
|
||||
_galleryService = galleryService;
|
||||
_dbFactory = dbFactory;
|
||||
_resourceLoader = resourceLoader;
|
||||
_appConfig = appConfig.Value;
|
||||
InitializeComponent();
|
||||
Loaded += OnLoaded;
|
||||
@@ -107,6 +110,7 @@ public partial class MainSuite
|
||||
_openedWindows[module.WindowEnum] = window;
|
||||
window.Closed += (_, _) =>
|
||||
{
|
||||
_resourceLoader.StopPython();
|
||||
_openedWindows.Remove(module.WindowEnum);
|
||||
if (!_openedWindows.Any())
|
||||
Close();
|
||||
|
||||
Reference in New Issue
Block a user