Commit 87765ff4 authored by Timothée Giet's avatar Timothée Giet

memory-sound, add dialog to warn that activity will play audio in any case

parent c9e05c53
......@@ -50,6 +50,8 @@ ActivityBase {
property alias items: items
property bool keyNavigationVisible: false
// if audio is disabled, we display a dialog to tell users this activity requires audio anyway
property bool audioDisabled: false
Component.onCompleted: {
dialogActivityConfig.initialize()
......@@ -82,6 +84,8 @@ ActivityBase {
Activity.start(items);
if(activity.needsVoices === true) {
activity.isMusicalActivity = true
if(!ApplicationSettings.isAudioVoicesEnabled || !ApplicationSettings.isAudioEffectsEnabled)
background.audioDisabled = true
}
}
......@@ -276,5 +280,24 @@ ActivityBase {
else if(event.key === Qt.Key_Space || event.key === Qt.Key_Enter || event.key === Qt.Key_Return)
if(grid.currentItem.isBack && !grid.currentItem.isFound && !grid.currentItem.tuxTurn && items.selectionCount < 2) grid.currentItem.selected()
}
Loader {
id: audioNeededDialog
sourceComponent: GCDialog {
parent: activity
isDestructible: false
message: qsTr("This activity requires audio, so it will play some sounds even if the audio voices or effects are disabled in the main configuration.")
button1Text: qsTr("Quit")
button2Text: qsTr("Continue")
onButton1Hit: activity.home();
onClose: {
background.audioDisabled = false;
}
}
anchors.fill: parent
focus: true
active: background.audioDisabled
onStatusChanged: if (status == Loader.Ready) item.start()
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment