orca r4000 - in trunk: . src/orca/scripts/apps/Thunderbird



Author: richb
Date: Tue Jun 24 15:48:31 2008
New Revision: 4000
URL: http://svn.gnome.org/viewvc/orca?rev=4000&view=rev

Log:
        * src/orca/scripts/apps/Thunderbird/script.py:
          Fixed bug #536451 - Newly focused message not spoken after 
          message deletion in Thunderbird.


Modified:
   trunk/ChangeLog
   trunk/src/orca/scripts/apps/Thunderbird/script.py

Modified: trunk/src/orca/scripts/apps/Thunderbird/script.py
==============================================================================
--- trunk/src/orca/scripts/apps/Thunderbird/script.py	(original)
+++ trunk/src/orca/scripts/apps/Thunderbird/script.py	Tue Jun 24 15:48:31 2008
@@ -31,6 +31,7 @@
 import orca.orca as orca
 import orca.debug as debug
 import orca.default as default
+import orca.input_event as input_event
 import orca.orca_state as orca_state
 import orca.speech as speech
 import orca.scripts.toolkits.Gecko as Gecko
@@ -206,6 +207,38 @@
         if not consume:
             Gecko.Script.onFocus(self, event)
 
+    def locusOfFocusChanged(self, event, oldLocusOfFocus, newLocusOfFocus):
+        """Called when the visual object with focus changes.
+
+        Arguments:
+        - event: if not None, the Event that caused the change
+        - oldLocusOfFocus: Accessible that is the old locus of focus
+        - newLocusOfFocus: Accessible that is the new locus of focus
+        """
+
+        # If the user has just deleted a message from the middle of the 
+        # message header list, then we want to speak the newly focused 
+        # message in the header list (even though it has the same row 
+        # number as the previously deleted message).
+        # See bug #536451 for more details.
+        #
+        rolesList = [pyatspi.ROLE_TABLE_CELL, \
+                     pyatspi.ROLE_TREE_TABLE, \
+                     pyatspi.ROLE_SCROLL_PANE, \
+                     pyatspi.ROLE_SCROLL_PANE, \
+                     pyatspi.ROLE_FRAME, \
+                     pyatspi.ROLE_APPLICATION]
+        if self.isDesiredFocusedItem(event.source, rolesList):
+            if isinstance(orca_state.lastInputEvent, input_event.KeyboardEvent):
+                string = orca_state.lastNonModifierKeyEvent.event_string
+                if string == "Delete":
+                    oldLocusOfFocus = None
+
+        # Pass the event onto the parent class to be handled in the default way.
+
+        Gecko.Script.locusOfFocusChanged(self, event,
+                                         oldLocusOfFocus, newLocusOfFocus)
+
     def onStateChanged(self, event):
         """Called whenever an object's state changes.
 



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