mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-04-30 02:22:55 +00:00
Setup Wizard restructuring
- Remove polymorphic base, this only existed because TKMM has a desktop/switch setup prodecure difference and has 2 implementations of the setup wizard. We only need one. - Remove Systems/UI file split, they're all in Ryujinx.Ava.UI now - made NotificationHelper instance-based to allow you to encapsulate notifications to a window that magically disappear when the window is closed, instead of switching to showing on the main window.
This commit is contained in:
@@ -4,8 +4,6 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Gommon;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Systems.SetupWizard;
|
||||
using Ryujinx.Ava.UI.Helpers;
|
||||
using Ryujinx.Ava.Utilities;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
@@ -81,14 +79,14 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
|
||||
SystemVersion installedFwVer = RyujinxApp.MainWindow.ContentManager.GetCurrentFirmwareVersion();
|
||||
if (installedFwVer != null)
|
||||
{
|
||||
NotificationHelper.ShowInformation(
|
||||
Notifications.NotifyInformation(
|
||||
"Firmware installed",
|
||||
$"Installed firmware version {installedFwVer.VersionString}."
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
NotificationHelper.ShowError(
|
||||
Notifications.NotifyError(
|
||||
"Firmware not installed",
|
||||
$"It seems some error occurred when trying to install the firmware at path '{FirmwareSourcePath}'." +
|
||||
"\nDid that folder contain a firmware dump?"
|
||||
@@ -96,9 +94,6 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
|
||||
}
|
||||
RyujinxApp.MainWindow.ViewModel.RefreshFirmwareStatus(installedFwVer, allowNullVersion: true);
|
||||
|
||||
if (installedFwVer is null)
|
||||
return Result.Fail;
|
||||
|
||||
// Purge Applet Cache.
|
||||
|
||||
DirectoryInfo miiEditorCacheFolder = new(
|
||||
@@ -112,7 +107,7 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
NotificationHelper.ShowError(e.Message, waitingExit: true);
|
||||
Notifications.NotifyError(e.Message, waitingExit: true);
|
||||
return Result.Fail;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ using CommunityToolkit.Mvvm.Input;
|
||||
using DynamicData;
|
||||
using Gommon;
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.Systems.SetupWizard;
|
||||
using Ryujinx.Ava.UI.Helpers;
|
||||
using Ryujinx.Ava.Utilities;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Logging;
|
||||
@@ -42,7 +40,7 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
|
||||
}
|
||||
}
|
||||
|
||||
private static Result InstallKeys(string directory)
|
||||
private Result InstallKeys(string directory)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -57,18 +55,18 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
|
||||
|
||||
ContentManager.InstallKeys(directory, systemDirectory);
|
||||
|
||||
NotificationHelper.ShowInformation(
|
||||
Notifications.NotifyInformation(
|
||||
title: LocaleManager.Instance[LocaleKeys.RyujinxInfo],
|
||||
text: LocaleManager.Instance[LocaleKeys.DialogKeysInstallerKeysInstallSuccessMessage]);
|
||||
}
|
||||
catch (InvalidFirmwarePackageException ifwpe)
|
||||
{
|
||||
NotificationHelper.ShowError(ifwpe.Message, waitingExit: true);
|
||||
Notifications.NotifyError(ifwpe.Message, waitingExit: true);
|
||||
return Result.Failure(NoKeysFoundInFolder.Shared);
|
||||
}
|
||||
catch (MissingKeyException ex)
|
||||
{
|
||||
NotificationHelper.ShowError(ex.ToString(), waitingExit: true);
|
||||
Notifications.NotifyError(ex.ToString(), waitingExit: true);
|
||||
return Result.Failure(NoKeysFoundInFolder.Shared);
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -80,7 +78,7 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
|
||||
LocaleKeys.DialogKeysInstallerKeysNotFoundErrorMessage, directory);
|
||||
}
|
||||
|
||||
NotificationHelper.ShowError(message, waitingExit: true);
|
||||
Notifications.NotifyError(message, waitingExit: true);
|
||||
|
||||
return Result.Failure(new MessageError(message));
|
||||
}
|
||||
Reference in New Issue
Block a user