diff --git a/src/TableCloth.App/Components/IAppUserInterface.cs b/src/TableCloth.App/Components/IAppUserInterface.cs index f80afd3a..baa25180 100644 --- a/src/TableCloth.App/Components/IAppUserInterface.cs +++ b/src/TableCloth.App/Components/IAppUserInterface.cs @@ -11,6 +11,7 @@ public interface IAppUserInterface { AboutWindow CreateAboutWindow(); OptionsWindow CreateOptionsWindow(string? initialTabKey = null); + PowerSchemeGuideWindow CreatePowerSchemeGuideWindow(); CatalogPage CreateCatalogPage(string searchKeyword); CatalogPageViewModel CreateCatalogPageViewModel(string searchKeyword); QuickStartPage CreateQuickStartPage(); diff --git a/src/TableCloth.App/Components/Implementations/AppUserInterface.cs b/src/TableCloth.App/Components/Implementations/AppUserInterface.cs index 27d01186..9da8b174 100644 --- a/src/TableCloth.App/Components/Implementations/AppUserInterface.cs +++ b/src/TableCloth.App/Components/Implementations/AppUserInterface.cs @@ -53,6 +53,9 @@ public InputPasswordWindow CreateInputPasswordWindow() public DisclaimerWindow CreateDisclaimerWindow() => SetOwnerIfAvailable(serviceProvider.GetRequiredService()); + public PowerSchemeGuideWindow CreatePowerSchemeGuideWindow() + => SetOwnerIfAvailable(serviceProvider.GetRequiredService()); + public SplashScreen CreateSplashScreen() => SetOwnerIfAvailable(serviceProvider.GetRequiredService()); diff --git a/src/TableCloth.App/Components/Implementations/SandboxLauncher.cs b/src/TableCloth.App/Components/Implementations/SandboxLauncher.cs index c5eb278f..b4a74dd5 100644 --- a/src/TableCloth.App/Components/Implementations/SandboxLauncher.cs +++ b/src/TableCloth.App/Components/Implementations/SandboxLauncher.cs @@ -14,6 +14,8 @@ namespace TableCloth.Components.Implementations; public sealed class SandboxLauncher( IAppMessageBox appMessageBox, + IAppUserInterface appUserInterface, + IApplicationService applicationService, ISharedLocations sharedLocations, ISandboxBuilder sandboxBuilder, ISandboxCleanupManager sandboxCleanupManager, @@ -49,6 +51,12 @@ public async Task RunSandboxAsync(TableClothConfiguration config, CancellationTo return; } + // CPU 최대 성능이 제한(스로틀)되어 있으면, 시스템 메시지 박스 대신 전용 안내 창을 띄워 + // 클래식(powercfg.cpl)/모던(전원 및 절전) 전원 설정 중 하나를 골라 열 수 있게 안내한다. + // 백그라운드에서 호출될 수 있으므로 UI 스레드로 마샬링해 모달로 표시한다(런치는 계속 진행). + if (Helpers.IsSandboxCpuLikelyThrottled() == true) + applicationService.DispatchInvoke(() => appUserInterface.CreatePowerSchemeGuideWindow().ShowDialog(), []); + if (config.CertPair != null) { var now = DateTime.Now; diff --git a/src/TableCloth.App/DependencyInjection/UseTableClothExtensions.cs b/src/TableCloth.App/DependencyInjection/UseTableClothExtensions.cs index 0441f8d9..0709157a 100644 --- a/src/TableCloth.App/DependencyInjection/UseTableClothExtensions.cs +++ b/src/TableCloth.App/DependencyInjection/UseTableClothExtensions.cs @@ -73,6 +73,7 @@ public static IHostApplicationBuilder UseTableCloth(this IHostApplicationBuilder .AddWindow() .AddWindow() .AddWindow() + .AddWindow() .AddWindow() .AddWindow() .AddPage(addPageAsSingleton: true) diff --git a/src/TableCloth.App/Dialogs/PowerSchemeGuideWindow.xaml b/src/TableCloth.App/Dialogs/PowerSchemeGuideWindow.xaml new file mode 100644 index 00000000..b7051af6 --- /dev/null +++ b/src/TableCloth.App/Dialogs/PowerSchemeGuideWindow.xaml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +