[orca] Suppress bogus "not selected" presentation in Evo's Messages tree table



commit 05c78f6b3e11647a7def3af50574d6c58f929f81
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Jan 21 00:13:55 2015 -0500

    Suppress bogus "not selected" presentation in Evo's Messages tree table
    
    The cells in the Messages tree table have the SELECTABLE state, and get
    selected (in the highlighted sense of the word). But they never seem to
    expose the SELECTED state. This needs to be fixed in Evo, but for now
    we'll suppress the noise.

 .../scripts/apps/evolution/speech_generator.py     |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/apps/evolution/speech_generator.py 
b/src/orca/scripts/apps/evolution/speech_generator.py
index 6250802..2ba2e54 100644
--- a/src/orca/scripts/apps/evolution/speech_generator.py
+++ b/src/orca/scripts/apps/evolution/speech_generator.py
@@ -35,6 +35,16 @@ class SpeechGenerator(WebKitGtk.SpeechGenerator):
         super().__init__(script)
         self._cache = {}
 
+    def _isTreeTableCell(self, obj):
+        cached = self._cache.get(hash(obj), {})
+        rv = cached.get("isTreeTableCell")
+        if rv == None:
+            rv = obj.parent and obj.parent.getRole() == pyatspi.ROLE_TREE_TABLE
+            cached["isTreeTableCell"] = rv
+            self._cache[hash(obj)] = cached
+
+        return rv
+
     def _isMessageListToggleCell(self, obj):
         cached = self._cache.get(hash(obj), {})
         rv = cached.get("isMessageListToggleCell")
@@ -117,6 +127,12 @@ class SpeechGenerator(WebKitGtk.SpeechGenerator):
 
         return super()._generateRoleName(obj, **args)
 
+    def _generateUnselectedCell(self, obj, **args):
+        if self._isMessageListToggleCell(obj) or self._isTreeTableCell(obj):
+            return []
+
+        return super()._generateUnselectedCell(obj, **args)
+
     def generateSpeech(self, obj, **args):
         self._cache = {}
         results = super().generateSpeech(obj, **args)


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