[orca/new-settings] Fix for bug #609900 - Speech page speechdispatcher defaults to zh



commit d04ffc2491b7853b53298e17aae4c64ef74887a8
Author: J. Félix Ontañón <fontanon emergya es>
Date:   Mon Sep 13 20:58:48 2010 +0200

    Fix for bug #609900 - Speech page speechdispatcher defaults to zh

 src/orca/orca_gui_prefs.py |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 806fd50..b72758c 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -183,6 +183,7 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
         self.savedPitch = None
         self.savedRate = None
         self._isInitialSetup = False
+        self.selectedFamilyChoices = {}
 
     def init(self):
         """Initialize the Orca configuration GUI. Read the users current
@@ -752,6 +753,16 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
             self.speechFamiliesModel.append((i, name))
             i += 1
 
+        # If user manually selected a family for the current speech server
+        # this choice it's restored. In other case the first family
+        # (usually the default one) is selected
+        #
+        selectedIndex = 0
+        if self.selectedFamilyChoices.has_key(self.speechServersChoice):
+            selectedIndex = self.selectedFamilyChoices[self.speechServersChoice]
+
+        self.get_widget("speechFamilies").set_active(selectedIndex)
+
         # The family name will be selected as part of selecting the
         # voice type.  Whenever the families change, we'll reset the
         # voice type selection to the first one ("Default").
@@ -2749,6 +2760,12 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
         except:
             debug.printException(debug.LEVEL_SEVERE)
 
+        # Remember the last family manually selected by the user for the
+        # current speech server.
+        #
+        if not selectedIndex == -1:
+            self.selectedFamilyChoices[self.speechServersChoice] = selectedIndex
+
     def voiceTypesChanged(self, widget):
         """Signal handler for the "changed" signal for the voiceTypes
            GtkComboBox widget. The user has selected a different voice



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