Commit f8d79d6b authored by Bruno Coudoin's avatar Bruno Coudoin
Browse files

core, better management of ActivityBase's ActivityInfo

No more play the intro voice again when leaving an activity.
parent 84825666
...@@ -27,6 +27,7 @@ import "qrc:/gcompris/src/core/core.js" as Core ...@@ -27,6 +27,7 @@ import "qrc:/gcompris/src/core/core.js" as Core
ActivityBase { ActivityBase {
id: menuActivity id: menuActivity
focus: true focus: true
activityInfo: ActivityInfoTree.rootMenu
onHome: pageView.depth === 1 ? Core.quit(menuActivity) : pageView.pop() onHome: pageView.depth === 1 ? Core.quit(menuActivity) : pageView.pop()
...@@ -78,6 +79,7 @@ ActivityBase { ...@@ -78,6 +79,7 @@ ActivityBase {
function loadActivity() { function loadActivity() {
activityLoader.item.menu = menuActivity activityLoader.item.menu = menuActivity
activityLoader.item.activityInfo = ActivityInfoTree.currentActivity
pageView.push(activityLoader.item) pageView.push(activityLoader.item)
} }
......
...@@ -27,7 +27,7 @@ Item { ...@@ -27,7 +27,7 @@ Item {
property Item main: parent; property Item main: parent;
property Component pageComponent property Component pageComponent
property QtObject menu property QtObject menu
property QtObject activityInfo: ActivityInfoTree.currentActivity property QtObject activityInfo
// The global audio item, append to it to play your sounds after the // The global audio item, append to it to play your sounds after the
// intro music // intro music
property GCAudio audio property GCAudio audio
......
...@@ -35,8 +35,6 @@ Window { ...@@ -35,8 +35,6 @@ Window {
minimumHeight: 400 minimumHeight: 400
title: "GCompris" title: "GCompris"
property QtObject currentActivity
onClosing: Core.quit() onClosing: Core.quit()
GCAudio { GCAudio {
...@@ -81,7 +79,6 @@ Window { ...@@ -81,7 +79,6 @@ Window {
properties.exitItem.pause() properties.exitItem.pause()
if(!properties.exitItem.isDialog) { if(!properties.exitItem.isDialog) {
playIntroVoice(properties.enterItem.activityInfo.name) playIntroVoice(properties.enterItem.activityInfo.name)
currentActivity = properties.enterItem
properties.enterItem.audio = audio properties.enterItem.audio = audio
properties.enterItem.start() properties.enterItem.start()
} }
...@@ -106,7 +103,6 @@ Window { ...@@ -106,7 +103,6 @@ Window {
{ {
properties.exitItem.opacity = 1 properties.exitItem.opacity = 1
properties.enterItem.play() properties.enterItem.play()
currentActivity = properties.enterItem
if(!properties.enterItem.isDialog) { if(!properties.enterItem.isDialog) {
properties.exitItem.stop() properties.exitItem.stop()
} }
......
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