orca r3954 - in trunk: . src/orca



Author: richb
Date: Tue Jun  3 19:22:46 2008
New Revision: 3954
URL: http://svn.gnome.org/viewvc/orca?rev=3954&view=rev

Log:
        * src/orca/braillegenerator.py:
          Fix for bug #507922 - Include page tab name in braille context 
          for Thunderbird.


Modified:
   trunk/ChangeLog
   trunk/src/orca/braillegenerator.py

Modified: trunk/src/orca/braillegenerator.py
==============================================================================
--- trunk/src/orca/braillegenerator.py	(original)
+++ trunk/src/orca/braillegenerator.py	Tue Jun  3 19:22:46 2008
@@ -122,6 +122,8 @@
              self._getBrailleRegionsForRowHeader
         self.brailleGenerators[pyatspi.ROLE_SCROLL_BAR]          = \
              self._getBrailleRegionsForScrollBar
+        self.brailleGenerators[pyatspi.ROLE_SCROLL_PANE]         = \
+             self._getBrailleRegionsForScrollPane
         self.brailleGenerators[pyatspi.ROLE_SLIDER]              = \
              self._getBrailleRegionsForSlider
         self.brailleGenerators[pyatspi.ROLE_SPIN_BUTTON]         = \
@@ -1092,6 +1094,30 @@
 
         return self._getDefaultBrailleRegions(obj)
 
+    def _getBrailleRegionsForScrollPane(self, obj):
+        """Get the braille for a scroll pane.
+
+        Arguments:
+        - obj: the scroll pane
+
+        Returns a list where the first element is a list of Regions to display
+        and the second element is the Region which should get focus.
+        """
+
+        self._debugGenerator("_getBrailleRegionsForScrollPane", obj)
+
+        # If this scroll pane is labelled by a page tab, then return the
+        # page tab information for the braille context instead. Thunderbird
+        # folder properties is such a case. See bug #507922 for more details.
+        #
+        relations = obj.getRelationSet()
+        for relation in relations:
+            if relation.getRelationType() ==  pyatspi.RELATION_LABELLED_BY:
+                labelledBy = relation.getTarget(0)
+                return self._getBrailleRegionsForPageTab(labelledBy)
+
+        return self._getDefaultBrailleRegions(obj)
+
     def _getBrailleRegionsForSlider(self, obj):
         """Get the braille for a slider.  If the object already
         had focus, just the value is displayed.



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