[orca] Don't update punctuation and capitalization styles for messages in default voice



commit 11be3c32c38ab06ea753d8655a23281ec55113ed
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri Nov 27 10:27:52 2015 -0500

    Don't update punctuation and capitalization styles for messages in default voice

 src/orca/scripts/default.py |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index bc99506..a40970b 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -4446,22 +4446,25 @@ class Script(script.Script):
            or _settingsManager.getSetting('onlySpeakDisplayedText'):
             return
 
-        capStyle = _settingsManager.getSetting('capitalizationStyle')
-        _settingsManager.setSetting('capitalizationStyle', settings.CAPITALIZATION_STYLE_NONE)
-        speech.updateCapitalizationStyle()
+        systemVoice = self.voices.get(settings.SYSTEM_VOICE)
+        voice = voice or systemVoice
+        if voice == systemVoice:
+            capStyle = _settingsManager.getSetting('capitalizationStyle')
+            _settingsManager.setSetting('capitalizationStyle', settings.CAPITALIZATION_STYLE_NONE)
+            speech.updateCapitalizationStyle()
 
-        punctStyle = _settingsManager.getSetting('verbalizePunctuationStyle')
-        _settingsManager.setSetting('verbalizePunctuationStyle', settings.PUNCTUATION_STYLE_NONE)
-        speech.updatePunctuationLevel()
+            punctStyle = _settingsManager.getSetting('verbalizePunctuationStyle')
+            _settingsManager.setSetting('verbalizePunctuationStyle', settings.PUNCTUATION_STYLE_NONE)
+            speech.updatePunctuationLevel()
 
-        voice = voice or self.voices.get(settings.SYSTEM_VOICE)
         speech.speak(string, voice, interrupt)
 
-        _settingsManager.setSetting('capitalizationStyle', capStyle)
-        speech.updateCapitalizationStyle()
+        if voice == systemVoice:
+            _settingsManager.setSetting('capitalizationStyle', capStyle)
+            speech.updateCapitalizationStyle()
 
-        _settingsManager.setSetting('verbalizePunctuationStyle', punctStyle)
-        speech.updatePunctuationLevel()
+            _settingsManager.setSetting('verbalizePunctuationStyle', punctStyle)
+            speech.updatePunctuationLevel()
 
     @staticmethod
     def presentItemsInSpeech(items):


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