From ef84d56970f48e8059b295db68fb9e98bdea1180 Mon Sep 17 00:00:00 2001 From: Abdullah Tahiri Date: Sun, 26 Mar 2023 09:45:40 +0200 Subject: [PATCH] NotificationArea: Preference page to control warnings and errors --- src/Gui/DlgSettingsNotificationArea.cpp | 8 ++ src/Gui/DlgSettingsNotificationArea.ui | 170 +++++++++++++++--------- 2 files changed, 116 insertions(+), 62 deletions(-) diff --git a/src/Gui/DlgSettingsNotificationArea.cpp b/src/Gui/DlgSettingsNotificationArea.cpp index b1bfee6815..78680c7dff 100644 --- a/src/Gui/DlgSettingsNotificationArea.cpp +++ b/src/Gui/DlgSettingsNotificationArea.cpp @@ -51,6 +51,8 @@ DlgSettingsNotificationArea::DlgSettingsNotificationArea(QWidget* parent) ui->autoRemoveUserNotifications->setEnabled(true); ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->setEnabled(true); ui->preventNonIntrusiveNotificationsWhenWindowNotActive->setEnabled(true); + ui->errorSubscriptionEnabled->setEnabled(true); + ui->warningSubscriptionEnabled->setEnabled(true); QMessageBox::information(this, tr("Notification Area"), tr("Activation of the Notification Area only takes effect after an application restart.")); } @@ -64,6 +66,8 @@ DlgSettingsNotificationArea::DlgSettingsNotificationArea(QWidget* parent) ui->autoRemoveUserNotifications->setEnabled(false); ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->setEnabled(false); ui->preventNonIntrusiveNotificationsWhenWindowNotActive->setEnabled(false); + ui->errorSubscriptionEnabled->setEnabled(false); + ui->warningSubscriptionEnabled->setEnabled(false); // N.B: Deactivation is handled by the Notification Area itself, as it listens to all its configuration parameters. } }); @@ -85,6 +89,8 @@ void DlgSettingsNotificationArea::saveSettings() ui->notificationWidth->onSave(); ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->onSave(); ui->preventNonIntrusiveNotificationsWhenWindowNotActive->onSave(); + ui->errorSubscriptionEnabled->onSave(); + ui->warningSubscriptionEnabled->onSave(); } void DlgSettingsNotificationArea::loadSettings() @@ -99,6 +105,8 @@ void DlgSettingsNotificationArea::loadSettings() ui->notificationWidth->onRestore(); ui->hideNonIntrusiveNotificationsWhenWindowDeactivated->onRestore(); ui->preventNonIntrusiveNotificationsWhenWindowNotActive->onRestore(); + ui->errorSubscriptionEnabled->onRestore(); + ui->warningSubscriptionEnabled->onRestore(); } diff --git a/src/Gui/DlgSettingsNotificationArea.ui b/src/Gui/DlgSettingsNotificationArea.ui index fe01afbea3..1d7dcd466d 100644 --- a/src/Gui/DlgSettingsNotificationArea.ui +++ b/src/Gui/DlgSettingsNotificationArea.ui @@ -14,7 +14,101 @@ Notification Area + + + + Settings + + + + + + The Notification area will appear in the status bar + + + Enable Notification Area + + + true + + + NotificationAreaEnabled + + + NotificationArea + + + + + + + Non-intrusive notifications will appear next to the notification area in the status bar + + + Enable non-intrusive notifications + + + true + + + NonIntrusiveNotificationsEnabled + + + NotificationArea + + + + + + + + + Additional data Sources + + + + + + Errors will appear in the notification area + + + Errors + + + true + + + ErrorSubscriptionEnabled + + + NotificationArea + + + + + + + Warnings will appear in the notification area + + + Warnings + + + true + + + WarningSubscriptionEnabled + + + NotificationArea + + + + + + + Non-Intrusive Notifications @@ -171,71 +265,10 @@ - - - - - Settings - - - - - - The Notification area will appear in the status bar - - - Enable Notification Area - - - true - - - NotificationAreaEnabled - - - NotificationArea - - - - - - - Non-intrusive notifications will appear next to the notification area in the status bar - - - Enable non-intrusive notifications - - - true - - - NonIntrusiveNotificationsEnabled - - - NotificationArea - - - - - - - - - - Qt::Vertical - - - - 20 - 63 - - - - - + Message List @@ -289,6 +322,19 @@ + + + + Qt::Vertical + + + + 20 + 63 + + + +