orca r4044 - in trunk: . src/orca



Author: wwalker
Date: Fri Jul 18 12:45:13 2008
New Revision: 4044
URL: http://svn.gnome.org/viewvc/orca?rev=4044&view=rev

Log:
Work on bug #542714 - Orca should indicate read-only text boxes.  Firefox support is still needed.


Modified:
   trunk/ChangeLog
   trunk/src/orca/braillegenerator.py
   trunk/src/orca/settings.py
   trunk/src/orca/speechgenerator.py
   trunk/src/orca/where_am_I.py

Modified: trunk/src/orca/braillegenerator.py
==============================================================================
--- trunk/src/orca/braillegenerator.py	(original)
+++ trunk/src/orca/braillegenerator.py	Fri Jul 18 12:45:13 2008
@@ -863,6 +863,11 @@
         if text:
             regions.append(braille.Region(" " + text))
 
+        if settings.presentReadOnlyText \
+           and not obj.getState().contains(pyatspi.STATE_EDITABLE):
+            regions.append(braille.Region(" " \
+                                          + settings.brailleReadOnlyString))
+
         # We do not want the role at the end of text areas.
 
         return [regions, textRegion]

Modified: trunk/src/orca/settings.py
==============================================================================
--- trunk/src/orca/settings.py	(original)
+++ trunk/src/orca/settings.py	Fri Jul 18 12:45:13 2008
@@ -85,6 +85,7 @@
 import debug
 from acss import ACSS
 from orca_i18n import _           # for gettext support
+from orca_i18n import Q_          # to provide qualified translatable strings
 
 # These are the settings that Orca supports the user customizing.
 #
@@ -598,6 +599,26 @@
 #
 progressBarUpdateInterval = 10
 
+# Whether or not to present the 'read only' attribute of text areas
+# if we can detect they are read only or not.
+#
+presentReadOnlyText = True
+
+# Translators: this is used to indicate the user is in a text
+# area that is not editable.  It is meant to be spoken to the user.
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+speechReadOnlyString = Q_("text|read only")
+
+# Translators: this is used to indicate the user is in a text
+# area that is not editable.  It is meant to be a short abbreviation
+# to be presented on the braille display.
+#
+# ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+#
+brailleReadOnlyString = Q_("text|rdonly")
+
 # The complete list of possible text attributes.
 #
 allTextAttributes = \

Modified: trunk/src/orca/speechgenerator.py
==============================================================================
--- trunk/src/orca/speechgenerator.py	(original)
+++ trunk/src/orca/speechgenerator.py	Fri Jul 18 12:45:13 2008
@@ -960,6 +960,11 @@
         if len(utterances) == 0:
             if obj.name and (len(obj.name)):
                 utterances.append(obj.name)
+
+        if settings.presentReadOnlyText \
+           and not obj.getState().contains(pyatspi.STATE_EDITABLE):
+            utterances.append(settings.speechReadOnlyString)
+
         if obj.getRole() != pyatspi.ROLE_PARAGRAPH:
             utterances.extend(self._getSpeechForObjectRole(obj))
 

Modified: trunk/src/orca/where_am_I.py
==============================================================================
--- trunk/src/orca/where_am_I.py	(original)
+++ trunk/src/orca/where_am_I.py	Fri Jul 18 12:45:13 2008
@@ -491,6 +491,10 @@
         text = self._getObjLabel(obj)
         utterances.append(text)
 
+        if settings.presentReadOnlyText \
+           and not obj.getState().contains(pyatspi.STATE_EDITABLE):
+            utterances.append(settings.speechReadOnlyString)
+
         text = rolenames.getSpeechForRoleName(obj)
         utterances.append(text)
 



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