diff --git a/src/Gui/DlgSettingsNotificationArea.cpp b/src/Gui/DlgSettingsNotificationArea.cpp index 2a6bfab7c1..e81ac86c06 100644 --- a/src/Gui/DlgSettingsNotificationArea.cpp +++ b/src/Gui/DlgSettingsNotificationArea.cpp @@ -41,35 +41,24 @@ DlgSettingsNotificationArea::DlgSettingsNotificationArea(QWidget* parent) ui->setupUi(this); connect(ui->NotificationAreaEnabled, &QCheckBox::stateChanged, [this](int state) { - if (state == Qt::CheckState::Checked) { - ui->NonIntrusiveNotificationsEnabled->setEnabled(true); - ui->maxDuration->setEnabled(true); - ui->maxDuration->setEnabled(true); - ui->minDuration->setEnabled(true); - ui->maxNotifications->setEnabled(true); - ui->maxWidgetMessages->setEnabled(true); - ui->autoRemoveUserNotifications->setEnabled(true); - ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->setEnabled(true); - ui->preventNonIntrusiveNotificationsWhenWindowNotActive->setEnabled(true); - ui->developerErrorSubscriptionEnabled->setEnabled(true); - ui->developerWarningSubscriptionEnabled->setEnabled(true); + bool enabled = state == Qt::CheckState::Checked; + + ui->NonIntrusiveNotificationsEnabled->setEnabled(enabled); + ui->maxDuration->setEnabled(enabled); + ui->maxDuration->setEnabled(enabled); + ui->minDuration->setEnabled(enabled); + ui->maxNotifications->setEnabled(enabled); + ui->maxWidgetMessages->setEnabled(enabled); + ui->autoRemoveUserNotifications->setEnabled(enabled); + ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->setEnabled(enabled); + ui->preventNonIntrusiveNotificationsWhenWindowNotActive->setEnabled(enabled); + ui->developerErrorSubscriptionEnabled->setEnabled(enabled); + ui->developerWarningSubscriptionEnabled->setEnabled(enabled); + if (enabled) { QMessageBox::information(this, tr("Notification Area"), tr("Activation of the Notification Area only takes effect " "after an application restart.")); - } - else { - ui->NonIntrusiveNotificationsEnabled->setEnabled(false); - ui->maxDuration->setEnabled(false); - ui->maxDuration->setEnabled(false); - ui->minDuration->setEnabled(false); - ui->maxNotifications->setEnabled(false); - ui->maxWidgetMessages->setEnabled(false); - ui->autoRemoveUserNotifications->setEnabled(false); - ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->setEnabled(false); - ui->preventNonIntrusiveNotificationsWhenWindowNotActive->setEnabled(false); - ui->developerErrorSubscriptionEnabled->setEnabled(false); - ui->developerWarningSubscriptionEnabled->setEnabled(false); // N.B: Deactivation is handled by the Notification Area itself, as it listens to all // its configuration parameters. }