misc: chore: Rename UserSelectorDialog to ProfileSelectorDialog
This commit is contained in:
parent
06d34a5992
commit
d3f84a1305
@ -278,12 +278,12 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
.ForEach(profile => profiles.Add(new Models.UserProfile(profile, nav)));
|
.ForEach(profile => profiles.Add(new Models.UserProfile(profile, nav)));
|
||||||
|
|
||||||
profiles.Add(new Models.UserProfile(guest, nav));
|
profiles.Add(new Models.UserProfile(guest, nav));
|
||||||
UserSelectorDialogViewModel viewModel = new()
|
ProfileSelectorDialogViewModel viewModel = new()
|
||||||
{
|
{
|
||||||
Profiles = profiles,
|
Profiles = profiles,
|
||||||
SelectedUserId = _parent.AccountManager.LastOpenedUser.UserId
|
SelectedUserId = _parent.AccountManager.LastOpenedUser.UserId
|
||||||
};
|
};
|
||||||
(selected, _) = await UserSelectorDialog.ShowInputDialog(viewModel);
|
(selected, _) = await ProfileSelectorDialog.ShowInputDialog(viewModel);
|
||||||
|
|
||||||
dialogCloseEvent.Set();
|
dialogCloseEvent.Set();
|
||||||
});
|
});
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<UserControl
|
<UserControl
|
||||||
x:Class="Ryujinx.Ava.UI.Applet.UserSelectorDialog"
|
x:Class="Ryujinx.Ava.UI.Applet.ProfileSelectorDialog"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
@ -12,9 +12,9 @@
|
|||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Focusable="True"
|
Focusable="True"
|
||||||
x:DataType="viewModels:UserSelectorDialogViewModel">
|
x:DataType="viewModels:ProfileSelectorDialogViewModel">
|
||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
<viewModels:UserSelectorDialogViewModel />
|
<viewModels:ProfileSelectorDialogViewModel />
|
||||||
</Design.DataContext>
|
</Design.DataContext>
|
||||||
|
|
||||||
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
@ -16,15 +16,15 @@ using UserProfileSft = Ryujinx.HLE.HOS.Services.Account.Acc.UserProfile;
|
|||||||
|
|
||||||
namespace Ryujinx.Ava.UI.Applet
|
namespace Ryujinx.Ava.UI.Applet
|
||||||
{
|
{
|
||||||
public partial class UserSelectorDialog : UserControl, INotifyPropertyChanged
|
public partial class ProfileSelectorDialog : UserControl
|
||||||
{
|
{
|
||||||
public UserSelectorDialogViewModel ViewModel { get; set; }
|
public ProfileSelectorDialogViewModel ViewModel { get; set; }
|
||||||
|
|
||||||
public UserSelectorDialog(UserSelectorDialogViewModel viewModel)
|
public ProfileSelectorDialog(ProfileSelectorDialogViewModel viewModel)
|
||||||
{
|
{
|
||||||
|
DataContext = ViewModel = viewModel;
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
ViewModel = viewModel;
|
|
||||||
DataContext = ViewModel;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Grid_PointerEntered(object sender, PointerEventArgs e)
|
private void Grid_PointerEntered(object sender, PointerEventArgs e)
|
||||||
@ -54,7 +54,7 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
if (ViewModel.Profiles[selectedIndex] is UserProfile userProfile)
|
if (ViewModel.Profiles[selectedIndex] is UserProfile userProfile)
|
||||||
{
|
{
|
||||||
ViewModel.SelectedUserId = userProfile.UserId;
|
ViewModel.SelectedUserId = userProfile.UserId;
|
||||||
Logger.Info?.Print(LogClass.UI, $"Selected user: {userProfile.UserId}");
|
Logger.Info?.Print(LogClass.UI, $"Selected: {userProfile.UserId}", "ProfileSelector");
|
||||||
|
|
||||||
ObservableCollection<BaseModel> newProfiles = [];
|
ObservableCollection<BaseModel> newProfiles = [];
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<(UserId Id, bool Result)> ShowInputDialog(UserSelectorDialogViewModel viewModel)
|
public static async Task<(UserId Id, bool Result)> ShowInputDialog(ProfileSelectorDialogViewModel viewModel)
|
||||||
{
|
{
|
||||||
ContentDialog contentDialog = new()
|
ContentDialog contentDialog = new()
|
||||||
{
|
{
|
||||||
@ -87,7 +87,7 @@ namespace Ryujinx.Ava.UI.Applet
|
|||||||
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.Continue],
|
PrimaryButtonText = LocaleManager.Instance[LocaleKeys.Continue],
|
||||||
SecondaryButtonText = string.Empty,
|
SecondaryButtonText = string.Empty,
|
||||||
CloseButtonText = LocaleManager.Instance[LocaleKeys.Cancel],
|
CloseButtonText = LocaleManager.Instance[LocaleKeys.Cancel],
|
||||||
Content = new UserSelectorDialog(viewModel),
|
Content = new ProfileSelectorDialog(viewModel),
|
||||||
Padding = new Thickness(0)
|
Padding = new Thickness(0)
|
||||||
};
|
};
|
||||||
|
|
@ -4,7 +4,7 @@ using System.Collections.ObjectModel;
|
|||||||
|
|
||||||
namespace Ryujinx.Ava.UI.ViewModels
|
namespace Ryujinx.Ava.UI.ViewModels
|
||||||
{
|
{
|
||||||
public partial class UserSelectorDialogViewModel : BaseModel
|
public partial class ProfileSelectorDialogViewModel : BaseModel
|
||||||
{
|
{
|
||||||
|
|
||||||
[ObservableProperty] private UserId _selectedUserId;
|
[ObservableProperty] private UserId _selectedUserId;
|
Loading…
x
Reference in New Issue
Block a user