diff --git a/MB_SubSonic/Subsonic.cs b/MB_SubSonic/Subsonic.cs index eb4d0d6..5873314 100644 --- a/MB_SubSonic/Subsonic.cs +++ b/MB_SubSonic/Subsonic.cs @@ -102,6 +102,13 @@ public static List LoadSettingsFromFile() return settings; } + public static void ChangeServerProfile(SubsonicSettings settings) + { + _currentSettings = SettingsHelper.SanitizeSettings(new List { settings }).First(); + _serverName = BuildServerUri(_currentSettings); + _validSettings = true; + } + public static bool PingServer(SubsonicSettings settings) { _currentSettings = SettingsHelper.SanitizeSettings(new List{settings}).First(); diff --git a/MB_SubSonic/Windows/SettingsWindow.cs b/MB_SubSonic/Windows/SettingsWindow.cs index 2068253..eb33ebc 100644 --- a/MB_SubSonic/Windows/SettingsWindow.cs +++ b/MB_SubSonic/Windows/SettingsWindow.cs @@ -141,6 +141,7 @@ private void ButtonSave_Click(object sender, EventArgs e) { StoreCurrentSettings(); Subsonic.CurrentProfile = _currentProfile; + Subsonic.ChangeServerProfile(GetCurrentSettings()); PersistValues(); Hide(); } @@ -149,6 +150,7 @@ private void btnApply_Click(object sender, EventArgs e) { StoreCurrentSettings(); Subsonic.CurrentProfile = _currentProfile; + Subsonic.ChangeServerProfile(GetCurrentSettings()); } private void ButtonPing_Click(object sender, EventArgs e)