feat: allow users to turn of notification sounds

This commit is contained in:
Pascal Precht 2020-10-15 17:04:53 +02:00 committed by Iuri Matias
parent 3d0f50a5b3
commit 7577b3a2e6
4 changed files with 10 additions and 2 deletions

View File

@ -131,7 +131,10 @@ ScrollView {
StatusSwitch { StatusSwitch {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
checked: true checked: appSettings.notificationSoundsEnabled
onCheckedChanged: {
appSettings.notificationSoundsEnabled = this.checked
}
} }
} }

View File

@ -54,6 +54,7 @@ ApplicationWindow {
audioRole: Audio.NotificationRole audioRole: Audio.NotificationRole
source: "../../../../sounds/send_message.wav" source: "../../../../sounds/send_message.wav"
volume: appSettings.volume volume: appSettings.volume
muted: !appSettings.notificationSoundsEnabled
} }
Audio { Audio {
@ -61,6 +62,7 @@ ApplicationWindow {
audioRole: Audio.NotificationRole audioRole: Audio.NotificationRole
source: "../../../../sounds/notification.wav" source: "../../../../sounds/notification.wav"
volume: appSettings.volume volume: appSettings.volume
muted: !appSettings.notificationSoundsEnabled
} }
signal settingsLoaded() signal settingsLoaded()
@ -77,6 +79,7 @@ ApplicationWindow {
property var recentEmojis: [] property var recentEmojis: []
property real volume: 0.2 property real volume: 0.2
property int notificationSetting: 0 property int notificationSetting: 0
property bool notificationSoundsEnabled: true
} }
Connections { Connections {
target: profileModel target: profileModel

View File

@ -54,6 +54,7 @@ Rectangle {
id: sendMessageSound id: sendMessageSound
source: "../../sounds/send_message.wav" source: "../../sounds/send_message.wav"
volume: appSettings.volume volume: appSettings.volume
muted: !appSettings.notificationSoundsEnabled
} }
function calculateExtraHeightFactor() { function calculateExtraHeightFactor() {

View File

@ -5,7 +5,8 @@ Audio {
id: errorSound id: errorSound
source: "./error.mp3" source: "./error.mp3"
audioRole: Audio.NotificationRole audioRole: Audio.NotificationRole
volume: 0.2 volume: appSettings.volume
muted: !appSettings.notificationSoundsEnabled
} }
/*##^## /*##^##