[orca] Fix loading capitalization style value in Preferences dialog



commit 65b8b328188ccbd57317a4327c4550475ded127b
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Nov 26 12:59:59 2015 -0500

    Fix loading capitalization style value in Preferences dialog

 src/orca/orca_gui_prefs.py          |   10 +++++++---
 src/orca/speechdispatcherfactory.py |    9 ++++++++-
 2 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/orca_gui_prefs.py b/src/orca/orca_gui_prefs.py
index 17eda26..7c23e6a 100644
--- a/src/orca/orca_gui_prefs.py
+++ b/src/orca/orca_gui_prefs.py
@@ -1340,9 +1340,13 @@ class OrcaSetupGUI(orca_gtkbuilder.GtkBuilderWrapper):
                    guilabels.CAPITALIZATION_STYLE_ICON,
                    guilabels.CAPITALIZATION_STYLE_SPELL]
         self.populateComboBox(combobox, options)
-        if style not in options:
-            style = guilabels.CAPITALIZATION_STYLE_NONE
-        combobox.set_active(options.index(style))
+        if style == settings.CAPITALIZATION_STYLE_ICON:
+            value = guilabels.CAPITALIZATION_STYLE_ICON
+        elif style == settings.CAPITALIZATION_STYLE_SPELL:
+            value = guilabels.CAPITALIZATION_STYLE_SPELL
+        else:
+            value = guilabels.CAPITALIZATION_STYLE_NONE
+        combobox.set_active(options.index(value))
 
         combobox2 = self.get_widget("dateFormatCombo")
         sdtime = time.strftime
diff --git a/src/orca/speechdispatcherfactory.py b/src/orca/speechdispatcherfactory.py
index e999bff..9d53df0 100644
--- a/src/orca/speechdispatcherfactory.py
+++ b/src/orca/speechdispatcherfactory.py
@@ -174,7 +174,14 @@ class SpeechServer(speechserver.SpeechServer):
 
     def updateCapitalizationStyle(self):
         """Updates the capitalization style used by the speech server."""
-        self._client.set_cap_let_recogn(settings.capitalizationStyle)
+
+        if settings.capitalizationStyle == settings.CAPITALIZATION_STYLE_ICON:
+            style = 'icon'
+        elif settings.capitalizationStyle == settings.CAPITALIZATION_STYLE_SPELL:
+            style = 'spell'
+        else:
+            style = 'none'
+        self._client.set_cap_let_recogn(style)
 
     def updatePunctuationLevel(self):
         """ Punctuation level changed, inform this speechServer. """


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