diff --git a/src/core/net/WebSocketClient.cpp b/src/core/net/WebSocketClient.cpp index 26b043f81..610aa8f13 100644 --- a/src/core/net/WebSocketClient.cpp +++ b/src/core/net/WebSocketClient.cpp @@ -195,14 +195,13 @@ std::string WebSocketClient::EnqueueQuery(Query query) { } void WebSocketClient::Connect(const std::string& host, short port, const std::string& password, bool ipv6) { - std::unique_lockmutex)> lock(this->mutex); - this->Disconnect(); auto newUri = "ws://" + host + ":" + std::to_string(port); if (newUri != this->uri || password != this->password || ipv6 != this->ipv6 || this->state != State::Connected) { + this->Disconnect(); this->ipv6 = ipv6; this->uri = newUri; this->password = password; diff --git a/src/musikcube/app/layout/RemoteLibrarySettingsLayout.cpp b/src/musikcube/app/layout/RemoteLibrarySettingsLayout.cpp index 4082b72ae..ec7639215 100644 --- a/src/musikcube/app/layout/RemoteLibrarySettingsLayout.cpp +++ b/src/musikcube/app/layout/RemoteLibrarySettingsLayout.cpp @@ -137,16 +137,6 @@ void RemoteLibrarySettingsLayout::InitializeWindows() { this->ipv6Cb->SetFocusOrder(order++); } -void RemoteLibrarySettingsLayout::OnVisibilityChanged(bool visible) { - LayoutBase::OnVisibilityChanged(visible); - if (visible) { - this->LoadPreferences(); - } - else { - this->SavePreferences(); - } -} - void RemoteLibrarySettingsLayout::LoadPreferences() { auto host = prefs->GetString(core::prefs::keys::RemoteLibraryHostname, "127.0.0.1"); auto wssPort = (short) prefs->GetInt(core::prefs::keys::RemoteLibraryWssPort, 7905); diff --git a/src/musikcube/app/layout/RemoteLibrarySettingsLayout.h b/src/musikcube/app/layout/RemoteLibrarySettingsLayout.h index e5affa674..0c6431143 100644 --- a/src/musikcube/app/layout/RemoteLibrarySettingsLayout.h +++ b/src/musikcube/app/layout/RemoteLibrarySettingsLayout.h @@ -48,15 +48,14 @@ namespace musik { namespace cube { virtual ~RemoteLibrarySettingsLayout(); - virtual void OnVisibilityChanged(bool visible); + void LoadPreferences(); + void SavePreferences(); protected: virtual void OnLayout(); private: void InitializeWindows(); - void LoadPreferences(); - void SavePreferences(); musik::core::ILibraryPtr library; diff --git a/src/musikcube/app/layout/SettingsLayout.cpp b/src/musikcube/app/layout/SettingsLayout.cpp index c655a47c9..91219cd1a 100755 --- a/src/musikcube/app/layout/SettingsLayout.cpp +++ b/src/musikcube/app/layout/SettingsLayout.cpp @@ -541,8 +541,12 @@ void SettingsLayout::OnVisibilityChanged(bool visible) { if (visible) { this->LoadPreferences(); + this->remoteLibraryLayout->LoadPreferences(); this->CheckShowFirstRunDialog(); } + else { + this->remoteLibraryLayout->SavePreferences(); + } } void SettingsLayout::OnAddedToParent(IWindow* parent) { diff --git a/src/musikcube/cursespp/TextInput.cpp b/src/musikcube/cursespp/TextInput.cpp index 15fe2ca27..6bd6ae166 100755 --- a/src/musikcube/cursespp/TextInput.cpp +++ b/src/musikcube/cursespp/TextInput.cpp @@ -72,6 +72,7 @@ TextInput::TextInput(TextInput::Style style, IInput::InputMode inputMode) , inputMode(inputMode) , enterEnabled(true) , truncate(false) { + this->SetFocusedContentColor(Color::TextFocused); if (style == StyleLine) { this->SetFrameVisible(false); } diff --git a/src/musikcube/musikcube.vcxproj b/src/musikcube/musikcube.vcxproj index 81b3c872f..01d13fc4a 100755 --- a/src/musikcube/musikcube.vcxproj +++ b/src/musikcube/musikcube.vcxproj @@ -796,6 +796,7 @@ xcopy "$(SolutionDir)src\3rdparty\bin\win\font\*.ttf" "$(TargetDir)fonts\" /Y /e + @@ -880,6 +881,7 @@ xcopy "$(SolutionDir)src\3rdparty\bin\win\font\*.ttf" "$(TargetDir)fonts\" /Y /e + diff --git a/src/musikcube/musikcube.vcxproj.filters b/src/musikcube/musikcube.vcxproj.filters index e3b88d46f..d5d38db56 100755 --- a/src/musikcube/musikcube.vcxproj.filters +++ b/src/musikcube/musikcube.vcxproj.filters @@ -201,6 +201,9 @@ app\overlay + + app\layout + @@ -457,6 +460,9 @@ app\overlay + + app\layout +