mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-05-17 10:45:46 +00:00
reorganize RyujinxSetupWizard
additionally, the CreateHelpContent method is now no longer locked to returning an Avalonia `Control`. the WithHelpContent method also has logic to handle it returning a string directly, and will wrap it in a textblock with h1 style and size 20 font. otherwise it's up to the ContentPresenter for the help content to choose how to display it if it's none of the above mentioned types.
This commit is contained in:
57
src/Ryujinx/UI/SetupWizard/RyujinxSetupWizard.Steps.cs
Normal file
57
src/Ryujinx/UI/SetupWizard/RyujinxSetupWizard.Steps.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using Ryujinx.Ava.Common.Locale;
|
||||
using Ryujinx.Ava.UI.SetupWizard.Pages;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Ryujinx.Ava.UI.SetupWizard
|
||||
{
|
||||
public partial class RyujinxSetupWizard
|
||||
{
|
||||
private async ValueTask<bool> SetupKeys()
|
||||
{
|
||||
if (_overwrite || !RyujinxApp.MainWindow.VirtualFileSystem.HasKeySet)
|
||||
{
|
||||
Retry:
|
||||
bool result = await NextPage()
|
||||
.WithTitle(LocaleKeys.SetupWizardKeysPageTitle)
|
||||
.WithContent<SetupKeysPage, SetupKeysPageContext>(out SetupKeysPageContext keyContext)
|
||||
.Show();
|
||||
|
||||
if (!result)
|
||||
return false;
|
||||
|
||||
if (!keyContext.CompleteStep())
|
||||
goto Retry;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private async ValueTask<bool> SetupFirmware()
|
||||
{
|
||||
if (_overwrite || !HasFirmware)
|
||||
{
|
||||
if (!RyujinxApp.MainWindow.VirtualFileSystem.HasKeySet)
|
||||
{
|
||||
NotificationManager.Error("Keys still seem to not be installed. Please try again.");
|
||||
return false;
|
||||
}
|
||||
|
||||
Retry:
|
||||
bool result = await NextPage()
|
||||
.WithTitle(LocaleKeys.SetupWizardFirmwarePageTitle)
|
||||
.WithContent<SetupFirmwarePage, SetupFirmwarePageContext>(out SetupFirmwarePageContext fwContext)
|
||||
.Show();
|
||||
|
||||
if (!result)
|
||||
return false;
|
||||
|
||||
if (!fwContext.CompleteStep())
|
||||
goto Retry;
|
||||
|
||||
OnPropertyChanged(nameof(HasFirmware));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user