diff options
author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-16 17:25:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-16 15:25:20 +0000 |
commit | 69b6ef7a4ae36994c293e423e1203096c294744c (patch) | |
tree | 3e8de70aee70ae0d28fd2684bea6e6606142d9cf /Ryujinx/Ui/Windows/SettingsWindow.cs | |
parent | 40e87c634ece65da3f740fcfbb6acb43e5cd71b3 (diff) |
[GUI] Add network interface dropdown (#4597)1.1.717
* Add network adapter dropdown from LDN build
* Ava: Add NetworkInterfaces to SettingsNetworkTab
* Add headless network interface option
* Add network interface dropdown to Avalonia
* Fix handling network interfaces without a gateway address
* gtk: Actually save selected network interface to config
* Increment config version
Diffstat (limited to 'Ryujinx/Ui/Windows/SettingsWindow.cs')
-rw-r--r-- | Ryujinx/Ui/Windows/SettingsWindow.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Ryujinx/Ui/Windows/SettingsWindow.cs b/Ryujinx/Ui/Windows/SettingsWindow.cs index f049da50..27080bda 100644 --- a/Ryujinx/Ui/Windows/SettingsWindow.cs +++ b/Ryujinx/Ui/Windows/SettingsWindow.cs @@ -17,6 +17,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.IO; +using System.Net.NetworkInformation; using System.Reflection; using System.Threading.Tasks; using GUI = Gtk.Builder.ObjectAttribute; @@ -84,6 +85,7 @@ namespace Ryujinx.Ui.Windows [GUI] Adjustment _systemTimeDaySpinAdjustment; [GUI] Adjustment _systemTimeHourSpinAdjustment; [GUI] Adjustment _systemTimeMinuteSpinAdjustment; + [GUI] ComboBoxText _multiLanSelect; [GUI] CheckButton _custThemeToggle; [GUI] Entry _custThemePath; [GUI] ToggleButton _browseThemePath; @@ -348,6 +350,8 @@ namespace Ryujinx.Ui.Windows UpdatePreferredGpuComboBox(); _graphicsBackend.Changed += (sender, e) => UpdatePreferredGpuComboBox(); + PopulateNetworkInterfaces(); + _multiLanSelect.SetActiveId(ConfigurationState.Instance.Multiplayer.LanInterfaceId.Value); _custThemePath.Buffer.Text = ConfigurationState.Instance.Ui.CustomThemePath; _resScaleText.Buffer.Text = ConfigurationState.Instance.Graphics.ResScaleCustom.Value.ToString(); @@ -490,6 +494,19 @@ namespace Ryujinx.Ui.Windows } } + private void PopulateNetworkInterfaces() + { + NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces(); + + foreach (NetworkInterface nif in interfaces) + { + string guid = nif.Id; + string name = nif.Name; + + _multiLanSelect.Append(guid, name); + } + } + private void UpdateSystemTimeSpinners() { //Bind system time events @@ -616,6 +633,7 @@ namespace Ryujinx.Ui.Windows ConfigurationState.Instance.Graphics.AntiAliasing.Value = Enum.Parse<AntiAliasing>(_antiAliasing.ActiveId); ConfigurationState.Instance.Graphics.ScalingFilter.Value = Enum.Parse<ScalingFilter>(_scalingFilter.ActiveId); ConfigurationState.Instance.Graphics.ScalingFilterLevel.Value = (int)_scalingFilterLevel.Value; + ConfigurationState.Instance.Multiplayer.LanInterfaceId.Value = _multiLanSelect.ActiveId; _previousVolumeLevel = ConfigurationState.Instance.System.AudioVolume.Value; |