fix: MainWindow::setHostName only check if the screen is existing when in server mode, In severmode update the serverConfig serverName to prevent a case where the server screen is on the grid with the old name breaking the layout
This commit is contained in:
parent
a4c0e30bb8
commit
906c07e4fd
1 changed files with 10 additions and 1 deletions
|
|
@ -1106,7 +1106,14 @@ void MainWindow::setHostName()
|
|||
|
||||
QString text = ui->lineEditName->text();
|
||||
const auto screenName = Settings::value(Settings::Core::ScreenName).toString();
|
||||
bool existingScreen = serverConfig().screenExists(text) && (text != screenName);
|
||||
|
||||
if (text == screenName)
|
||||
return;
|
||||
|
||||
const bool isServer = ui->rbModeServer->isChecked();
|
||||
bool existingScreen = false;
|
||||
if (isServer)
|
||||
existingScreen = serverConfig().screenExists(text);
|
||||
|
||||
if (!ui->lineEditName->hasAcceptableInput() || text.isEmpty() || existingScreen) {
|
||||
blockSignals(true);
|
||||
|
|
@ -1131,6 +1138,8 @@ void MainWindow::setHostName()
|
|||
|
||||
ui->lblComputerName->setText(ui->lineEditName->text());
|
||||
Settings::setValue(Settings::Core::ScreenName, ui->lineEditName->text());
|
||||
if (isServer)
|
||||
serverConfig().updateServerName();
|
||||
applyConfig();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue