mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-09 12:19:12 +00:00
Require VFS and CM for SettingsViewModel Init
This commit is contained in:
parent
a8eb25441c
commit
f79cff8daa
2 changed files with 5 additions and 27 deletions
|
@ -273,24 +273,17 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsViewModel(VirtualFileSystem virtualFileSystem, ContentManager contentManager) : this()
|
public SettingsViewModel(VirtualFileSystem virtualFileSystem, ContentManager contentManager)
|
||||||
{
|
{
|
||||||
_virtualFileSystem = virtualFileSystem;
|
_virtualFileSystem = virtualFileSystem;
|
||||||
_contentManager = contentManager;
|
_contentManager = contentManager;
|
||||||
if (Program.PreviewerDetached)
|
|
||||||
{
|
|
||||||
Task.Run(LoadTimeZones);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public SettingsViewModel()
|
|
||||||
{
|
|
||||||
GameDirectories = new AvaloniaList<string>();
|
GameDirectories = new AvaloniaList<string>();
|
||||||
TimeZones = new AvaloniaList<TimeZone>();
|
TimeZones = new AvaloniaList<TimeZone>();
|
||||||
AvailableGpus = new ObservableCollection<ComboBoxItem>();
|
AvailableGpus = new ObservableCollection<ComboBoxItem>();
|
||||||
_validTzRegions = new List<string>();
|
|
||||||
_networkInterfaces = new Dictionary<string, string>();
|
_networkInterfaces = new Dictionary<string, string>();
|
||||||
|
|
||||||
|
LoadTimeZones();
|
||||||
|
|
||||||
Task.Run(CheckSoundBackends);
|
Task.Run(CheckSoundBackends);
|
||||||
Task.Run(PopulateNetworkInterfaces);
|
Task.Run(PopulateNetworkInterfaces);
|
||||||
|
|
||||||
|
@ -346,7 +339,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
Dispatcher.UIThread.Post(() => OnPropertyChanged(nameof(PreferredGpuIndex)));
|
Dispatcher.UIThread.Post(() => OnPropertyChanged(nameof(PreferredGpuIndex)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task LoadTimeZones()
|
public void LoadTimeZones()
|
||||||
{
|
{
|
||||||
_timeZoneContentManager = new TimeZoneContentManager();
|
_timeZoneContentManager = new TimeZoneContentManager();
|
||||||
|
|
||||||
|
@ -359,15 +352,9 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||||
|
|
||||||
string abbr2 = abbr.StartsWith('+') || abbr.StartsWith('-') ? string.Empty : abbr;
|
string abbr2 = abbr.StartsWith('+') || abbr.StartsWith('-') ? string.Empty : abbr;
|
||||||
|
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
TimeZones.Add(new TimeZone($"UTC{hours:+0#;-0#;+00}:{minutes:D2}", location, abbr2));
|
||||||
{
|
|
||||||
TimeZones.Add(new TimeZone($"UTC{hours:+0#;-0#;+00}:{minutes:D2}", location, abbr2));
|
|
||||||
|
|
||||||
_validTzRegions.Add(location);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Dispatcher.UIThread.Post(() => OnPropertyChanged(nameof(TimeZone)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task PopulateNetworkInterfaces()
|
private async Task PopulateNetworkInterfaces()
|
||||||
|
|
|
@ -26,15 +26,6 @@ namespace Ryujinx.Ava.UI.Windows
|
||||||
Load();
|
Load();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SettingsWindow()
|
|
||||||
{
|
|
||||||
ViewModel = new SettingsViewModel();
|
|
||||||
DataContext = ViewModel;
|
|
||||||
|
|
||||||
InitializeComponent();
|
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SaveSettings()
|
public void SaveSettings()
|
||||||
{
|
{
|
||||||
InputPage.ControllerSettings?.SaveCurrentProfile();
|
InputPage.ControllerSettings?.SaveCurrentProfile();
|
||||||
|
|
Loading…
Reference in a new issue