From 6e02cac952f1a9a34d2777199dde657eba0784e6 Mon Sep 17 00:00:00 2001 From: Emmanuel Hansen Date: Sun, 24 Jul 2022 17:38:38 +0000 Subject: Avalonia - Use content dialog for user profile manager (#3455) * remove content dialog placeholder from all windows * remove redundant window argument * redesign user profile window * wip * use avalonia auto name generator * add edit and new user options * move profile image selection to content dialog * remove usings * fix updater * address review * adjust avatar dialog size * add validation for user editor * fix typo * Shorten some labels --- Ryujinx.Ava/Ui/ViewModels/ControllerSettingsViewModel.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'Ryujinx.Ava/Ui/ViewModels/ControllerSettingsViewModel.cs') diff --git a/Ryujinx.Ava/Ui/ViewModels/ControllerSettingsViewModel.cs b/Ryujinx.Ava/Ui/ViewModels/ControllerSettingsViewModel.cs index c570aa8d..a3abdd3b 100644 --- a/Ryujinx.Ava/Ui/ViewModels/ControllerSettingsViewModel.cs +++ b/Ryujinx.Ava/Ui/ViewModels/ControllerSettingsViewModel.cs @@ -327,12 +327,12 @@ namespace Ryujinx.Ava.Ui.ViewModels public async void ShowMotionConfig() { - await MotionSettingsWindow.Show(this, _owner.GetVisualRoot() as StyleableWindow); + await MotionSettingsWindow.Show(this); } public async void ShowRumbleConfig() { - await RumbleSettingsWindow.Show(this, _owner.GetVisualRoot() as StyleableWindow); + await RumbleSettingsWindow.Show(this); } private void LoadInputDriver() @@ -701,8 +701,8 @@ namespace Ryujinx.Ava.Ui.ViewModels catch (InvalidOperationException) { Logger.Error?.Print(LogClass.Configuration, $"Profile {ProfileName} is incompatible with the current input configuration system."); - await ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow, - String.Format(LocaleManager.Instance["DialogProfileInvalidProfileErrorMessage"], ProfileName)); + + await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance["DialogProfileInvalidProfileErrorMessage"], ProfileName)); return; } @@ -736,7 +736,7 @@ namespace Ryujinx.Ava.Ui.ViewModels if (ProfileName == LocaleManager.Instance["ControllerSettingsProfileDefault"]) { - await ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow, LocaleManager.Instance["DialogProfileDefaultProfileOverwriteErrorMessage"]); + await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogProfileDefaultProfileOverwriteErrorMessage"]); return; } @@ -769,7 +769,7 @@ namespace Ryujinx.Ava.Ui.ViewModels } else { - await ContentDialogHelper.CreateErrorDialog(_owner.GetVisualRoot() as StyleableWindow, LocaleManager.Instance["DialogProfileInvalidProfileNameErrorMessage"]); + await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance["DialogProfileInvalidProfileNameErrorMessage"]); } } } @@ -782,7 +782,6 @@ namespace Ryujinx.Ava.Ui.ViewModels } UserResult result = await ContentDialogHelper.CreateConfirmationDialog( - _owner.GetVisualRoot() as StyleableWindow, LocaleManager.Instance["DialogProfileDeleteProfileTitle"], LocaleManager.Instance["DialogProfileDeleteProfileMessage"], LocaleManager.Instance["InputDialogYes"], -- cgit v1.2.3