mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-04-24 06:47:44 +02:00
misc: chore: Format AvaHostUIHandler
This commit is contained in:
parent
e23d610f49
commit
8aecccadb8
1 changed files with 55 additions and 44 deletions
|
@ -92,7 +92,8 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
|
|
||||||
opened = true;
|
opened = true;
|
||||||
|
|
||||||
_parent.SettingsWindow = new SettingsWindow(_parent.VirtualFileSystem, _parent.ContentManager);
|
_parent.SettingsWindow =
|
||||||
|
new SettingsWindow(_parent.VirtualFileSystem, _parent.ContentManager);
|
||||||
|
|
||||||
await _parent.SettingsWindow.ShowDialog(window);
|
await _parent.SettingsWindow.ShowDialog(window);
|
||||||
|
|
||||||
|
@ -110,7 +111,9 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogMessageDialogErrorExceptionMessage, ex));
|
await ContentDialogHelper.CreateErrorDialog(
|
||||||
|
LocaleManager.Instance.UpdateAndGetDynamicValue(
|
||||||
|
LocaleKeys.DialogMessageDialogErrorExceptionMessage, ex));
|
||||||
|
|
||||||
dialogCloseEvent.Set();
|
dialogCloseEvent.Set();
|
||||||
}
|
}
|
||||||
|
@ -134,7 +137,9 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_parent.ViewModel.AppHost.NpadManager.BlockInputUpdates();
|
_parent.ViewModel.AppHost.NpadManager.BlockInputUpdates();
|
||||||
(UserResult result, string userInput) = await SwkbdAppletDialog.ShowInputDialog(LocaleManager.Instance[LocaleKeys.SoftwareKeyboard], args);
|
(UserResult result, string userInput) =
|
||||||
|
await SwkbdAppletDialog.ShowInputDialog(LocaleManager.Instance[LocaleKeys.SoftwareKeyboard],
|
||||||
|
args);
|
||||||
|
|
||||||
if (result == UserResult.Ok)
|
if (result == UserResult.Ok)
|
||||||
{
|
{
|
||||||
|
@ -146,7 +151,9 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
{
|
{
|
||||||
error = true;
|
error = true;
|
||||||
|
|
||||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogSoftwareKeyboardErrorExceptionMessage, ex));
|
await ContentDialogHelper.CreateErrorDialog(
|
||||||
|
LocaleManager.Instance.UpdateAndGetDynamicValue(
|
||||||
|
LocaleKeys.DialogSoftwareKeyboardErrorExceptionMessage, ex));
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -177,7 +184,8 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
args.InitialText = "Ryujinx";
|
args.InitialText = "Ryujinx";
|
||||||
args.StringLengthMin = 1;
|
args.StringLengthMin = 1;
|
||||||
args.StringLengthMax = 25;
|
args.StringLengthMax = 25;
|
||||||
(UserResult result, string userInput) = await SwkbdAppletDialog.ShowInputDialog(LocaleManager.Instance[LocaleKeys.CabinetDialog], args);
|
(UserResult result, string userInput) =
|
||||||
|
await SwkbdAppletDialog.ShowInputDialog(LocaleManager.Instance[LocaleKeys.CabinetDialog], args);
|
||||||
if (result == UserResult.Ok)
|
if (result == UserResult.Ok)
|
||||||
{
|
{
|
||||||
inputText = userInput;
|
inputText = userInput;
|
||||||
|
@ -201,11 +209,13 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
{
|
{
|
||||||
dialogCloseEvent.Set();
|
dialogCloseEvent.Set();
|
||||||
await ContentDialogHelper.CreateInfoDialog(LocaleManager.Instance[LocaleKeys.CabinetScanDialog],
|
await ContentDialogHelper.CreateInfoDialog(
|
||||||
|
LocaleManager.Instance[LocaleKeys.CabinetScanDialog],
|
||||||
string.Empty,
|
string.Empty,
|
||||||
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
LocaleManager.Instance[LocaleKeys.InputDialogOk],
|
||||||
string.Empty,
|
string.Empty,
|
||||||
LocaleManager.Instance[LocaleKeys.CabinetTitle]);
|
LocaleManager.Instance[LocaleKeys.CabinetTitle]
|
||||||
|
);
|
||||||
});
|
});
|
||||||
dialogCloseEvent.WaitOne();
|
dialogCloseEvent.WaitOne();
|
||||||
}
|
}
|
||||||
|
@ -217,7 +227,8 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
_parent.ViewModel.AppHost?.Stop();
|
_parent.ViewModel.AppHost?.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DisplayErrorAppletDialog(string title, string message, string[] buttons, (uint Module, uint Description)? errorCode = null)
|
public bool DisplayErrorAppletDialog(string title, string message, string[] buttons,
|
||||||
|
(uint Module, uint Description)? errorCode = null)
|
||||||
{
|
{
|
||||||
ManualResetEvent dialogCloseEvent = new(false);
|
ManualResetEvent dialogCloseEvent = new(false);
|
||||||
|
|
||||||
|
@ -229,9 +240,7 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
{
|
{
|
||||||
ErrorAppletWindow msgDialog = new(_parent, buttons, message)
|
ErrorAppletWindow msgDialog = new(_parent, buttons, message)
|
||||||
{
|
{
|
||||||
Title = title,
|
Title = title, WindowStartupLocation = WindowStartupLocation.CenterScreen, Width = 400
|
||||||
WindowStartupLocation = WindowStartupLocation.CenterScreen,
|
|
||||||
Width = 400
|
|
||||||
};
|
};
|
||||||
|
|
||||||
object response = await msgDialog.Run();
|
object response = await msgDialog.Run();
|
||||||
|
@ -249,7 +258,9 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
{
|
{
|
||||||
dialogCloseEvent.Set();
|
dialogCloseEvent.Set();
|
||||||
|
|
||||||
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogErrorAppletErrorExceptionMessage, ex));
|
await ContentDialogHelper.CreateErrorDialog(
|
||||||
|
LocaleManager.Instance.UpdateAndGetDynamicValue(
|
||||||
|
LocaleKeys.DialogErrorAppletErrorExceptionMessage, ex));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -280,8 +291,7 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
profiles.Add(new Models.UserProfile(guest, nav));
|
profiles.Add(new Models.UserProfile(guest, nav));
|
||||||
ProfileSelectorDialogViewModel viewModel = new()
|
ProfileSelectorDialogViewModel viewModel = new()
|
||||||
{
|
{
|
||||||
Profiles = profiles,
|
Profiles = profiles, SelectedUserId = _parent.AccountManager.LastOpenedUser.UserId
|
||||||
SelectedUserId = _parent.AccountManager.LastOpenedUser.UserId
|
|
||||||
};
|
};
|
||||||
(selected, _) = await ProfileSelectorDialog.ShowInputDialog(viewModel);
|
(selected, _) = await ProfileSelectorDialog.ShowInputDialog(viewModel);
|
||||||
|
|
||||||
|
@ -310,6 +320,7 @@ namespace Ryujinx.Ava.UI.Applet
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue