[orca] Don't verbalize punctuation or capitalization for messages
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Don't verbalize punctuation or capitalization for messages
- Date: Thu, 26 Nov 2015 09:16:57 +0000 (UTC)
commit e3ab12136123983b2c50e0e9021f6410d3b1b83b
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Nov 26 04:14:44 2015 -0500
Don't verbalize punctuation or capitalization for messages
src/orca/orca.py | 13 ++++++-------
src/orca/scripts/default.py | 34 +++++++++++++++++++++-------------
2 files changed, 27 insertions(+), 20 deletions(-)
---
diff --git a/src/orca/orca.py b/src/orca/orca.py
index 61c7e48..9283f8b 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -437,14 +437,16 @@ def loadUserSettings(script=None, inputEvent=None, skipReloadMessage=False):
except:
debug.printException(debug.LEVEL_SEVERE)
+ if not script:
+ script = _scriptManager.getDefaultScript()
+
_settingsManager.loadAppSettings(script)
if _settingsManager.getSetting('enableSpeech'):
try:
speech.init()
if reloaded and not skipReloadMessage:
- speech.speak(messages.SETTINGS_RELOADED,
- settings.voices.get(settings.SYSTEM_VOICE))
+ script.speakMessage(messages.SETTINGS_RELOADED)
debug.println(debug.LEVEL_CONFIGURATION,
"Speech module has been initialized.")
except:
@@ -783,11 +785,8 @@ def main(cacheValues=True):
try:
message = messages.START_ORCA
- if not _settingsManager.getSetting('onlySpeakDisplayedText'):
- speech.speak(message, settings.voices.get(settings.SYSTEM_VOICE))
- if _settingsManager.getSetting('enableBraille') \
- or _settingsManager.getSetting('enableBrailleMonitor'):
- braille.displayMessage(message)
+ script = _scriptManager.getDefaultScript()
+ script.presentMessage(message)
except:
debug.printException(debug.LEVEL_SEVERE)
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 04ff3ff..2d654b9 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -4060,21 +4060,12 @@ class Script(script.Script):
briefMessage = fullMessage
if _settingsManager.getSetting('enableSpeech'):
- currentCapStyle = _settingsManager.getSetting('capitalizationStyle')
- _settingsManager.setSetting(
- 'capitalizationStyle', settings.CAPITALIZATION_STYLE_NONE)
- speech.updateCapitalizationStyle()
-
if not _settingsManager.getSetting('messagesAreDetailed'):
message = briefMessage
else:
message = fullMessage
if message:
- voice = voice or self.voices.get(settings.SYSTEM_VOICE)
- speech.speak(message, voice)
-
- _settingsManager.setSetting('capitalizationStyle', currentCapStyle)
- speech.updateCapitalizationStyle()
+ self.speakMessage(message, voice)
if (_settingsManager.getSetting('enableBraille') \
or _settingsManager.getSetting('enableBrailleMonitor')) \
@@ -4466,9 +4457,26 @@ class Script(script.Script):
prior to speaking the new text.
"""
- if _settingsManager.getSetting('enableSpeech'):
- voice = voice or self.voices.get(settings.SYSTEM_VOICE)
- speech.speak(string, voice, interrupt)
+ if not _settingsManager.getSetting('enableSpeech') \
+ or _settingsManager.getSetting('onlySpeakDisplayedText'):
+ return
+
+ 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()
+
+ voice = voice or self.voices.get(settings.SYSTEM_VOICE)
+ speech.speak(string, voice, interrupt)
+
+ _settingsManager.setSetting('capitalizationStyle', capStyle)
+ speech.updateCapitalizationStyle()
+
+ _settingsManager.setSetting('verbalizePunctuationStyle', punctStyle)
+ speech.updatePunctuationLevel()
@staticmethod
def presentItemsInSpeech(items):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]