diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs index 5f821cd..be6ac7d 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.Events.cs @@ -791,12 +791,8 @@ public partial class MainForm : Form profileButton.ToolTip = HelperMethods.GetText(Text.OpenProfileFolderToolTip, profileName); saveButton.Enabled = true; saveButton.ToolTip = HelperMethods.GetText(Text.OpenSaveFolderToolTip, profileName); - - if (modSettingsProfileDropDown.SelectedIndex < 0 || modSettingsProfileDropDown.Items.Count == 0) - return; profileNotesTextArea.TextColor = colorGreen; profileNotesTextArea.Text = Text.ProfileNotes + "\n" + profileList[modSettingsProfileDropDown.SelectedIndex].ProfileNotes; - } /// diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.StateMachine.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.StateMachine.cs index 620cc9b..1ad2021 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.StateMachine.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.StateMachine.cs @@ -357,8 +357,6 @@ public partial class MainForm } // Update stored profiles in the Profile Settings tab - modSettingsProfileDropDown.Items.Clear(); - modSettingsProfileDropDown.Items.AddRange(profileDropDown.Items); modSettingsProfileDropDown.SelectedIndex = profileDropDown.Items.Count != 0 ? 0 : -1; // Refresh the author and version label on the main tab diff --git a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs index 06b364c..5102202 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/MainForm.UI.cs @@ -654,7 +654,8 @@ public partial class MainForm : Form if (OS.IsLinux) modSettingsProfileDropDown = new DropDown(); - modSettingsProfileDropDown.Items.AddRange(profileNames); // It's actually more comfortable if it's outside, because of GTK shenanigans + modSettingsProfileDropDown.DataStore = profileDropDown.DataStore; // It's actually more comfortable if it's outside, because of GTK shenanigans + modSettingsProfileDropDown.Bind(m => m.SelectedIndex, profileDropDown, p => p.SelectedIndex); profileButton = new ColorButton { diff --git a/AM2RLauncher/AM2RLauncherLib/HelperMethods.cs b/AM2RLauncher/AM2RLauncherLib/HelperMethods.cs index eaaee57..242bf2d 100644 --- a/AM2RLauncher/AM2RLauncherLib/HelperMethods.cs +++ b/AM2RLauncher/AM2RLauncherLib/HelperMethods.cs @@ -147,14 +147,18 @@ public static class HelperMethods public static bool IsConnectedToInternet() { log.Info("Checking internet connection..."); - PingReply pingReply = new Ping().Send("github.com"); - if (pingReply?.Status != IPStatus.Success) + try { - log.Info("Internet connection failed."); - return false; + PingReply pingReply = new Ping().Send("github.com"); + if (pingReply?.Status == IPStatus.Success) + { + log.Info("Internet connection established!"); + return true; + } } - log.Info("Internet connection established!"); - return true; + catch { /* ignoring exceptions */ } + log.Info("Internet connection failed."); + return false; } ///