Initial work on a setup wizard

Setup wizard abstraction & architecture from TKMM
This commit is contained in:
GreemDev
2025-11-21 00:20:15 -06:00
parent 66f339d265
commit b033adbde7
19 changed files with 743 additions and 10 deletions

View File

@@ -0,0 +1,22 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pages="clr-namespace:Ryujinx.UI.SetupWizard.Pages"
xmlns:markup="clr-namespace:Ryujinx.Ava.Common.Markup"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Ryujinx.UI.SetupWizard.Pages.SetupKeysPage"
x:DataType="pages:SetupKeysPageViewModel">
<StackPanel>
<TextBlock Text="{markup:Locale SetupWizardKeysPageDescription}" Margin="0,0,0,10"/>
<Grid ColumnDefinitions="*,Auto">
<TextBox Name="KeysFolderPathField" Text="{Binding KeysFolderPath}" IsReadOnly="True" />
<Button Grid.Column="1"
Content="..."
Command="{Binding BrowseCommand}"
CommandParameter="{Binding #KeysFolderPathField}"
Margin="5,0,0,0"/>
</Grid>
</StackPanel>
</UserControl>

View File

@@ -0,0 +1,13 @@
using Ryujinx.Ava.UI.Controls;
namespace Ryujinx.UI.SetupWizard.Pages
{
public partial class SetupKeysPage : RyujinxControl<SetupKeysPageViewModel>
{
public SetupKeysPage()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,34 @@
using Avalonia.Controls;
using Avalonia.Platform.Storage;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Ryujinx.Ava;
using Ryujinx.Ava.Common.Locale;
using Ryujinx.Ava.UI.ViewModels;
using System.Threading.Tasks;
namespace Ryujinx.UI.SetupWizard.Pages
{
public partial class SetupKeysPageViewModel : BaseModel
{
[ObservableProperty]
public partial string? KeysFolderPath { get; set; }
[RelayCommand]
private static async Task Browse(TextBox tb)
{
var result = await RyujinxApp.MainWindow.ViewModel.StorageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions {
Title = LocaleManager.Instance[LocaleKeys.SetupWizardKeysPageFolderPopupTitle],
AllowMultiple = false
}) switch {
[var target] => target.TryGetLocalPath(),
_ => null
};
if (result is not null)
{
tb.Text = result;
}
}
}
}