Allow disabling notifications.

This commit is contained in:
Black Hat 2018-11-22 20:35:49 +08:00
parent 6d30e9d682
commit d708c9aab6
3 changed files with 15 additions and 9 deletions

View File

@ -33,7 +33,7 @@ Rectangle {
connection: controller.connection
onNewMessage: if (!window.active) spectralController.postNotification(roomId, eventId, roomName, senderName, text, icon, iconPath)
onNewMessage: if (!window.active && MSettings.showNotification) spectralController.postNotification(roomId, eventId, roomName, senderName, text, icon, iconPath)
}
SortFilterProxyModel {
@ -445,6 +445,13 @@ Rectangle {
onCheckedChanged: MSettings.darkTheme = checked
}
Switch {
text: "Show notifications"
checked: MSettings.showNotification
onCheckedChanged: MSettings.showNotification = checked
}
Switch {
text: "Use press and hold instead of right click"
checked: MSettings.pressAndHold
@ -459,13 +466,6 @@ Rectangle {
onCheckedChanged: MSettings.showTray = checked
}
Switch {
text: "Confirm on Exit"
checked: MSettings.confirmOnExit
onCheckedChanged: MSettings.confirmOnExit = checked
}
RowLayout {
Layout.fillWidth: true

View File

@ -3,9 +3,10 @@ import QtQuick 2.9
import Qt.labs.settings 1.0
Settings {
property bool showNotification: true
property bool pressAndHold
property bool showTray: true
property bool confirmOnExit: true
property bool darkTheme
}

View File

@ -67,6 +67,11 @@ ApplicationWindow {
onSyncDone: roomListForm.errorControl.visible = false
}
Shortcut {
sequence: StandardKey.Quit
onActivated: Qt.quit()
}
Dialog {
property bool busy: false