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/Modules | |
| parent | 14ae4e276f81aa6511fb6d00c8d7b9998a88a1c8 (diff) | |
Avalonia - Couple fixes and improvements (#3451)
* 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/Modules')
| -rw-r--r-- | Ryujinx.Ava/Modules/Updater/Updater.cs | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/Ryujinx.Ava/Modules/Updater/Updater.cs b/Ryujinx.Ava/Modules/Updater/Updater.cs index 708c2a08..362435c8 100644 --- a/Ryujinx.Ava/Modules/Updater/Updater.cs +++ b/Ryujinx.Ava/Modules/Updater/Updater.cs @@ -73,8 +73,11 @@ namespace Ryujinx.Modules } catch { - ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]); Logger.Error?.Print(LogClass.Application, "Failed to convert the current Ryujinx version!"); + Dispatcher.UIThread.Post(async () => + { + await ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]); + }); return; } @@ -106,7 +109,10 @@ namespace Ryujinx.Modules { if (showVersionUpToDate) { - ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], ""); + Dispatcher.UIThread.Post(async () => + { + await ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], ""); + }); } return; @@ -121,7 +127,10 @@ namespace Ryujinx.Modules { if (showVersionUpToDate) { - ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], ""); + Dispatcher.UIThread.Post(async () => + { + await ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], ""); + }); } return; @@ -131,7 +140,10 @@ namespace Ryujinx.Modules catch (Exception exception) { Logger.Error?.Print(LogClass.Application, exception.Message); - ContentDialogHelper.CreateErrorDialog(mainWindow, LocaleManager.Instance["DialogUpdaterFailedToGetVersionMessage"]); + Dispatcher.UIThread.Post(async () => + { + await ContentDialogHelper.CreateErrorDialog(mainWindow, LocaleManager.Instance["DialogUpdaterFailedToGetVersionMessage"]); + }); return; } @@ -142,8 +154,11 @@ namespace Ryujinx.Modules } catch { - ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedGithubMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]); Logger.Error?.Print(LogClass.Application, "Failed to convert the received Ryujinx version from Github!"); + Dispatcher.UIThread.Post(async () => + { + await ContentDialogHelper.CreateWarningDialog(mainWindow, LocaleManager.Instance["DialogUpdaterConvertFailedGithubMessage"], LocaleManager.Instance["DialogUpdaterCancelUpdateMessage"]); + }); return; } @@ -152,7 +167,10 @@ namespace Ryujinx.Modules { if (showVersionUpToDate) { - ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], ""); + Dispatcher.UIThread.Post(async () => + { + await ContentDialogHelper.CreateUpdaterInfoDialog(mainWindow, LocaleManager.Instance["DialogUpdaterAlreadyOnLatestVersionMessage"], ""); + }); } Running = false; @@ -180,10 +198,12 @@ namespace Ryujinx.Modules _buildSize = -1; } } - - // Show a message asking the user if they want to update - UpdaterWindow updateDialog = new(mainWindow, newVersion, _buildUrl); - await updateDialog.ShowDialog(mainWindow); + Dispatcher.UIThread.Post(async () => + { + // Show a message asking the user if they want to update + UpdaterWindow updateDialog = new(mainWindow, newVersion, _buildUrl); + await updateDialog.ShowDialog(mainWindow); + }); } private static HttpClient ConstructHttpClient() @@ -522,6 +542,7 @@ namespace Ryujinx.Modules updateDialog.ButtonBox.IsVisible = true; } +#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed public static bool CanUpdate(bool showWarnings, StyleableWindow parent) { #if !DISABLE_UPDATER @@ -577,6 +598,7 @@ namespace Ryujinx.Modules return false; #endif } +#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed // NOTE: This method should always reflect the latest build layout.s private static IEnumerable<string> EnumerateFilesToDelete() |
