From 8eb68aa2aa53d2bd24ac35bc6b87a142e95bf811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Arrouye?= <5017270+tarrouye@users.noreply.github.com> Date: Sun, 4 Jun 2023 17:24:19 -0700 Subject: [PATCH] Refresh support for GTK --- src/Ryujinx/Ui/MainWindow.cs | 2 +- src/Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx/Ui/MainWindow.cs b/src/Ryujinx/Ui/MainWindow.cs index b428ff38c..1ab74f4c5 100644 --- a/src/Ryujinx/Ui/MainWindow.cs +++ b/src/Ryujinx/Ui/MainWindow.cs @@ -1648,7 +1648,7 @@ namespace Ryujinx.Ui private void ManageUserProfiles_Pressed(object sender, EventArgs args) { - UserProfilesManagerWindow userProfilesManagerWindow = new UserProfilesManagerWindow(_accountManager, _contentManager, _virtualFileSystem); + UserProfilesManagerWindow userProfilesManagerWindow = new UserProfilesManagerWindow(_accountManager, _contentManager, _virtualFileSystem, UpdateGameTable); userProfilesManagerWindow.SetSizeRequest((int)(userProfilesManagerWindow.DefaultWidth * Program.WindowScaleFactor), (int)(userProfilesManagerWindow.DefaultHeight * Program.WindowScaleFactor)); userProfilesManagerWindow.Show(); diff --git a/src/Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs b/src/Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs index a08b5dd17..912d51523 100644 --- a/src/Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs +++ b/src/Ryujinx/Ui/Windows/UserProfilesManagerWindow.cs @@ -13,7 +13,6 @@ using System.Reflection; using System.Threading; using System.Threading.Tasks; using Image = SixLabors.ImageSharp.Image; -using UserId = Ryujinx.HLE.HOS.Services.Account.Acc.UserId; namespace Ryujinx.Ui.Windows { @@ -24,6 +23,9 @@ namespace Ryujinx.Ui.Windows private readonly AccountManager _accountManager; private readonly ContentManager _contentManager; + public delegate void ChangedUserDelegate(); + private readonly ChangedUserDelegate _changedUserDelegate; + private byte[] _bufferImageProfile; private string _tempNewProfileName; @@ -31,7 +33,7 @@ namespace Ryujinx.Ui.Windows private ManualResetEvent _avatarsPreloadingEvent = new ManualResetEvent(false); - public UserProfilesManagerWindow(AccountManager accountManager, ContentManager contentManager, VirtualFileSystem virtualFileSystem) : base($"Ryujinx {Program.Version} - Manage User Profiles") + public UserProfilesManagerWindow(AccountManager accountManager, ContentManager contentManager, VirtualFileSystem virtualFileSystem, ChangedUserDelegate changedUserDelegate) : base($"Ryujinx {Program.Version} - Manage User Profiles") { Icon = new Gdk.Pixbuf(Assembly.GetAssembly(typeof(ConfigurationState)), "Ryujinx.Ui.Common.Resources.Logo_Ryujinx.png"); @@ -44,6 +46,7 @@ namespace Ryujinx.Ui.Windows _accountManager = accountManager; _contentManager = contentManager; + _changedUserDelegate = changedUserDelegate; CellRendererToggle userSelectedToggle = new CellRendererToggle(); userSelectedToggle.Toggled += UserSelectedToggle_Toggled; @@ -128,6 +131,7 @@ namespace Ryujinx.Ui.Windows // Open the selected one. _accountManager.OpenUser(new UserId(userId)); + _changedUserDelegate(); _deleteButton.Sensitive = userId != AccountManager.DefaultUserId.ToString();