[gcompris/gcomprixogoo] Fixed sound localization menu in the administration



commit e56ea94f6154e844f6b516b2dbcad08e6ccdcab8
Author: Bruno Coudoin <bruno coudoin free fr>
Date:   Fri Dec 25 19:59:52 2009 +0100

    Fixed sound localization menu in the administration

 src/administration-activity/admin/board_list.py |   33 +++++++----------------
 src/pythontest-activity/pythontest.py           |   18 +++++++-----
 2 files changed, 20 insertions(+), 31 deletions(-)
---
diff --git a/src/administration-activity/admin/board_list.py b/src/administration-activity/admin/board_list.py
index 23dcef9..aa46953 100644
--- a/src/administration-activity/admin/board_list.py
+++ b/src/administration-activity/admin/board_list.py
@@ -641,42 +641,28 @@ class Board_list:
 
   def locales(self, button):
     conf_locales = self.get_configured(self.active_profile, 'locale', 'NULL')
-    self.main_vbox = gcompris.configuration_window ( \
+    bconf = gcompris.configuration_window ( \
       _('<b>{config}</b> configuration\n for profile <b>{profile}</b>').format(config='Locale',
                                                                                profile=self.active_profile.name),
       self.ok_callback
       )
 
-    label = gtk.Label()
-    label.set_line_wrap(True)
-    label.set_markup('Choose the default locale used by localizable boards for profile %s' % self.active_profile.name)
-    label.show()
-    self.main_vbox.pack_start (label, False, False, 8)
-
-    gcompris.separator()
-
-    gcompris.combo_locales( conf_locales)
+    gcompris.combo_locales(bconf, conf_locales)
 
   def locales_sound(self, button):
 
-    conf_locales = self.get_configured(self.active_profile, 'locale_sound', 'NULL')
-    self.main_vbox = gcompris.configuration_window ( \
+    conf_locales = self.get_configured(self.active_profile,
+                                       'locale_sound', 'NULL')
+    bconf = gcompris.configuration_window ( \
       _('<b>{config}</b> configuration\n for profile <b>{profile}</b>').format(config='Locale sound',
                                                                                profile=self.active_profile.name),
       self.ok_callback
       )
 
-    label = gtk.Label()
-    label.set_line_wrap(True)
-    label.set_markup('Choose the default locale for <b>sounds</b> used by localizable boards for profile %s' % self.active_profile.name)
-    label.show()
-    self.main_vbox.pack_start (label, False, False, 8)
-
-    gcompris.separator()
-
-    gcompris.combo_locales_asset( _("Select sound locale"),
+    gcompris.combo_locales_asset( bconf,
+                                  _("Select sound locale"),
                                   conf_locales,
-                                  "sounds/$LOCALE/colors/purple.ogg" )
+                                  "voices/$LOCALE/colors/red.ogg" )
 
 
   def ok_callback(self, dict):
@@ -694,7 +680,8 @@ class Board_list:
       self.con.commit()
 
   def get_configured(self, profile, key, if_not):
-    self.cur.execute('select conf_value from board_profile_conf where profile_id=%d and board_id=-1 and conf_key =\'%s\' ' % (profile.profile_id, key))
+    self.cur.execute('select conf_value from board_profile_conf where profile_id=%d and board_id=-1 and conf_key =\'%s\' '
+                     % (profile.profile_id, key))
 
     value = self.cur.fetchall()
 
diff --git a/src/pythontest-activity/pythontest.py b/src/pythontest-activity/pythontest.py
index 074e911..70e03a0 100644
--- a/src/pythontest-activity/pythontest.py
+++ b/src/pythontest-activity/pythontest.py
@@ -213,9 +213,9 @@ class Gcompris_pythontest:
     goocanvas.Rect(
       parent = self.rootitem,
       x = 20,
-      y = gcompris.BOARD_HEIGHT-180,
+      y = gcompris.BOARD_HEIGHT-220,
       width = gcompris.BOARD_WIDTH-40,
-      height = 160,
+      height = 150,
       fill_color_rgba=0xFF663333L,
       stroke_color_rgba=0xFF33CCAAL,
       line_width=2.0)
@@ -224,7 +224,7 @@ class Gcompris_pythontest:
     self.canvasitems[6] = goocanvas.Text(
       parent = self.rootitem,
       x=gcompris.BOARD_WIDTH / 2,
-      y=gcompris.BOARD_HEIGHT - 40,
+      y=gcompris.BOARD_HEIGHT - 100,
       font=gcompris.skin.get_font("gcompris/content"),
       fill_color_rgba=0x102010FFL,
       anchor = gtk.ANCHOR_CENTER,
@@ -234,7 +234,7 @@ class Gcompris_pythontest:
     goocanvas.Text(
       parent = self.rootitem,
       x=400.0,
-      y=400.0,
+      y=360.0,
       text=("Test your reflex with the counter. Hit the 2 shifts key together.\nHit space to reset the counter and increase the speed.\nBackspace to reset the speed"),
       fill_color="black",
       anchor = gtk.ANCHOR_CENTER,
@@ -252,7 +252,7 @@ class Gcompris_pythontest:
     self.canvasitems[7] =goocanvas.Text(
       parent = self.rootitem,
       x=gcompris.BOARD_WIDTH / 2,
-      y=gcompris.BOARD_HEIGHT - 80,
+      y=gcompris.BOARD_HEIGHT - 120,
       font=gcompris.skin.get_font("gcompris/content"),
       text="Speed="+str(self.timerinc)+" ms",
       fill_color="black",
@@ -264,7 +264,7 @@ class Gcompris_pythontest:
       parent = self.rootitem,
       font=gcompris.skin.get_font("gcompris/content"),
       x=gcompris.BOARD_WIDTH / 3,
-      y=gcompris.BOARD_HEIGHT - 40,
+      y=gcompris.BOARD_HEIGHT - 100,
       fill_color_rgba=0xFF000FFFL
       )
 
@@ -272,7 +272,7 @@ class Gcompris_pythontest:
       parent = self.rootitem,
       font=gcompris.skin.get_font("gcompris/content"),
       x=gcompris.BOARD_WIDTH / 1.5,
-      y=gcompris.BOARD_HEIGHT - 40,
+      y=gcompris.BOARD_HEIGHT - 100,
       fill_color_rgba=0xFF000FFFL
       )
 
@@ -515,7 +515,9 @@ class Gcompris_pythontest:
     label.props.visibility = goocanvas.ITEM_VISIBLE
 #    self.main_vbox.pack_start (label, False, False, 8)
 
-    gcompris.combo_locales_asset(bconf, _("Select sound locale"), self.config_dict['locale_sound'], "gcompris colors", None, "audio/x-ogg", "purple.ogg" )
+    gcompris.combo_locales_asset(bconf, _("Select sound locale"),
+                                 self.config_dict['locale_sound'],
+                                 "voices/$LOCALE/colors/red.ogg" )
 
     print gcompris.utils.get_asset_file ("gcompris colors", None, "audio/x-ogg", "purple.ogg")
     print gcompris.utils.get_asset_file_locale ("gcompris colors", None, "audio/x-ogg", "purple.ogg", None)



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