[orca] Present the Evince caret-navigation infobar



commit 663efb3b20f2d1ec37ef2bf9197b73c2b0905da8
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Jul 20 12:09:33 2013 -0400

    Present the Evince caret-navigation infobar

 src/orca/scripts/apps/evince/script.py |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/apps/evince/script.py b/src/orca/scripts/apps/evince/script.py
index ca103ca..9246fb8 100644
--- a/src/orca/scripts/apps/evince/script.py
+++ b/src/orca/scripts/apps/evince/script.py
@@ -30,6 +30,7 @@ import pyatspi
 import orca.keybindings as keybindings
 import orca.orca_state as orca_state
 import orca.scripts.default as default
+import orca.settings as settings
 from orca.structural_navigation import StructuralNavigation
 
 ########################################################################
@@ -106,3 +107,15 @@ class Script(default.Script):
             return False
 
         return True
+
+    def onStateChanged(self, event):
+        """Called whenever an object's state changes."""
+
+        if event.type.startswith("object:state-changed:showing") \
+           and event.source.getRole() == pyatspi.ROLE_ALERT and event.detail1:
+            labels = self.utilities.unrelatedLabels(event.source)
+            message = " ".join(map(self.utilities.displayedText, labels))
+            self.presentMessage(
+                message, voice=self.voices.get(settings.DEFAULT_VOICE))
+
+        return default.Script.onStateChanged(self, event)


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