[orca] Don't speak number of children when verbosity is set to brief



commit fffcc580a34dae9da33d4a3df5ba3d6763c511a8
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Feb 18 10:35:17 2020 +0100

    Don't speak number of children when verbosity is set to brief

 src/orca/formatting.py                                           | 8 ++++----
 src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py | 4 +++-
 src/orca/scripts/web/speech_generator.py                         | 4 +++-
 src/orca/speech_generator.py                                     | 4 +++-
 4 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/src/orca/formatting.py b/src/orca/formatting.py
index d546b3b50..484f4f3da 100644
--- a/src/orca/formatting.py
+++ b/src/orca/formatting.py
@@ -295,12 +295,12 @@ formatting = {
             'basicWhereAmI': 'linkInfo + pause + siteDescription + pause + fileSize + pause + ' + MNEMONIC
             },
         pyatspi.ROLE_LIST: {
-            'focused' : 'leaving or (labelOrName + pause + numberOfChildren + pause + nestingLevel)',
-            'unfocused': 'labelOrName + pause + focusedItem + pause + multiselectableState + 
numberOfChildren + pause'
+            'focused' : 'leaving or (labelOrName + pause + (numberOfChildren or roleName) + pause + 
nestingLevel)',
+            'unfocused': 'labelOrName + pause + focusedItem + pause + multiselectableState + 
(numberOfChildren or roleName) + pause'
             },
         pyatspi.ROLE_LIST_BOX: {
-            'focused': 'labelOrName + multiselectableState + numberOfChildren',
-            'unfocused': 'labelOrName + pause + focusedItem + pause + multiselectableState + 
numberOfChildren + pause'
+            'focused': 'labelOrName + multiselectableState + (numberOfChildren or roleName)',
+            'unfocused': 'labelOrName + pause + focusedItem + pause + multiselectableState + 
(numberOfChildren or roleName) + pause'
             },
         pyatspi.ROLE_LIST_ITEM: {
             'focused': 'expandableState',
diff --git a/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py 
b/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
index 108e6dc02..a7c7545e7 100644
--- a/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
+++ b/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
@@ -28,6 +28,7 @@ __license__   = "LGPL"
 import pyatspi
 
 import orca.messages as messages
+import orca.settings as settings
 import orca.settings_manager as settings_manager
 import orca.speech_generator as speech_generator
 
@@ -85,7 +86,8 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         specifications) that represents the number of children the
         object has."""
 
-        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+        if _settingsManager.getSetting('onlySpeakDisplayedText') \
+           or _settingsManager.getSetting('speechVerbosityLevel') == settings.VERBOSITY_LEVEL_BRIEF:
             return []
 
         result = []
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index a551cfac0..9912edd12 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -34,6 +34,7 @@ from orca import debug
 from orca import messages
 from orca import object_properties
 from orca import orca_state
+from orca import settings
 from orca import settings_manager
 from orca import speech_generator
 
@@ -365,7 +366,8 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         return []
 
     def _generateNumberOfChildren(self, obj, **args):
-        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+        if _settingsManager.getSetting('onlySpeakDisplayedText') \
+           or _settingsManager.getSetting('speechVerbosityLevel') == settings.VERBOSITY_LEVEL_BRIEF:
             return []
 
         # We handle things even for non-document content due to issues in
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 46d9b7bce..37e6107f7 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1524,7 +1524,9 @@ class SpeechGenerator(generator.Generator):
         this doesn't apply?]]] [[[WDW - I wonder if this string should
         be moved to settings.py.]]]
         """
-        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+
+        if _settingsManager.getSetting('onlySpeakDisplayedText') \
+           or _settingsManager.getSetting('speechVerbosityLevel') == settings.VERBOSITY_LEVEL_BRIEF:
             return []
 
         result = []


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