[orca] Give default speech generator smarts to generate child count for listboxes
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Give default speech generator smarts to generate child count for listboxes
- Date: Thu, 28 May 2015 20:23:02 +0000 (UTC)
commit b65315cb45a9921054175c71a24e11344695e850
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu May 28 16:21:14 2015 -0400
Give default speech generator smarts to generate child count for listboxes
.../scripts/toolkits/Gecko/speech_generator.py | 13 -------------
src/orca/speech_generator.py | 8 +++++++-
2 files changed, 7 insertions(+), 14 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/speech_generator.py
b/src/orca/scripts/toolkits/Gecko/speech_generator.py
index 7bebe5c..9321825 100644
--- a/src/orca/scripts/toolkits/Gecko/speech_generator.py
+++ b/src/orca/scripts/toolkits/Gecko/speech_generator.py
@@ -159,19 +159,6 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
# out some of the noise....
return []
- def _generateNumberOfChildren(self, obj, **args):
- if _settingsManager.getSetting('onlySpeakDisplayedText'):
- return []
-
- role = args.get('role', obj.getRole())
- if role not in [pyatspi.ROLE_LIST, pyatspi.ROLE_LIST_BOX] \
- or not self._script.utilities.inDocumentContent(obj):
- return super()._generateNumberOfChildren(obj, **args)
-
- result = [messages.listItemCount(obj.childCount)]
- result.extend(self.voice(speech_generator.SYSTEM))
- return result
-
# TODO - JD: Yet another dumb generator method we should kill.
def _generateTextRole(self, obj, **args):
return self._generateRoleName(obj, **args)
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 4e8d614..97bc8bb 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1398,8 +1398,14 @@ class SpeechGenerator(generator.Generator):
if _settingsManager.getSetting('onlySpeakDisplayedText'):
return []
- result = []
acss = self.voice(SYSTEM)
+ role = args.get('role', obj.getRole())
+ if role in [pyatspi.ROLE_LIST, pyatspi.ROLE_LIST_BOX]:
+ result = [messages.listItemCount(obj.childCount)]
+ result.extend(acss)
+ return result
+
+ result = []
childNodes = self._script.utilities.childNodes(obj)
children = len(childNodes)
if children:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]