[orca] Speak visited state for links which have been visited



commit ceadb93b6c566cd14a88cb5d2f3b33e035ec8616
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sun Feb 14 22:15:02 2016 -0500

    Speak visited state for links which have been visited

 src/orca/object_properties.py |    7 +++++++
 src/orca/speech_generator.py  |    3 +++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/object_properties.py b/src/orca/object_properties.py
index 9c30a81..5626825 100644
--- a/src/orca/object_properties.py
+++ b/src/orca/object_properties.py
@@ -80,6 +80,13 @@ ROLE_HEADING_LEVEL_SPEECH = _("%(role)s level %(level)d")
 # of icons.
 ROLE_ICON_PANEL = _("Icon panel")
 
+# Translators: This string should be treated as a role describing an object.
+# Examples of roles include "checkbox", "radio button", "paragraph", and "link."
+# The reason for including the visited state as part of the role is to make it
+# possible for users to quickly identify if the link is associated with content
+# already read.
+ROLE_VISITED_LINK = _("visited link")
+
 # Translators: This is a state which applies to elements in document content
 # which have an "onClick" action.
 STATE_CLICKABLE = _("clickable")
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 699dee9..c50ea6e 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -386,6 +386,9 @@ class SpeechGenerator(generator.Generator):
         if not role:
             return ''
 
+        if role == pyatspi.ROLE_LINK and obj.getState().contains(pyatspi.STATE_VISITED):
+            return object_properties.ROLE_VISITED_LINK
+
         nonlocalized = Atspi.role_get_name(role)
         atkRole = Atk.role_for_name(nonlocalized)
 


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