Check if game directories have been updated before refreshing GUI (#3607)
* Check if game directories have been updated before refreshing list on save. * Cleanup spacing * Add Avalonia and reset value after saving * Fix Avalonia * Fix multiple directories not being added in GTK
This commit is contained in:
parent
88a0e720cb
commit
54421760c3
3 changed files with 45 additions and 15 deletions
|
@ -162,6 +162,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
|||
if (!string.IsNullOrWhiteSpace(path) && Directory.Exists(path) && !ViewModel.GameDirectories.Contains(path))
|
||||
{
|
||||
ViewModel.GameDirectories.Add(path);
|
||||
ViewModel.DirectoryChanged = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -170,6 +171,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
|||
if (!string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
ViewModel.GameDirectories.Add(path);
|
||||
ViewModel.DirectoryChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -181,6 +183,7 @@ namespace Ryujinx.Ava.Ui.Windows
|
|||
foreach (string path in selected)
|
||||
{
|
||||
ViewModel.GameDirectories.Remove(path);
|
||||
ViewModel.DirectoryChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,10 +235,12 @@ namespace Ryujinx.Ava.Ui.Windows
|
|||
|
||||
ControllerSettings?.SaveCurrentProfile();
|
||||
|
||||
if (Owner is MainWindow window)
|
||||
if (Owner is MainWindow window && ViewModel.DirectoryChanged)
|
||||
{
|
||||
window.ViewModel.LoadApplications();
|
||||
}
|
||||
|
||||
ViewModel.DirectoryChanged = false;
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue