orca r4535 - in branches/gnome-2-24: . src/orca/scripts/toolkits/Gecko



Author: wwalker
Date: Fri Feb 13 00:55:11 2009
New Revision: 4535
URL: http://svn.gnome.org/viewvc/orca?rev=4535&view=rev

Log:
Fix for bug #570551 - (ARIA) UIUC Number Guessing Game Alert Dialog not presented when it appears


Modified:
   branches/gnome-2-24/ChangeLog
   branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script.py
   branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/speech_generator.py

Modified: branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script.py
==============================================================================
--- branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script.py	(original)
+++ branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/script.py	Fri Feb 13 00:55:11 2009
@@ -1589,7 +1589,18 @@
             if not self.isSameObject(event.source, obj):
                 if not self.isSameObject(obj, orca_state.locusOfFocus):
                     orca.setLocusOfFocus(event, obj, False)
-                    self.presentLine(obj, characterOffset)
+                    # If an alert got focus, let's do the best we can to 
+                    # try to automatically speak its contents while also
+                    # making sure the locus of focus and caret context
+                    # are in the right spot for braille and caret navigation.
+                    # http://bugzilla.gnome.org/show_bug.cgi?id=570551
+                    #
+                    if eventSourceRole == pyatspi.ROLE_ALERT:
+                        speech.speakUtterances(\
+                            self.speechGenerator.getSpeech(event.source, False))
+                        self.updateBraille(obj)
+                    else:
+                        self.presentLine(obj, characterOffset)
                 return
 
         default.Script.onFocus(self, event)

Modified: branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/speech_generator.py
==============================================================================
--- branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/speech_generator.py	(original)
+++ branches/gnome-2-24/src/orca/scripts/toolkits/Gecko/speech_generator.py	Fri Feb 13 00:55:11 2009
@@ -90,6 +90,27 @@
 
         return utterances
 
+    def _getSpeechForAlert(self, obj, already_focused):
+        """Gets the speech for an alert.  What we do here is first try
+        to see if the alert contains text via embedded object characters.
+        If it does, we speak that text.  If it doesn't, we defer to the
+        super class.  The prototype alert we're shooting for is the one
+        from http://bugzilla.gnome.org/show_bug.cgi?id=570551
+
+        Arguments:
+        - obj: an Accessible
+        - already_focused: False if object just received focus
+
+        Returns a list of utterances to be spoken for the object.
+        """
+
+        text = self._script.expandEOCs(obj)
+        if text:
+            return [text]
+        else:
+            return speechgenerator.SpeechGenerator.\
+                       _getSpeechForAlert(self, obj, already_focused)
+
     def _getSpeechForDocumentFrame(self, obj, already_focused):
         """Gets the speech for a document frame.
 



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