From 3d0ba91ff26ad83852e0d1a112127d1dec420bd6 Mon Sep 17 00:00:00 2001 From: tt2468 Date: Sat, 5 Jun 2021 22:23:57 -0700 Subject: [PATCH] SettingsDialog: Restart websocket server if debug mode changed The functionality of not reloading the server when debug mode is changed I determined was too confusing to use considering the benefit that it provides by not reloading the websocket server. It is technically possible to set debug mode to the server while it is running, however the implementation would somewhat dirty the UI code, so I do not feel comfortable doing it at this point. --- src/forms/SettingsDialog.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/forms/SettingsDialog.cpp b/src/forms/SettingsDialog.cpp index 49167ea5..bb008f17 100644 --- a/src/forms/SettingsDialog.cpp +++ b/src/forms/SettingsDialog.cpp @@ -106,15 +106,11 @@ void SettingsDialog::SaveFormData() } bool needsRestart = false; - - // I decided not to restart the server if debug is changed. Might mess with peoples' scripts - if (conf->ServerEnabled != ui->enableWebSocketServerCheckBox->isChecked()) { - needsRestart = true; - } else if (conf->AuthRequired != ui->enableAuthenticationCheckBox->isChecked()) { - needsRestart = true; - } else if (conf->ServerPassword != ui->serverPasswordLineEdit->text()) { - needsRestart = true; - } else if (conf->ServerPort != ui->serverPortSpinBox->value()) { + 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; }