diff --git a/src/helpers/ServiceHelper.cs b/src/helpers/ServiceHelper.cs index 6146dc1f..c50d3fdf 100644 --- a/src/helpers/ServiceHelper.cs +++ b/src/helpers/ServiceHelper.cs @@ -13,6 +13,8 @@ public static class ServiceHelper public static FirmwareService FirmwareService { get; private set; } public static ArchiveService ArchiveService { get; private set; } public static AssetsService AssetsService { get; private set; } + public static EventHandler StatusUpdated { get; private set; } + public static EventHandler UpdateProcessComplete { get; private set; } private static bool isInitialized; @@ -40,11 +42,13 @@ public static void Initialize(string path, EventHandler FirmwareService.StatusUpdated += statusUpdated; CoresService.StatusUpdated += statusUpdated; ArchiveService.StatusUpdated += statusUpdated; + StatusUpdated = statusUpdated; } if (updateProcessComplete != null) { CoresService.UpdateProcessComplete += updateProcessComplete; + UpdateProcessComplete = updateProcessComplete; } } } @@ -56,5 +60,6 @@ public static void ReloadSettings() ArchiveService = new ArchiveService(SettingsService.GetConfig().archives, SettingsService.GetConfig().crc_check, SettingsService.GetConfig().use_custom_archive); CoresService = new CoresService(UpdateDirectory, SettingsService, ArchiveService, AssetsService); + CoresService.StatusUpdated += StatusUpdated; } } diff --git a/src/partials/Program.Menus.cs b/src/partials/Program.Menus.cs index dee0b065..39520d06 100644 --- a/src/partials/Program.Menus.cs +++ b/src/partials/Program.Menus.cs @@ -286,6 +286,7 @@ private static void DisplayMenu(CoreUpdaterService coreUpdaterService) SettingsMenu(); // Is reloading the settings file necessary? ServiceHelper.ReloadSettings(); + coreUpdaterService.ReloadSettings(); }) .Add("Exit", ConsoleMenu.Close); diff --git a/src/services/CoreUpdaterService.cs b/src/services/CoreUpdaterService.cs index ff59b946..cf820cb4 100644 --- a/src/services/CoreUpdaterService.cs +++ b/src/services/CoreUpdaterService.cs @@ -13,8 +13,8 @@ public class CoreUpdaterService : BaseProcess private readonly string installPath; private readonly List cores; private readonly FirmwareService firmwareService; - private readonly SettingsService settingsService; - private readonly CoresService coresService; + private SettingsService settingsService; + private CoresService coresService; public CoreUpdaterService( string path, @@ -356,4 +356,10 @@ public void DeleteCore(Core core, bool force = false, bool nuke = false) this.coresService.Uninstall(core.identifier, core.platform_id, nuke); } } + + public void ReloadSettings() + { + this.settingsService = ServiceHelper.SettingsService;; + this.coresService = ServiceHelper.CoresService; + } }