Index: denali.qrc
===================================================================
diff -u -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 -r733dbd53c542d94baa4862b6d657aa555209ee00
--- denali.qrc (.../denali.qrc) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29)
+++ denali.qrc (.../denali.qrc) (revision 733dbd53c542d94baa4862b6d657aa555209ee00)
@@ -21,6 +21,8 @@
resources/images/logo d Dark Transparent.png
resources/images/Close.png
resources/images/alarm.svg
+ resources/images/bell.svg
+ resources/images/bell-off.svg
sources/gui/qml/components/MainMenu.qml
Index: resources/images/bell-off.svg
===================================================================
diff -u
--- resources/images/bell-off.svg (revision 0)
+++ resources/images/bell-off.svg (revision 733dbd53c542d94baa4862b6d657aa555209ee00)
@@ -0,0 +1 @@
+
\ No newline at end of file
Index: resources/images/bell.svg
===================================================================
diff -u
--- resources/images/bell.svg (revision 0)
+++ resources/images/bell.svg (revision 733dbd53c542d94baa4862b6d657aa555209ee00)
@@ -0,0 +1 @@
+
\ No newline at end of file
Index: sources/gui/qml/components/NotificationBar.qml
===================================================================
diff -u -r255df1f61af0193b8f2f9630bdf3ce68be0f5e29 -r733dbd53c542d94baa4862b6d657aa555209ee00
--- sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision 255df1f61af0193b8f2f9630bdf3ce68be0f5e29)
+++ sources/gui/qml/components/NotificationBar.qml (.../NotificationBar.qml) (revision 733dbd53c542d94baa4862b6d657aa555209ee00)
@@ -23,12 +23,19 @@
Rectangle { id: _root
objectName: "NotificationBar"
- property alias text : _text.text;
- property alias textColor : _text.color;
- property int level : 0;
- property bool isSilenced : false;
+ property alias text : _text.text;
+ property alias textColor : _text.color;
+ property int level : 0;
+ property bool isSilenced : false;
+ property int muteTimeoutSec : 0;
property color backgroundColor : Colors.textNotificationNoneBg;
+ function toggleSilence(silence, timeoutSec) {
+ isSilenced = silence;
+ muteTimeoutSec = !isSilenced ? 0 : timeoutSec;
+ _bell.source = isSilenced ? "qrc:/images/bell-off.svg" : "qrc:/images/bell.svg"
+ }
+
visible : _text.text
height : Variables.notificationHeight
@@ -67,6 +74,39 @@
verticalAlignment : Text.AlignVCenter
}
+ Image {
+ id: _bell
+ source: isSilenced ? "qrc:/images/bell-off.svg" : "qrc:/images/bell.svg"
+ anchors.left: _text.right
+ anchors.leftMargin: Variables.notificationBarIconMargin;
+ anchors.verticalCenter: parent.verticalCenter;
+ sourceSize.height: Variables.notificationBarIconHeight;
+ sourceSize.width: Variables.notificationBarIconWidth;
+ visible: isSilenced; // for now, just hide if the alarm is not silenced.
+ }
+
+ ColorOverlay {
+ id: _bell_overlay
+ anchors.fill: _bell;
+ source: _bell;
+ color: Colors.textMain;
+ cached: true;
+ antialiasing: true;
+ visible: isSilenced; // for now, just hide if the alarm is not silenced.
+ }
+
+ Text { id: _timeout_text
+ color : Colors.textMain;
+ anchors.left : _bell.right
+ anchors.leftMargin : Variables.notificationBarIconMargin;
+ anchors.verticalCenter: parent.verticalCenter;
+ font.pixelSize : Fonts.fontPixelNotification
+ horizontalAlignment : Text.AlignHCenter
+ verticalAlignment : Text.AlignVCenter
+ text: muteTimeoutSec; // will be 60 second or less (see PRS)
+ visible: isSilenced;
+ }
+
onLevelChanged: {
[_root.color, _text.color] = getRootTextFromAlarmLevel(level);
}
Index: sources/gui/qml/main.qml
===================================================================
diff -u -r1a364403f0d1839397054b1eca4d51201b0cf943 -r733dbd53c542d94baa4862b6d657aa555209ee00
--- sources/gui/qml/main.qml (.../main.qml) (revision 1a364403f0d1839397054b1eca4d51201b0cf943)
+++ sources/gui/qml/main.qml (.../main.qml) (revision 733dbd53c542d94baa4862b6d657aa555209ee00)
@@ -111,21 +111,22 @@
VAlarmStatus { id: vAlarmStatus
onRaiseAlarm: {
updateAlarm();
- _alarm.isSilenced = vAlarmStatus.alarm_Flag_alarmsSilenced
_notification.isSilenced = vAlarmStatus.alarm_Flag_alarmsSilenced
+ _notification_bar.toggleSilence(vAlarmStatus.alarm_Flag_alarmsSilenced,
+ vAlarmStatus.alarm_MuteTimeout);
if (vAlarmStatus.alarm_Priority === GuiActions.ALARM_PRIORITY_HIGH) {
_notification.visible = true;
- _alarm.visible = false;
+ _notification_bar.visible = false;
} else {
if (!_notification.visible) {
- _alarm.visible = true;
+ _notification_bar.visible = true;
}
}
}
onHideAlarm: {
- _alarm.visible = false;
+ _notification_bar.visible = false;
_notification.visible = false;
}
}
@@ -186,18 +187,20 @@
}
- NotificationBar { id: _alarm
+ NotificationBar { id: _notification_bar
anchors.bottom: _mainMenu.top
level : vAlarmStatus.alarm_Priority
text : vAlarmStatus.text;
+ isSilenced: vAlarmStatus.alarm_Flag_alarmsSilenced;
+
MouseArea {
id: _TouchArea
anchors.fill: parent;
onClicked: {
updateAlarm();
_notification.visible = true;
- _alarm.visible = false;
+ _notification_bar.visible = false;
}
}
@@ -208,12 +211,12 @@
_notification.description = vAlarmStatus.text;
[_notification.backgroundColor, _notification.textColor] = getRootTextFromAlarmLevel(vAlarmStatus.alarm_Priority);
[_notification.titleBarBackground, _notification.titleBarForeground] = getAlarmTopBarColors(vAlarmStatus.alarm_Priority);
- _alarm.backgroundColor = _notification.titleBarBackground;
+ _notification_bar.backgroundColor = _notification.titleBarBackground;
}
Alarm { id: _notification
onClosed: {
- _alarm.visible = true;
+ _notification_bar.visible = true;
}
onPressedOkay: {
_notification.visible = false;