diff options
author | Emmanuel Hansen <emmausssss@gmail.com> | 2022-07-11 22:25:33 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-12 00:25:33 +0200 |
commit | 7d9a5feccbedc32dfeec00478c3a67ffff26dc60 (patch) | |
tree | c22b5d5eb5535824b4b5e54b137df1cf70c1b5f2 /Ryujinx.Ava/Common/ApplicationHelper.cs | |
parent | 14ae4e276f81aa6511fb6d00c8d7b9998a88a1c8 (diff) |
Avalonia - Couple fixes and improvements (#3451)1.1.173
* fix updater check crash
* remove line
* reduce cheat window sizes
* enable tiered compilation and r2r
* remove warning on LaunchState
* remove warnings related to tasks
* addressed review
* undo csproj indentation
* fix tabs in axaml file
* remove double line
* remove R2R
Diffstat (limited to 'Ryujinx.Ava/Common/ApplicationHelper.cs')
-rw-r--r-- | Ryujinx.Ava/Common/ApplicationHelper.cs | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/Ryujinx.Ava/Common/ApplicationHelper.cs b/Ryujinx.Ava/Common/ApplicationHelper.cs index 7d28e7e2..d83ca2c1 100644 --- a/Ryujinx.Ava/Common/ApplicationHelper.cs +++ b/Ryujinx.Ava/Common/ApplicationHelper.cs @@ -23,6 +23,7 @@ using System; using System.Buffers; using System.IO; using System.Threading; +using System.Threading.Tasks; using static LibHac.Fs.ApplicationSaveDataManagement; using Path = System.IO.Path; @@ -77,8 +78,12 @@ namespace Ryujinx.Ava.Common if (result.IsFailure()) { - ContentDialogHelper.CreateErrorDialog(_owner, - string.Format(LocaleManager.Instance["DialogMessageCreateSaveErrorMessage"], result.ToStringWithName())); + Dispatcher.UIThread.Post(async () => + { + await ContentDialogHelper.CreateErrorDialog( + _owner, + string.Format(LocaleManager.Instance["DialogMessageCreateSaveErrorMessage"], result.ToStringWithName())); + }); return false; } @@ -94,8 +99,11 @@ namespace Ryujinx.Ava.Common return true; } - ContentDialogHelper.CreateErrorDialog(_owner, - string.Format(LocaleManager.Instance["DialogMessageFindSaveErrorMessage"], result.ToStringWithName())); + Dispatcher.UIThread.Post(async () => + { + await ContentDialogHelper.CreateErrorDialog(_owner, + string.Format(LocaleManager.Instance["DialogMessageFindSaveErrorMessage"], result.ToStringWithName())); + }); return false; } @@ -137,7 +145,7 @@ namespace Ryujinx.Ava.Common } } - public static async void ExtractSection(NcaSectionType ncaSectionType, string titleFilePath, + public static async Task ExtractSection(NcaSectionType ncaSectionType, string titleFilePath, int programIndex = 0) { OpenFolderDialog folderDialog = new() { Title = LocaleManager.Instance["FolderDialogExtractTitle"] }; @@ -222,9 +230,9 @@ namespace Ryujinx.Ava.Common { Logger.Error?.Print(LogClass.Application, "Extraction failure. The main NCA was not present in the selected file"); - Dispatcher.UIThread.InvokeAsync(() => + Dispatcher.UIThread.InvokeAsync(async () => { - ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionMainNcaNotFoundErrorMessage"]); + await ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionMainNcaNotFoundErrorMessage"]); }); return; } @@ -263,9 +271,9 @@ namespace Ryujinx.Ava.Common { Logger.Error?.Print(LogClass.Application, $"LibHac returned error code: {resultCode.Value.ErrorCode}"); - Dispatcher.UIThread.InvokeAsync(() => + Dispatcher.UIThread.InvokeAsync(async () => { - ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionCheckLogErrorMessage"]); + await ContentDialogHelper.CreateErrorDialog(_owner, LocaleManager.Instance["DialogNcaExtractionCheckLogErrorMessage"]); }); } else if (resultCode.Value.IsSuccess()) @@ -288,9 +296,9 @@ namespace Ryujinx.Ava.Common } catch (ArgumentException ex) { - Dispatcher.UIThread.InvokeAsync(() => + Dispatcher.UIThread.InvokeAsync(async () => { - ContentDialogHelper.CreateErrorDialog(_owner, ex.Message); + await ContentDialogHelper.CreateErrorDialog(_owner, ex.Message); }); } } |