[education/gcompris/KDE/26.0] src/activities/morse_code: morse_code, fix intro voice not playing

Johnny Jazeix <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 4de598dbea0cd3e65c3fd8bb21e6b0fe1ad970bb by Johnny Jazeix.
Committed on 29/07/2026 at 16:23.
Pushed by jjazeix into branch 'KDE/26.0'.

morse_code, fix intro voice not playing

M  +9    -2    src/activities/morse_code/MorseCode.qml

https://invent.kde.org/education/gcompris/-/commit/4de598dbea0cd3e65c3fd8bb21e6b0fe1ad970bb

diff --git a/src/activities/morse_code/MorseCode.qml b/src/activities/morse_code/MorseCode.qml
index 36265853e..931256dd6 100644
--- a/src/activities/morse_code/MorseCode.qml
+++ b/src/activities/morse_code/MorseCode.qml
@@ -73,6 +73,7 @@ ActivityBase {
             property bool buttonsBlocked: false
             readonly property string middleDot: '·'
             readonly property var regexSpaceReplace: new RegExp(keyboard.space, "g")
+            property bool firstRun: true
 
             onToAlphaChanged: {
                 textInput.text = ''
@@ -107,11 +108,17 @@ ActivityBase {
 
             function initSubLevel() {
                 textInput.text = ''
-                stopMorseSounds();
+                if(firstRun) {
+                    // we want to have the intro voice on startup
+                    firstRun = false
+                }
+                else {
+                    stopMorseSounds();
+                }
                 questionValue = dataset[currentLevel].values[1][score.currentSubLevel]
                 questionValue = questionValue.replace(/\./g, items.middleDot);
                 questionValue = questionValue.replace(items.regexSpaceReplace, ' ');
-                activity.audioVoices.clearQueue();
+                //activity.audioVoices.clearQueue();
                 // Play the audio at start of the sublevel
                 if(items.audioMode) {
                     delayTimer.restart();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.