orca r4294 - in trunk: . src/orca/scripts/apps/soffice test/keystrokes/oowriter



Author: joanied
Date: Wed Oct 15 17:29:05 2008
New Revision: 4294
URL: http://svn.gnome.org/viewvc/orca?rev=4294&view=rev

Log:
* test/keystrokes/oowriter/bug_450210.py:
  test/keystrokes/oowriter/bug_546941.py:
  src/orca/scripts/apps/soffice/braille_generator.py:
  src/orca/scripts/apps/soffice/script.py:
  Fix for bug #546941 - Extraneous focus: events issued by OOo
  Writer lists cause excessive chattiness and braille issues.



Modified:
   trunk/ChangeLog
   trunk/src/orca/scripts/apps/soffice/braille_generator.py
   trunk/src/orca/scripts/apps/soffice/script.py
   trunk/test/keystrokes/oowriter/bug_450210.py
   trunk/test/keystrokes/oowriter/bug_546941.py

Modified: trunk/src/orca/scripts/apps/soffice/braille_generator.py
==============================================================================
--- trunk/src/orca/scripts/apps/soffice/braille_generator.py	(original)
+++ trunk/src/orca/scripts/apps/soffice/braille_generator.py	Wed Oct 15 17:29:05 2008
@@ -51,6 +51,39 @@
         return braillegenerator.BrailleGenerator.\
             _getTextForRole(self, obj, role)
 
+    def _getBrailleRegionsForList(self, obj):
+        """Get the braille for a focused list.
+
+        Arguments:
+        - obj: the list
+
+        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("soffice: _getBrailleRegionsForList", obj)
+
+        if not obj.getState().contains(pyatspi.STATE_FOCUSABLE):
+            return braillegenerator.BrailleGenerator.\
+                       _getBrailleRegionsForList(self, obj)
+
+        text = ""
+        label = self._script.getDisplayedLabel(obj)
+        if not label:
+            label = obj.name
+        if label and len(label):
+            text = self._script.appendString(text, label)
+
+        text = self._script.appendString(text, self._getTextForRole(obj))
+        text = self._script.appendString(text,
+                                         self._getTextForRequiredObject(obj))
+        regions = []
+        componentRegion = braille.Component(obj, text)
+        regions.append(componentRegion)
+
+        return [regions, componentRegion]
+
     def _getBrailleRegionsForTableCellRow(self, obj):
         """Get the braille for a table cell row or a single table cell
         if settings.readTableCellRow is False.

Modified: trunk/src/orca/scripts/apps/soffice/script.py
==============================================================================
--- trunk/src/orca/scripts/apps/soffice/script.py	(original)
+++ trunk/src/orca/scripts/apps/soffice/script.py	Wed Oct 15 17:29:05 2008
@@ -1640,6 +1640,14 @@
             orca.setLocusOfFocus(event, event.source, True)
             return
 
+        # OOo Writer gets rather enthusiastic with focus: events for lists.
+        # See bug 546941.
+        #
+        if event.source.getRole() == pyatspi.ROLE_LIST \
+           and orca_state.locusOfFocus \
+           and self.isSameObject(orca_state.locusOfFocus.parent, event.source):
+            return
+
         default.Script.onFocus(self, event)
 
     def onActiveDescendantChanged(self, event):

Modified: trunk/test/keystrokes/oowriter/bug_450210.py
==============================================================================
--- trunk/test/keystrokes/oowriter/bug_450210.py	(original)
+++ trunk/test/keystrokes/oowriter/bug_450210.py	Wed Oct 15 17:29:05 2008
@@ -33,10 +33,11 @@
                            30000))
 sequence.append(utils.AssertPresentationAction(
     "Press 'o' to open the Open File Chooser",
-    ["BRAILLE LINE:  'soffice Application Open Dialog'",
+    ["BUG? - We are presenting both a combo box and a list for what amounts to the same object.",
+     "BRAILLE LINE:  'soffice Application Open Dialog'",
      "     VISIBLE:  'soffice Application Open Dialog', cursor=21",
-     "BRAILLE LINE:  'soffice Application Open Dialog Open OptionPane File name: File name: List'",
-     "     VISIBLE:  'File name: File name: List', cursor=1",
+     "BRAILLE LINE:  'soffice Application Open Dialog Open OptionPane File name: List'",
+     "     VISIBLE:  'File name: List', cursor=1",
      "SPEECH OUTPUT: 'Open'",
      "SPEECH OUTPUT: 'File name: combo box'",
      "SPEECH OUTPUT: 'File name: list'"]))

Modified: trunk/test/keystrokes/oowriter/bug_546941.py
==============================================================================
--- trunk/test/keystrokes/oowriter/bug_546941.py	(original)
+++ trunk/test/keystrokes/oowriter/bug_546941.py	Wed Oct 15 17:29:05 2008
@@ -60,21 +60,16 @@
 sequence.append(WaitForFocus("", acc_role=pyatspi.ROLE_LIST))
 sequence.append(utils.AssertPresentationAction(
     "Move to Strikethrough",
-    ["BUG? - 1. We're presenting an awful lot here.",
+    ["BUG? - 1. We're presenting both a combo box and a list for what amounts to the same object.",
      "BUG? - 2. There should be a space between 'Combo' and 'Strikethrough' -- assuming we should be presenting the combo box in the first place.",
-     "BUG? - 3. For the list, we're presenting the name twice and at the end we're not presented the selected item in braille.",
      "BRAILLE LINE:  'soffice Application Character Dialog Character OptionPane TabList Font Effects Page Strikethrough  Combo'",
      "     VISIBLE:  ' Combo', cursor=1",
-     "BRAILLE LINE:  'soffice Application Character Dialog Character OptionPane TabList Font Effects Page  ComboStrikethrough  Strikethrough Strikethrough List (Without) ListItem'",
+     "BRAILLE LINE:  'soffice Application Character Dialog Character OptionPane TabList Font Effects Page  ComboStrikethrough  Strikethrough List (Without) ListItem'",
      "     VISIBLE:  '(Without) ListItem', cursor=1",
-     "BRAILLE LINE:  'soffice Application Character Dialog Character OptionPane TabList Font Effects Page Strikethrough Strikethrough List'",
-     "     VISIBLE:  'Strikethrough Strikethrough List', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Strikethrough Select a strikethrough style for the selected text. combo box'",
      "SPEECH OUTPUT: 'Strikethrough list'",
-     "SPEECH OUTPUT: '(Without)'",
-     "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Strikethrough list'"]))
+     "SPEECH OUTPUT: '(Without)'"]))
 
 ######################################################################
 # 8. Press Escape to exit the dialog.



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