|
@@ -13,6 +13,7 @@ using LibHac.Tools.Fs;
|
|
|
using LibHac.Tools.FsSystem;
|
|
using LibHac.Tools.FsSystem;
|
|
|
using LibHac.Tools.FsSystem.NcaUtils;
|
|
using LibHac.Tools.FsSystem.NcaUtils;
|
|
|
using Ryujinx.Ava.Common.Locale;
|
|
using Ryujinx.Ava.Common.Locale;
|
|
|
|
|
+using Ryujinx.Ava.UI.Controls;
|
|
|
using Ryujinx.Ava.UI.Helpers;
|
|
using Ryujinx.Ava.UI.Helpers;
|
|
|
using Ryujinx.Ava.UI.Windows;
|
|
using Ryujinx.Ava.UI.Windows;
|
|
|
using Ryujinx.Common.Logging;
|
|
using Ryujinx.Common.Logging;
|
|
@@ -152,25 +153,17 @@ namespace Ryujinx.Ava.Common
|
|
|
string destination = await folderDialog.ShowAsync(_owner);
|
|
string destination = await folderDialog.ShowAsync(_owner);
|
|
|
var cancellationToken = new CancellationTokenSource();
|
|
var cancellationToken = new CancellationTokenSource();
|
|
|
|
|
|
|
|
|
|
+ UpdateWaitWindow waitingDialog = new(
|
|
|
|
|
+ LocaleManager.Instance[LocaleKeys.DialogNcaExtractionTitle],
|
|
|
|
|
+ LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogNcaExtractionMessage, ncaSectionType, Path.GetFileName(titleFilePath)),
|
|
|
|
|
+ cancellationToken);
|
|
|
|
|
+
|
|
|
if (!string.IsNullOrWhiteSpace(destination))
|
|
if (!string.IsNullOrWhiteSpace(destination))
|
|
|
{
|
|
{
|
|
|
Thread extractorThread = new(() =>
|
|
Thread extractorThread = new(() =>
|
|
|
{
|
|
{
|
|
|
- Dispatcher.UIThread.Post(async () =>
|
|
|
|
|
- {
|
|
|
|
|
- UserResult result = await ContentDialogHelper.CreateConfirmationDialog(
|
|
|
|
|
- LocaleManager.Instance.UpdateAndGetDynamicValue(LocaleKeys.DialogNcaExtractionMessage, ncaSectionType, Path.GetFileName(titleFilePath)),
|
|
|
|
|
- "",
|
|
|
|
|
- "",
|
|
|
|
|
- LocaleManager.Instance[LocaleKeys.InputDialogCancel],
|
|
|
|
|
- LocaleManager.Instance[LocaleKeys.DialogNcaExtractionTitle]);
|
|
|
|
|
-
|
|
|
|
|
- if (result == UserResult.Cancel)
|
|
|
|
|
- {
|
|
|
|
|
- cancellationToken.Cancel();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ Dispatcher.UIThread.Post(waitingDialog.Show);
|
|
|
|
|
+
|
|
|
using FileStream file = new(titleFilePath, FileMode.Open, FileAccess.Read);
|
|
using FileStream file = new(titleFilePath, FileMode.Open, FileAccess.Read);
|
|
|
|
|
|
|
|
Nca mainNca = null;
|
|
Nca mainNca = null;
|
|
@@ -222,6 +215,8 @@ namespace Ryujinx.Ava.Common
|
|
|
|
|
|
|
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
|
|
{
|
|
{
|
|
|
|
|
+ waitingDialog.Close();
|
|
|
|
|
+
|
|
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogNcaExtractionMainNcaNotFoundErrorMessage]);
|
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogNcaExtractionMainNcaNotFoundErrorMessage]);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -263,11 +258,15 @@ namespace Ryujinx.Ava.Common
|
|
|
|
|
|
|
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
|
|
{
|
|
{
|
|
|
|
|
+ waitingDialog.Close();
|
|
|
|
|
+
|
|
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogNcaExtractionCheckLogErrorMessage]);
|
|
await ContentDialogHelper.CreateErrorDialog(LocaleManager.Instance[LocaleKeys.DialogNcaExtractionCheckLogErrorMessage]);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
else if (resultCode.Value.IsSuccess())
|
|
else if (resultCode.Value.IsSuccess())
|
|
|
{
|
|
{
|
|
|
|
|
+ Dispatcher.UIThread.Post(waitingDialog.Close);
|
|
|
|
|
+
|
|
|
NotificationHelper.Show(
|
|
NotificationHelper.Show(
|
|
|
LocaleManager.Instance[LocaleKeys.DialogNcaExtractionTitle],
|
|
LocaleManager.Instance[LocaleKeys.DialogNcaExtractionTitle],
|
|
|
$"{titleName}\n\n{LocaleManager.Instance[LocaleKeys.DialogNcaExtractionSuccessMessage]}",
|
|
$"{titleName}\n\n{LocaleManager.Instance[LocaleKeys.DialogNcaExtractionSuccessMessage]}",
|
|
@@ -284,6 +283,8 @@ namespace Ryujinx.Ava.Common
|
|
|
|
|
|
|
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
|
|
{
|
|
{
|
|
|
|
|
+ waitingDialog.Close();
|
|
|
|
|
+
|
|
|
await ContentDialogHelper.CreateErrorDialog(ex.Message);
|
|
await ContentDialogHelper.CreateErrorDialog(ex.Message);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|