orca r3685 - in trunk: . src/orca test/keystrokes/gtk-demo



Author: richb
Date: Mon Mar  3 18:53:10 2008
New Revision: 3685
URL: http://svn.gnome.org/viewvc/orca?rev=3685&view=rev

Log:
        * src/orca/where_am_I.py:
          test/keystrokes/gtk-demo/role_spin_button.py:
          Fix for bug #519557 - gtk-demo/role_spin_button.py regression 
          test #2 produces the wrong results.


Modified:
   trunk/ChangeLog
   trunk/src/orca/where_am_I.py
   trunk/test/keystrokes/gtk-demo/role_spin_button.py

Modified: trunk/src/orca/where_am_I.py
==============================================================================
--- trunk/src/orca/where_am_I.py	(original)
+++ trunk/src/orca/where_am_I.py	Mon Mar  3 18:53:10 2008
@@ -259,7 +259,8 @@
         1. label
         2. role
         3. current value
-        4. accelerator (i.e. Alt plus the underlined letter), if any
+        4. selected (if True).
+        5. accelerator (i.e. Alt plus the underlined letter), if any
         """
 
         utterances = []
@@ -272,6 +273,23 @@
         name = self._getObjName(obj)
         utterances.append(name)
         
+        try:
+            textObj = obj.queryText()
+        except:
+            pass
+        else:
+            noOfSelections = textObj.getNSelections()
+            if noOfSelections == 1:
+                [string, startOffset, endOffset] = \
+                   textObj.getTextAtOffset(0, pyatspi.TEXT_BOUNDARY_LINE_START)
+                if startOffset == 0 and endOffset == len(string):
+                    # Translators: when the user selects (highlights) text in
+                    # a document, Orca lets them know this.
+                    #
+                    # ONLY TRANSLATE THE PART AFTER THE PIPE CHARACTER |
+                    #
+                    utterances.append(Q_("text|selected"))
+
         text = self._getObjAccelerator(obj)
         utterances.append(text)
 

Modified: trunk/test/keystrokes/gtk-demo/role_spin_button.py
==============================================================================
--- trunk/test/keystrokes/gtk-demo/role_spin_button.py	(original)
+++ trunk/test/keystrokes/gtk-demo/role_spin_button.py	Mon Mar  3 18:53:10 2008
@@ -61,12 +61,12 @@
 sequence.append(PauseAction(3000))
 sequence.append(utils.AssertPresentationAction(
     "Hue spin button Where Am I",
-    ["BUG? - Text is selected, but selection not presented.",
-     "BRAILLE LINE:  'gtk-demo Application Changing color ColorChooser ColorChooser Hue: 240 $l'",
+    ["BRAILLE LINE:  'gtk-demo Application Changing color ColorChooser ColorChooser Hue: 240 $l'",
      "     VISIBLE:  'Hue: 240 $l', cursor=9",
      "SPEECH OUTPUT: 'Hue:'",
      "SPEECH OUTPUT: 'spin button'",
      "SPEECH OUTPUT: '240'",
+     "SPEECH OUTPUT: 'selected'",
      "SPEECH OUTPUT: 'Alt h'"]))
 
 ########################################################################
@@ -78,18 +78,19 @@
 sequence.append(PauseAction(3000))
 sequence.append(utils.AssertPresentationAction(
     "Hue spin button Where Am I",
-    ["BUG? - Text is selected, but selection not presented.",
-     "BRAILLE LINE:  'gtk-demo Application Changing color ColorChooser ColorChooser Hue: 240 $l'",
+    ["BRAILLE LINE:  'gtk-demo Application Changing color ColorChooser ColorChooser Hue: 240 $l'",
      "     VISIBLE:  'Hue: 240 $l', cursor=9",
      "BRAILLE LINE:  'gtk-demo Application Changing color ColorChooser ColorChooser Hue: 240 $l'",
      "     VISIBLE:  'Hue: 240 $l', cursor=9",
      "SPEECH OUTPUT: 'Hue:'",
      "SPEECH OUTPUT: 'spin button'",
      "SPEECH OUTPUT: '240'",
+     "SPEECH OUTPUT: 'selected'",
      "SPEECH OUTPUT: 'Alt h'",
      "SPEECH OUTPUT: 'Hue:'",
      "SPEECH OUTPUT: 'spin button'",
      "SPEECH OUTPUT: '240'",
+     "SPEECH OUTPUT: 'selected'",
      "SPEECH OUTPUT: 'Alt h'"]))
 
 ########################################################################



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