SettingsDialog: Only restart when necessary

The previous few commits now allow for us to change settings without
restarting the WebSocket server.
This commit is contained in:
tt2468 2021-12-15 02:11:33 -08:00
parent fab56d71ea
commit 41a145c57c

View File

@ -171,14 +171,9 @@ void SettingsDialog::SaveFormData()
}
}
bool needsRestart = false;
if ((conf->ServerEnabled != ui->enableWebSocketServerCheckBox->isChecked()) ||
(conf->DebugEnabled != ui->enableDebugLoggingCheckBox->isChecked()) ||
(conf->AuthRequired != ui->enableAuthenticationCheckBox->isChecked()) ||
(conf->ServerPassword != ui->serverPasswordLineEdit->text()) ||
(conf->ServerPort != ui->serverPortSpinBox->value())) {
needsRestart = true;
}
bool needsRestart = (conf->ServerEnabled != ui->enableWebSocketServerCheckBox->isChecked()) ||
(ui->enableAuthenticationCheckBox->isChecked() && conf->ServerPassword != ui->serverPasswordLineEdit->text()) ||
(conf->ServerPort != ui->serverPortSpinBox->value());
conf->ServerEnabled = ui->enableWebSocketServerCheckBox->isChecked();
conf->AlertsEnabled = ui->enableSystemTrayAlertsCheckBox->isChecked();