From cee712105850ac3385cd0091a923438167433f9f Mon Sep 17 00:00:00 2001
From: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
Date: Sat, 8 Apr 2023 01:22:00 +0200
Subject: Move solution and projects to src
---
Ryujinx.Ava/UI/Views/User/UserEditorView.axaml | 123 ------------
Ryujinx.Ava/UI/Views/User/UserEditorView.axaml.cs | 165 ----------------
.../User/UserFirmwareAvatarSelectorView.axaml | 114 -----------
.../User/UserFirmwareAvatarSelectorView.axaml.cs | 88 ---------
.../Views/User/UserProfileImageSelectorView.axaml | 63 ------
.../User/UserProfileImageSelectorView.axaml.cs | 124 ------------
Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml | 83 --------
.../UI/Views/User/UserRecovererView.axaml.cs | 51 -----
.../UI/Views/User/UserSaveManagerView.axaml | 215 ---------------------
.../UI/Views/User/UserSaveManagerView.axaml.cs | 147 --------------
Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml | 165 ----------------
.../UI/Views/User/UserSelectorView.axaml.cs | 128 ------------
12 files changed, 1466 deletions(-)
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserEditorView.axaml
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserEditorView.axaml.cs
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml.cs
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml.cs
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml.cs
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml
delete mode 100644 Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml.cs
(limited to 'Ryujinx.Ava/UI/Views/User')
diff --git a/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml b/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml
deleted file mode 100644
index 7e55f25e..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml
+++ /dev/null
@@ -1,123 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml.cs b/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml.cs
deleted file mode 100644
index 81938d23..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserEditorView.axaml.cs
+++ /dev/null
@@ -1,165 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Data;
-using Avalonia.Interactivity;
-using FluentAvalonia.UI.Controls;
-using FluentAvalonia.UI.Navigation;
-using Ryujinx.Ava.Common.Locale;
-using Ryujinx.Ava.UI.Controls;
-using Ryujinx.Ava.UI.Helpers;
-using Ryujinx.Ava.UI.Models;
-using Ryujinx.HLE.HOS.Services.Account.Acc;
-using System;
-using UserProfile = Ryujinx.Ava.UI.Models.UserProfile;
-
-namespace Ryujinx.Ava.UI.Views.User
-{
- public partial class UserEditorView : UserControl
- {
- private NavigationDialogHost _parent;
- private UserProfile _profile;
- private bool _isNewUser;
-
- public TempProfile TempProfile { get; set; }
- public uint MaxProfileNameLength => 0x20;
- public bool IsDeletable => _profile.UserId != AccountManager.DefaultUserId;
-
- public UserEditorView()
- {
- InitializeComponent();
- AddHandler(Frame.NavigatedToEvent, (s, e) =>
- {
- NavigatedTo(e);
- }, RoutingStrategies.Direct);
- }
-
- private void NavigatedTo(NavigationEventArgs arg)
- {
- if (Program.PreviewerDetached)
- {
- switch (arg.NavigationMode)
- {
- case NavigationMode.New:
- var args = ((NavigationDialogHost parent, UserProfile profile, bool isNewUser))arg.Parameter;
- _isNewUser = args.isNewUser;
- _profile = args.profile;
- TempProfile = new TempProfile(_profile);
-
- _parent = args.parent;
- break;
- }
-
- ((ContentDialog)_parent.Parent).Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - " +
- $"{ (_isNewUser ? LocaleManager.Instance[LocaleKeys.UserEditorTitleCreate] : LocaleManager.Instance[LocaleKeys.UserEditorTitle])}";
-
- DataContext = TempProfile;
-
- AddPictureButton.IsVisible = _isNewUser;
- ChangePictureButton.IsVisible = !_isNewUser;
- IdLabel.IsVisible = _profile != null;
- IdText.IsVisible = _profile != null;
- if (!_isNewUser && IsDeletable)
- {
- DeleteButton.IsVisible = true;
- }
- else
- {
- DeleteButton.IsVisible = false;
- }
- }
- }
-
- private async void BackButton_Click(object sender, RoutedEventArgs e)
- {
- if (_isNewUser)
- {
- if (TempProfile.Name != String.Empty || TempProfile.Image != null)
- {
- if (await ContentDialogHelper.CreateChoiceDialog(
- LocaleManager.Instance[LocaleKeys.DialogUserProfileUnsavedChangesTitle],
- LocaleManager.Instance[LocaleKeys.DialogUserProfileUnsavedChangesMessage],
- LocaleManager.Instance[LocaleKeys.DialogUserProfileUnsavedChangesSubMessage]))
- {
- _parent?.GoBack();
- }
- }
- else
- {
- _parent?.GoBack();
- }
- }
- else
- {
- if (_profile.Name != TempProfile.Name || _profile.Image != TempProfile.Image)
- {
- if (await ContentDialogHelper.CreateChoiceDialog(
- LocaleManager.Instance[LocaleKeys.DialogUserProfileUnsavedChangesTitle],
- LocaleManager.Instance[LocaleKeys.DialogUserProfileUnsavedChangesMessage],
- LocaleManager.Instance[LocaleKeys.DialogUserProfileUnsavedChangesSubMessage]))
- {
- _parent?.GoBack();
- }
- }
- else
- {
- _parent?.GoBack();
- }
- }
- }
-
- private void DeleteButton_Click(object sender, RoutedEventArgs e)
- {
- _parent.DeleteUser(_profile);
- }
-
- private void SaveButton_Click(object sender, RoutedEventArgs e)
- {
- DataValidationErrors.ClearErrors(NameBox);
-
- if (string.IsNullOrWhiteSpace(TempProfile.Name))
- {
- DataValidationErrors.SetError(NameBox, new DataValidationException(LocaleManager.Instance[LocaleKeys.UserProfileEmptyNameError]));
-
- return;
- }
-
- if (TempProfile.Image == null)
- {
- _parent.Navigate(typeof(UserProfileImageSelectorView), (_parent, TempProfile));
-
- return;
- }
-
- if (_profile != null && !_isNewUser)
- {
- _profile.Name = TempProfile.Name;
- _profile.Image = TempProfile.Image;
- _profile.UpdateState();
- _parent.AccountManager.SetUserName(_profile.UserId, _profile.Name);
- _parent.AccountManager.SetUserImage(_profile.UserId, _profile.Image);
- }
- else if (_isNewUser)
- {
- _parent.AccountManager.AddUser(TempProfile.Name, TempProfile.Image, TempProfile.UserId);
- }
- else
- {
- return;
- }
-
- _parent?.GoBack();
- }
-
- public void SelectProfileImage()
- {
- _parent.Navigate(typeof(UserProfileImageSelectorView), (_parent, TempProfile));
- }
-
- private void ChangePictureButton_Click(object sender, RoutedEventArgs e)
- {
- if (_profile != null || _isNewUser)
- {
- SelectProfileImage();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml b/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml
deleted file mode 100644
index d46fcefc..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml.cs b/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml.cs
deleted file mode 100644
index 7c9191ab..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserFirmwareAvatarSelectorView.axaml.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Interactivity;
-using FluentAvalonia.UI.Controls;
-using FluentAvalonia.UI.Navigation;
-using Ryujinx.Ava.UI.Controls;
-using Ryujinx.Ava.UI.Models;
-using Ryujinx.Ava.UI.ViewModels;
-using Ryujinx.HLE.FileSystem;
-using SixLabors.ImageSharp;
-using SixLabors.ImageSharp.Formats.Png;
-using SixLabors.ImageSharp.PixelFormats;
-using SixLabors.ImageSharp.Processing;
-using System.IO;
-
-namespace Ryujinx.Ava.UI.Views.User
-{
- public partial class UserFirmwareAvatarSelectorView : UserControl
- {
- private NavigationDialogHost _parent;
- private TempProfile _profile;
-
- public UserFirmwareAvatarSelectorView(ContentManager contentManager)
- {
- ContentManager = contentManager;
-
- DataContext = ViewModel;
-
- InitializeComponent();
- }
-
- public UserFirmwareAvatarSelectorView()
- {
- InitializeComponent();
-
- AddHandler(Frame.NavigatedToEvent, (s, e) =>
- {
- NavigatedTo(e);
- }, RoutingStrategies.Direct);
- }
-
- private void NavigatedTo(NavigationEventArgs arg)
- {
- if (Program.PreviewerDetached)
- {
- if (arg.NavigationMode == NavigationMode.New)
- {
- (_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter;
- ContentManager = _parent.ContentManager;
- if (Program.PreviewerDetached)
- {
- ViewModel = new UserFirmwareAvatarSelectorViewModel();
- }
-
- DataContext = ViewModel;
- }
- }
- }
-
- public ContentManager ContentManager { get; private set; }
-
- internal UserFirmwareAvatarSelectorViewModel ViewModel { get; set; }
-
- private void GoBack(object sender, RoutedEventArgs e)
- {
- _parent.GoBack();
- }
-
- private void ChooseButton_OnClick(object sender, RoutedEventArgs e)
- {
- if (ViewModel.SelectedImage != null)
- {
- MemoryStream streamJpg = new();
- SixLabors.ImageSharp.Image avatarImage = SixLabors.ImageSharp.Image.Load(ViewModel.SelectedImage, new PngDecoder());
-
- avatarImage.Mutate(x => x.BackgroundColor(new Rgba32(
- ViewModel.BackgroundColor.R,
- ViewModel.BackgroundColor.G,
- ViewModel.BackgroundColor.B,
- ViewModel.BackgroundColor.A)));
- avatarImage.SaveAsJpeg(streamJpg);
-
- _profile.Image = streamJpg.ToArray();
-
- _parent.GoBack();
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml b/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml
deleted file mode 100644
index b9f51fdc..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml.cs b/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml.cs
deleted file mode 100644
index 18f76f80..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserProfileImageSelectorView.axaml.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Interactivity;
-using Avalonia.VisualTree;
-using FluentAvalonia.UI.Controls;
-using FluentAvalonia.UI.Navigation;
-using Ryujinx.Ava.Common.Locale;
-using Ryujinx.Ava.UI.Controls;
-using Ryujinx.Ava.UI.Models;
-using Ryujinx.Ava.UI.ViewModels;
-using Ryujinx.HLE.FileSystem;
-using SixLabors.ImageSharp;
-using SixLabors.ImageSharp.Processing;
-using System.IO;
-using Image = SixLabors.ImageSharp.Image;
-
-namespace Ryujinx.Ava.UI.Views.User
-{
- public partial class UserProfileImageSelectorView : UserControl
- {
- private ContentManager _contentManager;
- private NavigationDialogHost _parent;
- private TempProfile _profile;
-
- internal UserProfileImageSelectorViewModel ViewModel { get; private set; }
-
- public UserProfileImageSelectorView()
- {
- InitializeComponent();
- AddHandler(Frame.NavigatedToEvent, (s, e) =>
- {
- NavigatedTo(e);
- }, RoutingStrategies.Direct);
- }
-
- private void NavigatedTo(NavigationEventArgs arg)
- {
- if (Program.PreviewerDetached)
- {
- switch (arg.NavigationMode)
- {
- case NavigationMode.New:
- (_parent, _profile) = ((NavigationDialogHost, TempProfile))arg.Parameter;
- _contentManager = _parent.ContentManager;
-
- ((ContentDialog)_parent.Parent).Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - {LocaleManager.Instance[LocaleKeys.ProfileImageSelectionHeader]}";
-
- if (Program.PreviewerDetached)
- {
- DataContext = ViewModel = new UserProfileImageSelectorViewModel();
- ViewModel.FirmwareFound = _contentManager.GetCurrentFirmwareVersion() != null;
- }
-
- break;
- case NavigationMode.Back:
- if (_profile.Image != null)
- {
- _parent.GoBack();
- }
- break;
- }
- }
- }
-
- private async void Import_OnClick(object sender, RoutedEventArgs e)
- {
- OpenFileDialog dialog = new();
- dialog.Filters.Add(new FileDialogFilter
- {
- Name = LocaleManager.Instance[LocaleKeys.AllSupportedFormats],
- Extensions = { "jpg", "jpeg", "png", "bmp" }
- });
- dialog.Filters.Add(new FileDialogFilter { Name = "JPEG", Extensions = { "jpg", "jpeg" } });
- dialog.Filters.Add(new FileDialogFilter { Name = "PNG", Extensions = { "png" } });
- dialog.Filters.Add(new FileDialogFilter { Name = "BMP", Extensions = { "bmp" } });
-
- dialog.AllowMultiple = false;
-
- string[] image = await dialog.ShowAsync(((TopLevel)_parent.GetVisualRoot()) as Window);
-
- if (image != null)
- {
- if (image.Length > 0)
- {
- string imageFile = image[0];
-
- _profile.Image = ProcessProfileImage(File.ReadAllBytes(imageFile));
-
- if (_profile.Image != null)
- {
- _parent.GoBack();
- }
- }
- }
- }
-
- private void GoBack(object sender, RoutedEventArgs e)
- {
- _parent.GoBack();
- }
-
- private void SelectFirmwareImage_OnClick(object sender, RoutedEventArgs e)
- {
- if (ViewModel.FirmwareFound)
- {
- _parent.Navigate(typeof(UserFirmwareAvatarSelectorView), (_parent, _profile));
- }
- }
-
- private static byte[] ProcessProfileImage(byte[] buffer)
- {
- using (Image image = Image.Load(buffer))
- {
- image.Mutate(x => x.Resize(256, 256));
-
- using (MemoryStream streamJpg = new())
- {
- image.SaveAsJpeg(streamJpg);
-
- return streamJpg.ToArray();
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml b/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml
deleted file mode 100644
index 62b5e184..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml.cs b/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml.cs
deleted file mode 100644
index 0c53e53d..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserRecovererView.axaml.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Interactivity;
-using FluentAvalonia.UI.Controls;
-using FluentAvalonia.UI.Navigation;
-using Ryujinx.Ava.Common.Locale;
-using Ryujinx.Ava.UI.Controls;
-
-namespace Ryujinx.Ava.UI.Views.User
-{
- public partial class UserRecovererView : UserControl
- {
- private NavigationDialogHost _parent;
-
- public UserRecovererView()
- {
- InitializeComponent();
- AddHandler(Frame.NavigatedToEvent, (s, e) =>
- {
- NavigatedTo(e);
- }, RoutingStrategies.Direct);
- }
-
- private void NavigatedTo(NavigationEventArgs arg)
- {
- if (Program.PreviewerDetached)
- {
- switch (arg.NavigationMode)
- {
- case NavigationMode.New:
- var parent = (NavigationDialogHost)arg.Parameter;
-
- _parent = parent;
-
- ((ContentDialog)_parent.Parent).Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - {LocaleManager.Instance[LocaleKeys.UserProfilesRecoverHeading]}";
-
- break;
- }
- }
- }
-
- private void GoBack(object sender, RoutedEventArgs e)
- {
- _parent?.GoBack();
- }
-
- private void Recover(object sender, RoutedEventArgs e)
- {
- _parent?.RecoverLostAccounts();
- }
- }
-}
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml b/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml
deleted file mode 100644
index ec931dd9..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml
+++ /dev/null
@@ -1,215 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs b/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs
deleted file mode 100644
index 08fef27d..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserSaveManagerView.axaml.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Interactivity;
-using Avalonia.Threading;
-using FluentAvalonia.UI.Controls;
-using FluentAvalonia.UI.Navigation;
-using LibHac;
-using LibHac.Common;
-using LibHac.Fs;
-using LibHac.Fs.Shim;
-using Ryujinx.Ava.Common;
-using Ryujinx.Ava.Common.Locale;
-using Ryujinx.Ava.UI.Controls;
-using Ryujinx.Ava.UI.Helpers;
-using Ryujinx.Ava.UI.Models;
-using Ryujinx.Ava.UI.ViewModels;
-using Ryujinx.HLE.FileSystem;
-using Ryujinx.HLE.HOS.Services.Account.Acc;
-using System;
-using System.Collections.ObjectModel;
-using System.Threading.Tasks;
-using UserId = LibHac.Fs.UserId;
-
-namespace Ryujinx.Ava.UI.Views.User
-{
- public partial class UserSaveManagerView : UserControl
- {
- internal UserSaveManagerViewModel ViewModel { get; private set; }
-
- private AccountManager _accountManager;
- private HorizonClient _horizonClient;
- private VirtualFileSystem _virtualFileSystem;
- private NavigationDialogHost _parent;
-
- public UserSaveManagerView()
- {
- InitializeComponent();
- AddHandler(Frame.NavigatedToEvent, (s, e) =>
- {
- NavigatedTo(e);
- }, RoutingStrategies.Direct);
- }
-
- private void NavigatedTo(NavigationEventArgs arg)
- {
- if (Program.PreviewerDetached)
- {
- switch (arg.NavigationMode)
- {
- case NavigationMode.New:
- var args = ((NavigationDialogHost parent, AccountManager accountManager, HorizonClient client, VirtualFileSystem virtualFileSystem))arg.Parameter;
- _accountManager = args.accountManager;
- _horizonClient = args.client;
- _virtualFileSystem = args.virtualFileSystem;
-
- _parent = args.parent;
- break;
- }
-
- DataContext = ViewModel = new UserSaveManagerViewModel(_accountManager);
- ((ContentDialog)_parent.Parent).Title = $"{LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle]} - {ViewModel.SaveManagerHeading}";
-
- Task.Run(LoadSaves);
- }
- }
-
- public void LoadSaves()
- {
- ViewModel.Saves.Clear();
- var saves = new ObservableCollection();
- var saveDataFilter = SaveDataFilter.Make(
- programId: default,
- saveType: SaveDataType.Account,
- new UserId((ulong)_accountManager.LastOpenedUser.UserId.High, (ulong)_accountManager.LastOpenedUser.UserId.Low),
- saveDataId: default,
- index: default);
-
- using var saveDataIterator = new UniqueRef();
-
- _horizonClient.Fs.OpenSaveDataIterator(ref saveDataIterator.Ref, SaveDataSpaceId.User, in saveDataFilter).ThrowIfFailure();
-
- Span saveDataInfo = stackalloc SaveDataInfo[10];
-
- while (true)
- {
- saveDataIterator.Get.ReadSaveDataInfo(out long readCount, saveDataInfo).ThrowIfFailure();
-
- if (readCount == 0)
- {
- break;
- }
-
- for (int i = 0; i < readCount; i++)
- {
- var save = saveDataInfo[i];
- if (save.ProgramId.Value != 0)
- {
- var saveModel = new SaveModel(save, _virtualFileSystem);
- saves.Add(saveModel);
- }
- }
- }
-
- Dispatcher.UIThread.Post(() =>
- {
- ViewModel.Saves = saves;
- ViewModel.Sort();
- });
- }
-
- private void GoBack(object sender, RoutedEventArgs e)
- {
- _parent?.GoBack();
- }
-
- private void OpenLocation(object sender, RoutedEventArgs e)
- {
- if (sender is Avalonia.Controls.Button button)
- {
- if (button.DataContext is SaveModel saveModel)
- {
- ApplicationHelper.OpenSaveDir(saveModel.SaveId);
- }
- }
- }
-
- private async void Delete(object sender, RoutedEventArgs e)
- {
- if (sender is Avalonia.Controls.Button button)
- {
- if (button.DataContext is SaveModel saveModel)
- {
- var result = await ContentDialogHelper.CreateConfirmationDialog(LocaleManager.Instance[LocaleKeys.DeleteUserSave],
- LocaleManager.Instance[LocaleKeys.IrreversibleActionNote],
- LocaleManager.Instance[LocaleKeys.InputDialogYes],
- LocaleManager.Instance[LocaleKeys.InputDialogNo], "");
-
- if (result == UserResult.Yes)
- {
- _horizonClient.Fs.DeleteSaveData(SaveDataSpaceId.User, saveModel.SaveId);
- ViewModel.Saves.Remove(saveModel);
- ViewModel.Sort();
- }
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml b/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml
deleted file mode 100644
index 9a6ba054..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml
+++ /dev/null
@@ -1,165 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml.cs b/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml.cs
deleted file mode 100644
index aa89fea9..00000000
--- a/Ryujinx.Ava/UI/Views/User/UserSelectorView.axaml.cs
+++ /dev/null
@@ -1,128 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Input;
-using Avalonia.Interactivity;
-using FluentAvalonia.UI.Controls;
-using FluentAvalonia.UI.Navigation;
-using Ryujinx.Ava.Common.Locale;
-using Ryujinx.Ava.UI.Controls;
-using Ryujinx.Ava.UI.ViewModels;
-using UserProfile = Ryujinx.Ava.UI.Models.UserProfile;
-
-namespace Ryujinx.Ava.UI.Views.User
-{
- public partial class UserSelectorViews : UserControl
- {
- private NavigationDialogHost _parent;
-
- public UserProfileViewModel ViewModel { get; set; }
-
- public UserSelectorViews()
- {
- InitializeComponent();
-
- if (Program.PreviewerDetached)
- {
- AddHandler(Frame.NavigatedToEvent, (s, e) =>
- {
- NavigatedTo(e);
- }, RoutingStrategies.Direct);
- }
- }
-
- private void NavigatedTo(NavigationEventArgs arg)
- {
- if (Program.PreviewerDetached)
- {
- if (arg.NavigationMode == NavigationMode.New)
- {
- _parent = (NavigationDialogHost)arg.Parameter;
- ViewModel = _parent.ViewModel;
- }
-
- if (arg.NavigationMode == NavigationMode.Back)
- {
- ((ContentDialog)_parent.Parent).Title = LocaleManager.Instance[LocaleKeys.UserProfileWindowTitle];
- }
-
- DataContext = ViewModel;
- }
- }
-
- private void Grid_PointerEntered(object sender, PointerEventArgs e)
- {
- if (sender is Grid grid)
- {
- if (grid.DataContext is UserProfile profile)
- {
- profile.IsPointerOver = true;
- }
- }
- }
-
- private void Grid_OnPointerExited(object sender, PointerEventArgs e)
- {
- if (sender is Grid grid)
- {
- if (grid.DataContext is UserProfile profile)
- {
- profile.IsPointerOver = false;
- }
- }
- }
-
- private void ProfilesList_SelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- if (sender is ListBox listBox)
- {
- int selectedIndex = listBox.SelectedIndex;
-
- if (selectedIndex >= 0 && selectedIndex < ViewModel.Profiles.Count)
- {
- if (ViewModel.Profiles[selectedIndex] is UserProfile userProfile)
- {
- _parent?.AccountManager?.OpenUser(userProfile.UserId);
-
- foreach (BaseModel profile in ViewModel.Profiles)
- {
- if (profile is UserProfile uProfile)
- {
- uProfile.UpdateState();
- }
- }
- }
- }
- }
- }
-
- private void AddUser(object sender, RoutedEventArgs e)
- {
- _parent.AddUser();
- }
-
- private void EditUser(object sender, RoutedEventArgs e)
- {
- if (sender is Avalonia.Controls.Button button)
- {
- if (button.DataContext is UserProfile userProfile)
- {
- _parent.EditUser(userProfile);
- }
- }
- }
-
- private void ManageSaves(object sender, RoutedEventArgs e)
- {
- _parent.ManageSaves();
- }
-
- private void RecoverLostAccounts(object sender, RoutedEventArgs e)
- {
- _parent.RecoverLostAccounts();
- }
-
- private void Close(object sender, RoutedEventArgs e)
- {
- ((ContentDialog)_parent.Parent).Hide();
- }
- }
-}
\ No newline at end of file
--
cgit v1.2.3