From 02b859ad9dcfbc06cdb8f3a69e12a053752b85f0 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Mon, 28 Mar 2022 00:55:18 +0200 Subject: [PATCH] Disable firmware overrides UI when override checkbox isn't checked --- src/frontend/qt_sdl/FirmwareSettingsDialog.cpp | 9 +++++++++ src/frontend/qt_sdl/FirmwareSettingsDialog.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp b/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp index 90b5182e..754cc8a5 100644 --- a/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp +++ b/src/frontend/qt_sdl/FirmwareSettingsDialog.cpp @@ -65,6 +65,8 @@ FirmwareSettingsDialog::FirmwareSettingsDialog(QWidget* parent) : QDialog(parent ui->txtMAC->setText(QString::fromStdString(Config::FirmwareMAC)); ui->cbRandomizeMAC->setChecked(Config::RandomizeMAC); + + on_overrideFirmwareBox_toggled(); on_cbRandomizeMAC_toggled(); } @@ -202,6 +204,13 @@ void FirmwareSettingsDialog::on_cbxBirthdayMonth_currentIndexChanged(int idx) } } +void FirmwareSettingsDialog::on_overrideFirmwareBox_toggled() +{ + bool disable = !ui->overrideFirmwareBox->isChecked(); + ui->grpUserSettings->setDisabled(disable); + ui->grpWifiSettings->setDisabled(disable); +} + void FirmwareSettingsDialog::on_cbRandomizeMAC_toggled() { bool disable = ui->cbRandomizeMAC->isChecked(); diff --git a/src/frontend/qt_sdl/FirmwareSettingsDialog.h b/src/frontend/qt_sdl/FirmwareSettingsDialog.h index f4b4b8bd..97bf5c07 100644 --- a/src/frontend/qt_sdl/FirmwareSettingsDialog.h +++ b/src/frontend/qt_sdl/FirmwareSettingsDialog.h @@ -123,6 +123,7 @@ private slots: void done(int r); void on_cbxBirthdayMonth_currentIndexChanged(int idx); + void on_overrideFirmwareBox_toggled(); void on_cbRandomizeMAC_toggled(); private: