From 858803e946242eb34973c72cd8bb90b7d03dde0b Mon Sep 17 00:00:00 2001 From: Simon Briere Date: Tue, 8 Oct 2024 15:01:44 -0400 Subject: [PATCH] Refs #95. Fixed issues when only 1 server in config file --- client/src/dialogs/WebLoginDialog.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/client/src/dialogs/WebLoginDialog.cpp b/client/src/dialogs/WebLoginDialog.cpp index 5b43b54..ffcfa90 100644 --- a/client/src/dialogs/WebLoginDialog.cpp +++ b/client/src/dialogs/WebLoginDialog.cpp @@ -72,8 +72,17 @@ void WebLoginDialog::setServerNames(QStringList servers) // Select server from the list if we have a setting for that if (current_server.isValid()){ QString server_name = current_server.toString(); - if (servers.contains(server_name)) - ui->cmbServers->setCurrentText(server_name); + if (servers.contains(server_name)){ + if (ui->cmbServers->currentText() != server_name) + ui->cmbServers->setCurrentText(server_name); + else + onServerSelected(0); + } + }else{ + if (ui->cmbServers->count() > 0){ + ui->cmbServers->setCurrentIndex(0); + onServerSelected(0); + } } } @@ -178,6 +187,8 @@ void WebLoginDialog::showLargeView(const bool &large) if (m_showServers){ ui->frameServers->setVisible(!large); + }else{ + ui->frameServers->hide(); } if (large){ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);