orca r3838 - in trunk: . src/orca/scripts



Author: richb
Date: Sat Apr 19 17:13:25 2008
New Revision: 3838
URL: http://svn.gnome.org/viewvc/orca?rev=3838&view=rev

Log:
        * src/orca/scripts/gaim.py:
          Fix for bug #525644 - Pidgin buddy status changes cause Orca
          to display "cell" in braille


Modified:
   trunk/ChangeLog
   trunk/src/orca/scripts/gaim.py

Modified: trunk/src/orca/scripts/gaim.py
==============================================================================
--- trunk/src/orca/scripts/gaim.py	(original)
+++ trunk/src/orca/scripts/gaim.py	Sat Apr 19 17:13:25 2008
@@ -751,6 +751,66 @@
                         line = _("New chat tab %s") % child.name
                         speech.speak(line)
 
+    def isBuddyListEvent(self, event):
+        """If pidgin gets a status changed message for one of the users
+        buddies then just ignore it. See bug #525644 for more details.
+
+        Arguments:
+        - event: the Event
+
+        Return an indication of whether this is a buddy list event.
+        """
+
+        isBuddyListEvent = False
+        rolesList = [pyatspi.ROLE_TABLE_CELL, \
+                     pyatspi.ROLE_TABLE_CELL, \
+                     pyatspi.ROLE_TREE_TABLE, \
+                     pyatspi.ROLE_SCROLL_PANE, \
+                     pyatspi.ROLE_FILLER, \
+                     pyatspi.ROLE_PAGE_TAB, \
+                     pyatspi.ROLE_PAGE_TAB_LIST]
+        if self.isDesiredFocusedItem(event.source, rolesList):
+            isBuddyListEvent = True
+
+        return isBuddyListEvent
+
+    def onTextDeleted(self, event):
+        """Called whenever text is deleted from an object.
+
+        Arguments:
+        - event: the Event
+        """
+
+        if self.isBuddyListEvent(event):
+            return
+        else:
+            default.Script.onTextDeleted(self, event)
+
+    def onNameChanged(self, event):
+        """Called whenever a property on an object changes.
+
+        Arguments:
+        - event: the Event
+        """
+
+        if self.isBuddyListEvent(event):
+            return
+        else:
+            default.Script.onNameChanged(self, event)
+
+    def onValueChanged(self, event):
+        """Called whenever an object's value changes.  Currently, the
+        value changes for non-focused objects are ignored.
+
+        Arguments:
+        - event: the Event
+        """
+
+        if self.isBuddyListEvent(event):
+            return
+        else:
+            default.Script.onValueChanged(self, event)
+
     def onTextInserted(self, event):
         """Called whenever text is inserted into one of Gaim's text
         objects.  If the object is an instant message or chat, speak
@@ -761,6 +821,9 @@
         - event: the text inserted Event
         """
 
+        if self.isBuddyListEvent(event):
+            return
+
         chatRoomTab = self.getChatRoomTab(event.source)
         if not chatRoomTab:
             default.Script.onTextInserted(self, event)



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