[gcompris] explore activities, added an 'audio' mode.



commit 849626b8d7060dea7c3b6f9e5217abf873f3ff59
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Sun Sep 30 18:24:47 2012 +0200

    explore activities, added an 'audio' mode.
    
    This mode is specified in the xml menu file. If given
    the explore code will display a dialog asking the user to
    enable the music.

 src/explore-activity/explore.py                    |    6 ++++++
 .../explore_farm_animals.xml.in                    |    1 +
 .../explore_world_music.xml.in                     |    1 +
 3 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/explore-activity/explore.py b/src/explore-activity/explore.py
index 9ba3c74..2c5ac61 100644
--- a/src/explore-activity/explore.py
+++ b/src/explore-activity/explore.py
@@ -83,6 +83,12 @@ class Gcompris_explore:
 
         self.display_level(self.gcomprisBoard.level)
 
+        if self.gcomprisBoard.mode == "audio" \
+                and not (gcompris.get_properties().fx):
+            gcompris.utils.dialog(_("Error: This activity cannot be \
+played with the\nsound effects disabled.\nGo to the configuration \
+dialogue to\nenable the sound."), None)
+
     def display_level(self, x=None, y=None, z=None):
 
         # Create a rootitem.
diff --git a/src/explore_farm_animals-activity/explore_farm_animals.xml.in b/src/explore_farm_animals-activity/explore_farm_animals.xml.in
index f99029c..db06974 100644
--- a/src/explore_farm_animals-activity/explore_farm_animals.xml.in
+++ b/src/explore_farm_animals-activity/explore_farm_animals.xml.in
@@ -9,6 +9,7 @@
         author="Beth Hadley (bethmhadley gmail com)"
 	mandatory_sound_file="explore_farm_animals/chickens.ogg"
         boarddir=""
+	mode="audio"
         >
         <_title>Explore Farm Animals</_title>
         <_description>Learn about farm animals, what sounds they make, and interesting facts.</_description>
diff --git a/src/explore_world_music-activity/explore_world_music.xml.in b/src/explore_world_music-activity/explore_world_music.xml.in
index fbb407b..744a9a5 100644
--- a/src/explore_world_music-activity/explore_world_music.xml.in
+++ b/src/explore_world_music-activity/explore_world_music.xml.in
@@ -9,6 +9,7 @@
         author="Beth Hadley (bethmhadley gmail com)"
 	mandatory_sound_file="explore_world_music/america.ogg"
         boarddir=""
+	mode="audio"
         >
         <_title>Explore World Music</_title>
         <_description>Learn about the music of the world.</_description>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]