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



commit d6ef18f8d662d0c86440505f498f9235175c5992
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 4295417..1bbf24b 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -176,6 +176,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
@@ -741,6 +742,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").
@@ -2680,6 +2691,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]