mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-12-16 01:36:57 +00:00
Initial work on a setup wizard
Setup wizard abstraction & architecture from TKMM
This commit is contained in:
parent
52700f71dc
commit
aee46e16cd
19 changed files with 743 additions and 10 deletions
34
src/Ryujinx/UI/SetupWizard/Pages/SetupKeysPageViewModel.cs
Normal file
34
src/Ryujinx/UI/SetupWizard/Pages/SetupKeysPageViewModel.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue