aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Ava/Common/ApplicationHelper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Ava/Common/ApplicationHelper.cs')
-rw-r--r--Ryujinx.Ava/Common/ApplicationHelper.cs30
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);
});
}
}