rename NotificationHelper to RyujinxNotificationManager,

rename instance method names.
Additionally clarified what the math is in the notification manager margin parameter.
This commit is contained in:
GreemDev
2025-11-26 17:12:35 -06:00
parent 2f794794c6
commit d8a6364cca
12 changed files with 49 additions and 40 deletions

View File

@@ -79,14 +79,14 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
SystemVersion installedFwVer = RyujinxApp.MainWindow.ContentManager.GetCurrentFirmwareVersion();
if (installedFwVer != null)
{
Notifications.NotifyInformation(
NotificationManager.Information(
"Firmware installed",
$"Installed firmware version {installedFwVer.VersionString}."
);
}
else
{
Notifications.NotifyError(
NotificationManager.Error(
"Firmware not installed",
$"It seems some error occurred when trying to install the firmware at path '{FirmwareSourcePath}'." +
"\nDid that folder contain a firmware dump?"
@@ -107,7 +107,7 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
}
catch (Exception e)
{
Notifications.NotifyError(e.Message, waitingExit: true);
NotificationManager.Error(e.Message, waitingExit: true);
return Result.Fail;
}

View File

@@ -55,18 +55,18 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
ContentManager.InstallKeys(directory, systemDirectory);
Notifications.NotifyInformation(
NotificationManager.Information(
title: LocaleManager.Instance[LocaleKeys.RyujinxInfo],
text: LocaleManager.Instance[LocaleKeys.DialogKeysInstallerKeysInstallSuccessMessage]);
}
catch (InvalidFirmwarePackageException ifwpe)
{
Notifications.NotifyError(ifwpe.Message, waitingExit: true);
NotificationManager.Error(ifwpe.Message, waitingExit: true);
return Result.Failure(NoKeysFoundInFolder.Shared);
}
catch (MissingKeyException ex)
{
Notifications.NotifyError(ex.ToString(), waitingExit: true);
NotificationManager.Error(ex.ToString(), waitingExit: true);
return Result.Failure(NoKeysFoundInFolder.Shared);
}
catch (Exception ex)
@@ -78,7 +78,7 @@ namespace Ryujinx.Ava.UI.SetupWizard.Pages
LocaleKeys.DialogKeysInstallerKeysNotFoundErrorMessage, directory);
}
Notifications.NotifyError(message, waitingExit: true);
NotificationManager.Error(message, waitingExit: true);
return Result.Failure(new MessageError(message));
}

View File

@@ -14,14 +14,15 @@ namespace Ryujinx.Ava.UI.SetupWizard
public bool HasFirmware => RyujinxApp.MainWindow.ContentManager.GetCurrentFirmwareVersion() != null;
public NotificationHelper Notification { get; private set; }
public RyujinxNotificationManager NotificationManager { get; private set; }
public async Task Start()
{
Notification = new NotificationHelper(
wizardWindow,
NotificationManager = wizardWindow.CreateNotificationManager(
// I wanted to do bottom center but that...literally just shows top center? Okay.
NotificationPosition.TopCenter,
// Fuck it, weird window height hack to do it instead.
// 120 is not exact, just a random number. Looks fine though.
NotificationPosition.TopCenter,
margin: new Thickness(0, wizardWindow.Height - 120, 0, 0)
);
@@ -47,7 +48,7 @@ namespace Ryujinx.Ava.UI.SetupWizard
if (_configWasModified)
ConfigurationState.Instance.ToFileFormat().SaveConfig(Program.GlobalConfigurationPath);
Notification = null;
NotificationManager = null;
wizardWindow.Close();
RyujinxSetupWizardWindow.IsOpen = false;
}
@@ -78,7 +79,7 @@ namespace Ryujinx.Ava.UI.SetupWizard
{
if (!RyujinxApp.MainWindow.VirtualFileSystem.HasKeySet)
{
Notification.NotifyError("Keys still seem to not be installed. Please try again.");
NotificationManager.Error("Keys still seem to not be installed. Please try again.");
return false;
}

View File

@@ -48,7 +48,7 @@ namespace Ryujinx.Ava.UI.SetupWizard
where TControl : RyujinxControl<TViewModel>, new()
where TViewModel : SetupWizardPageContext, new()
{
boundViewModel = new() { Notifications = ownerWizard.Notification };
boundViewModel = new() { NotificationManager = ownerWizard.NotificationManager };
return WithContent<TControl>(boundViewModel);
}

View File

@@ -6,7 +6,7 @@ namespace Ryujinx.Ava.UI.SetupWizard
{
public abstract class SetupWizardPageContext : BaseModel
{
public NotificationHelper Notifications { get; init; }
public RyujinxNotificationManager NotificationManager { get; init; }
public abstract Result CompleteStep();
}