NotificationArea: Preference page to control warnings and errors

This commit is contained in:
Abdullah Tahiri
2023-03-26 09:45:40 +02:00
committed by abdullahtahiriyo
parent 8608c6a845
commit 699d8a83ec
2 changed files with 116 additions and 62 deletions

View File

@@ -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();
}

View File

@@ -14,7 +14,101 @@
<string>Notification Area</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QGroupBox" name="GroupBox11">
<property name="title">
<string>Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="NotificationAreaEnabled">
<property name="toolTip">
<string>The Notification area will appear in the status bar</string>
</property>
<property name="text">
<string>Enable Notification Area</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>NotificationAreaEnabled</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>NotificationArea</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="NonIntrusiveNotificationsEnabled">
<property name="toolTip">
<string>Non-intrusive notifications will appear next to the notification area in the status bar</string>
</property>
<property name="text">
<string>Enable non-intrusive notifications</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>NonIntrusiveNotificationsEnabled</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>NotificationArea</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="GroupBoxSubscriptions">
<property name="title">
<string>Additional data Sources</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="errorSubscriptionEnabled">
<property name="toolTip">
<string>Errors will appear in the notification area</string>
</property>
<property name="text">
<string>Errors</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>ErrorSubscriptionEnabled</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>NotificationArea</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="warningSubscriptionEnabled">
<property name="toolTip">
<string>Warnings will appear in the notification area</string>
</property>
<property name="text">
<string>Warnings</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>WarningSubscriptionEnabled</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>NotificationArea</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Non-Intrusive Notifications</string>
@@ -171,71 +265,10 @@
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="GroupBox11">
<property name="title">
<string>Settings</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="Gui::PrefCheckBox" name="NotificationAreaEnabled">
<property name="toolTip">
<string>The Notification area will appear in the status bar</string>
</property>
<property name="text">
<string>Enable Notification Area</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>NotificationAreaEnabled</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>NotificationArea</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="Gui::PrefCheckBox" name="NonIntrusiveNotificationsEnabled">
<property name="toolTip">
<string>Non-intrusive notifications will appear next to the notification area in the status bar</string>
</property>
<property name="text">
<string>Enable non-intrusive notifications</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="prefEntry" stdset="0">
<cstring>NonIntrusiveNotificationsEnabled</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>NotificationArea</cstring>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="6" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>63</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0">
<item row="3" column="0">
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Message List</string>
@@ -289,6 +322,19 @@
</layout>
</widget>
</item>
<item row="4" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>63</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>