[orca] Fix for bgo#554688 - Navigation in gconf-editor doesn't work



commit 3011a7ce5debea87a49d79f7a053f2b3a5e0728b
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Mon Nov 9 12:41:52 2009 -0500

    Fix for bgo#554688 - Navigation in gconf-editor doesn't work
    
    This adds support for the new relation NODE_PARENT_OF which has just
    been added to atk, gtk+/gail, and at-spi. It continues to fall back
    on the old (and at times extremely slow) logic for systems which do
    not have the latest a11y components.

 src/orca/default.py |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/default.py b/src/orca/default.py
index d8e53d9..992016e 100644
--- a/src/orca/default.py
+++ b/src/orca/default.py
@@ -7274,6 +7274,22 @@ class Script(script.Script):
                 return []
 
         nodes = []
+
+        # First see if this accessible implements RELATION_NODE_PARENT_OF.
+        # If it does, the full target list are the nodes. If it doesn't
+        # we'll do an old-school, row-by-row search for child nodes.
+        #
+        relations = obj.getRelationSet()
+        try:
+            for relation in relations:
+                if relation.getRelationType() == \
+                        pyatspi.RELATION_NODE_PARENT_OF:
+                    for target in range(relation.getNTargets()):
+                        nodes.append(target)
+                    return nodes
+        except:
+            pass
+
         index = self.getCellIndex(obj)
         row = table.getRowAtIndex(index)
         col = table.getColumnAtIndex(index)



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