mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-12 07:36:59 +00:00
add "overwrite mode" for the setup wizard, basically this just ignores the precondition of having whatever the page configures before showing it.
i.e. if you had keys installed, previously it'd skip right to firmware. additionally added more customization to the now instance-based NotificationHelper
This commit is contained in:
parent
8d9d6b1afc
commit
07834ad4a2
5 changed files with 15 additions and 15 deletions
|
|
@ -22,12 +22,14 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||||
|
|
||||||
private readonly BlockingCollection<Notification> _notifications = new();
|
private readonly BlockingCollection<Notification> _notifications = new();
|
||||||
|
|
||||||
public NotificationHelper(Window host)
|
public NotificationHelper(Window host,
|
||||||
|
NotificationPosition visiblePosition = NotificationPosition.BottomRight,
|
||||||
|
int maxItems = MaxNotifications)
|
||||||
{
|
{
|
||||||
_notificationManager = new WindowNotificationManager(host)
|
_notificationManager = new WindowNotificationManager(host)
|
||||||
{
|
{
|
||||||
Position = NotificationPosition.BottomRight,
|
Position = visiblePosition,
|
||||||
MaxItems = MaxNotifications,
|
MaxItems = maxItems,
|
||||||
Margin = new Thickness(0, 0, 15, 40)
|
Margin = new Thickness(0, 0, 15, 40)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,15 +7,13 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ryujinx.Ava.UI.SetupWizard
|
namespace Ryujinx.Ava.UI.SetupWizard
|
||||||
{
|
{
|
||||||
public class RyujinxSetupWizard(RyujinxSetupWizardWindow wizardWindow)
|
public class RyujinxSetupWizard(RyujinxSetupWizardWindow wizardWindow, bool overwriteMode)
|
||||||
{
|
{
|
||||||
private readonly MainWindow _mainWindow = RyujinxApp.MainWindow;
|
|
||||||
|
|
||||||
private bool _configWasModified;
|
private bool _configWasModified;
|
||||||
|
|
||||||
public bool HasFirmware => _mainWindow.ContentManager.GetCurrentFirmwareVersion() != null;
|
public bool HasFirmware => RyujinxApp.MainWindow.ContentManager.GetCurrentFirmwareVersion() != null;
|
||||||
|
|
||||||
public NotificationHelper NotificationHelper { get; private set; }
|
public NotificationHelper Notification { get; private set; }
|
||||||
|
|
||||||
public async Task Start()
|
public async Task Start()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,23 +23,23 @@ namespace Ryujinx.Ava.UI.SetupWizard
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Task ShowAsync(Window owner = null)
|
public static Task ShowAsync(bool overwriteMode, Window owner = null)
|
||||||
{
|
{
|
||||||
if (!CanShowSetupWizard)
|
if (!CanShowSetupWizard)
|
||||||
return Task.CompletedTask;
|
return Task.CompletedTask;
|
||||||
|
|
||||||
Task windowTask = ShowAsync(
|
Task windowTask = ShowAsync(
|
||||||
CreateWindow(out RyujinxSetupWizard wiz),
|
CreateWindow(out RyujinxSetupWizard wiz, overwriteMode),
|
||||||
owner
|
owner
|
||||||
);
|
);
|
||||||
_ = wiz.Start();
|
_ = wiz.Start();
|
||||||
return windowTask;
|
return windowTask;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RyujinxSetupWizardWindow CreateWindow(out RyujinxSetupWizard setupWizard)
|
public static RyujinxSetupWizardWindow CreateWindow(out RyujinxSetupWizard setupWizard, bool overwriteMode = false)
|
||||||
{
|
{
|
||||||
RyujinxSetupWizardWindow window = new();
|
RyujinxSetupWizardWindow window = new();
|
||||||
window.DataContext = setupWizard = new RyujinxSetupWizard(window);
|
window.DataContext = setupWizard = new RyujinxSetupWizard(window, overwriteMode);
|
||||||
window.Height = 600;
|
window.Height = 600;
|
||||||
window.Width = 750;
|
window.Width = 750;
|
||||||
return window;
|
return window;
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace Ryujinx.Ava.UI.SetupWizard
|
||||||
where TControl : RyujinxControl<TViewModel>, new()
|
where TControl : RyujinxControl<TViewModel>, new()
|
||||||
where TViewModel : SetupWizardPageContext, new()
|
where TViewModel : SetupWizardPageContext, new()
|
||||||
{
|
{
|
||||||
boundViewModel = new() { Notifications = ownerWizard.NotificationHelper };
|
boundViewModel = new() { Notifications = ownerWizard.Notification };
|
||||||
|
|
||||||
return WithContent<TControl>(boundViewModel);
|
return WithContent<TControl>(boundViewModel);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||||
AboutWindowMenuItem.Command = Commands.Create(AboutView.Show);
|
AboutWindowMenuItem.Command = Commands.Create(AboutView.Show);
|
||||||
CompatibilityListMenuItem.Command = Commands.Create(() => CompatibilityListWindow.Show());
|
CompatibilityListMenuItem.Command = Commands.Create(() => CompatibilityListWindow.Show());
|
||||||
LdnGameListMenuItem.Command = Commands.Create(() => LdnGamesListWindow.Show());
|
LdnGameListMenuItem.Command = Commands.Create(() => LdnGamesListWindow.Show());
|
||||||
SetupWizardMenuItem.Command = Commands.Create(() => RyujinxSetupWizardWindow.ShowAsync());
|
SetupWizardMenuItem.Command = Commands.Create(() => RyujinxSetupWizardWindow.ShowAsync(overwriteMode: true));
|
||||||
|
|
||||||
UpdateMenuItem.Command = MainWindowViewModel.UpdateCommand;
|
UpdateMenuItem.Command = MainWindowViewModel.UpdateCommand;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue