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



Author: joanied
Date: Thu Apr 17 19:22:54 2008
New Revision: 3834
URL: http://svn.gnome.org/viewvc/orca?rev=3834&view=rev

Log:
* test/keystrokes/gtk-demo/role_table.py:
  test/keystrokes/gtk-demo/role_column_header.py:
  test/keystrokes/gtk-demo/role_tree_table.py:
  src/orca/where_am_I.py:
  Fix for bug #518914 - table column number missing in whereAmI
  info.



Modified:
   trunk/ChangeLog
   trunk/src/orca/where_am_I.py
   trunk/test/keystrokes/gtk-demo/role_column_header.py
   trunk/test/keystrokes/gtk-demo/role_table.py
   trunk/test/keystrokes/gtk-demo/role_tree_table.py

Modified: trunk/src/orca/where_am_I.py
==============================================================================
--- trunk/src/orca/where_am_I.py	(original)
+++ trunk/src/orca/where_am_I.py	Thu Apr 17 19:22:54 2008
@@ -460,6 +460,12 @@
         Gaim, gedit, OpenOffice Writer and Terminal
         """
 
+        cell = self._script.getAncestor(obj,
+                                        [pyatspi.ROLE_TABLE_CELL],
+                                        [pyatspi.ROLE_FRAME])
+        if cell:
+            return self._speakTableCell(cell, basicOnly)
+
         utterances = []
         text = self._getObjLabel(obj)
         utterances.append(text)
@@ -512,9 +518,9 @@
         3. row header of object
         4. object's role
         5. object's contents, if there are multiple columns
-        6. current row (regardless of speak cell/row setting), if
+        6. relative position
+        7. current row (regardless of speak cell/row setting), if
            performing a detailed whereAmI.
-        7. relative position
         8. if expandable/collapsible: expanded/collapsed
         9. if applicable, the level
 
@@ -536,7 +542,6 @@
             nColumns = 0
         else:
             nColumns = table.nColumns
-
             column = table.getColumnAtIndex(obj.getIndexInParent())
             header = table.getColumnHeader(column)
             if header:
@@ -552,7 +557,7 @@
         text = rolenames.getSpeechForRoleName(obj)
         utterances.append(text)
 
-        if nColumns > 1:
+        if nColumns:
             text = self._getTableCell(obj)
             utterances.append(text)
 
@@ -561,43 +566,28 @@
         speech.speakUtterances(utterances)
 
         utterances = []
-        if not basicOnly and table:
-            row = table.getRowAtIndex(
-              orca_state.locusOfFocus.getIndexInParent())
-            # Translators: this in reference to a row in a table.
-            #
-            text = _("row %d of %d") % ((row+1), table.nRows)
+        if table:
+            # Translators: this is in references to a column in a
+            # table.
+            text = _("column %d of %d") % ((column + 1), table.nColumns)
             utterances.append(text)
-            speech.speakUtterances(utterances)
 
-        # Speak the current row if performing a "detailed" whereAmI.
-        #
-        if not basicOnly:
-            utterances = self._getTableRow(obj)
-            debug.println(self._debugLevel, \
-                          "second table cell utterances=%s" % \
-                          utterances)
+            # Translators: this is in reference to a row in a table.
+            #
+            text = _("row %d of %d") % ((row + 1), table.nRows)
+            utterances.append(text)
             speech.speakUtterances(utterances)
 
-        # Speak the remaining items.
+            # Speak the current row if performing a "detailed" whereAmI.
+            #
+            if not basicOnly:
+                utterances = self._getTableRow(obj)
+                debug.println(self._debugLevel, \
+                              "second table cell utterances=%s" % \
+                              utterances)
+                speech.speakUtterances(utterances)
+        
         utterances = []
-
-        if basicOnly:
-            try:
-                table = parent.queryTable()
-            except NotImplementedError:
-                debug.println(self._debugLevel, 
-                              "??? parent=%s" % parent.getRoleName())
-                return
-            else:
-                row = \
-                    table.getRowAtIndex(
-                       orca_state.locusOfFocus.getIndexInParent())
-                # Translators: this in reference to a row in a table.
-                #
-                text = _("row %d of %d") % ((row+1), table.nRows)
-                utterances.append(text)
-
         state = obj.getState()
         if state.contains(pyatspi.STATE_EXPANDABLE):
             if state.contains(pyatspi.STATE_EXPANDED):

Modified: trunk/test/keystrokes/gtk-demo/role_column_header.py
==============================================================================
--- trunk/test/keystrokes/gtk-demo/role_column_header.py	(original)
+++ trunk/test/keystrokes/gtk-demo/role_column_header.py	Thu Apr 17 19:22:54 2008
@@ -116,6 +116,7 @@
      "SPEECH OUTPUT: 'Severity'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'Normal'",
+     "SPEECH OUTPUT: 'column 3 of 4'",
      "SPEECH OUTPUT: 'row 1 of 14'"]))
 
 ########################################################################
@@ -135,11 +136,13 @@
      "SPEECH OUTPUT: 'Severity'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'Normal'",
+     "SPEECH OUTPUT: 'column 3 of 4'",
      "SPEECH OUTPUT: 'row 1 of 14'",
      "SPEECH OUTPUT: 'table'",
      "SPEECH OUTPUT: 'Severity'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'Normal'",
+     "SPEECH OUTPUT: 'column 3 of 4'",
      "SPEECH OUTPUT: 'row 1 of 14'",
      "SPEECH OUTPUT: 'check box not checked'",
      "SPEECH OUTPUT: '60482'",
@@ -196,6 +199,7 @@
      "SPEECH OUTPUT: 'Fixed?'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'check box not checked'",
+     "SPEECH OUTPUT: 'column 1 of 4'",
      "SPEECH OUTPUT: 'row 1 of 14'"]))
 
 ########################################################################
@@ -215,11 +219,13 @@
      "SPEECH OUTPUT: 'Fixed?'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'check box not checked'",
+     "SPEECH OUTPUT: 'column 1 of 4'",
      "SPEECH OUTPUT: 'row 1 of 14'",
      "SPEECH OUTPUT: 'table'",
      "SPEECH OUTPUT: 'Fixed?'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'check box not checked'",
+     "SPEECH OUTPUT: 'column 1 of 4'",
      "SPEECH OUTPUT: 'row 1 of 14'",
      "SPEECH OUTPUT: 'check box not checked'",
      "SPEECH OUTPUT: '60482'",

Modified: trunk/test/keystrokes/gtk-demo/role_table.py
==============================================================================
--- trunk/test/keystrokes/gtk-demo/role_table.py	(original)
+++ trunk/test/keystrokes/gtk-demo/role_table.py	Thu Apr 17 19:22:54 2008
@@ -76,6 +76,7 @@
      "SPEECH OUTPUT: 'Number'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: '3'",
+     "SPEECH OUTPUT: 'column 1 of 3'",
      "SPEECH OUTPUT: 'row 1 of 5'"]))
 
 ########################################################################
@@ -108,6 +109,7 @@
      "SPEECH OUTPUT: 'Number'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: '5'",
+     "SPEECH OUTPUT: 'column 1 of 3'",
      "SPEECH OUTPUT: 'row 2 of 5'"]))
 
 ########################################################################

Modified: trunk/test/keystrokes/gtk-demo/role_tree_table.py
==============================================================================
--- trunk/test/keystrokes/gtk-demo/role_tree_table.py	(original)
+++ trunk/test/keystrokes/gtk-demo/role_tree_table.py	Thu Apr 17 19:22:54 2008
@@ -91,6 +91,7 @@
      "SPEECH OUTPUT: 'Holiday'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'January'",
+     "SPEECH OUTPUT: 'column 1 of 6'",
      "SPEECH OUTPUT: 'row 1 of 53'",
      "SPEECH OUTPUT: 'expanded'",
      "SPEECH OUTPUT: 'tree level 1'"]))
@@ -112,6 +113,7 @@
      "SPEECH OUTPUT: 'Holiday'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'January'",
+     "SPEECH OUTPUT: 'column 1 of 6'",
      "SPEECH OUTPUT: 'row 1 of 53'",
      "SPEECH OUTPUT: 'expanded'",
      "SPEECH OUTPUT: 'tree level 1'",
@@ -119,6 +121,7 @@
      "SPEECH OUTPUT: 'Holiday'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'January'",
+     "SPEECH OUTPUT: 'column 1 of 6'",
      "SPEECH OUTPUT: 'row 1 of 53'",
      "SPEECH OUTPUT: 'January'",
      "SPEECH OUTPUT: 'check box not checked'",
@@ -159,6 +162,7 @@
      "SPEECH OUTPUT: 'Holiday'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'January'",
+     "SPEECH OUTPUT: 'column 1 of 6'",
      "SPEECH OUTPUT: 'row 1 of 50'",
      "SPEECH OUTPUT: 'collapsed'",
      "SPEECH OUTPUT: 'tree level 1'"]))
@@ -180,6 +184,7 @@
      "SPEECH OUTPUT: 'Holiday'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'January'",
+     "SPEECH OUTPUT: 'column 1 of 6'",
      "SPEECH OUTPUT: 'row 1 of 50'",
      "SPEECH OUTPUT: 'collapsed'",
      "SPEECH OUTPUT: 'tree level 1'",
@@ -187,6 +192,7 @@
      "SPEECH OUTPUT: 'Holiday'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'January'",
+     "SPEECH OUTPUT: 'column 1 of 6'",
      "SPEECH OUTPUT: 'row 1 of 50'",
      "SPEECH OUTPUT: 'January'",
      "SPEECH OUTPUT: 'check box not checked'",
@@ -267,6 +273,7 @@
      "SPEECH OUTPUT: 'Alex'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'check box checked'",
+     "SPEECH OUTPUT: 'column 2 of 6'",
      "SPEECH OUTPUT: 'row 2 of 53'"]))
 
 ########################################################################
@@ -286,11 +293,13 @@
      "SPEECH OUTPUT: 'Alex'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'check box checked'",
+     "SPEECH OUTPUT: 'column 2 of 6'",
      "SPEECH OUTPUT: 'row 2 of 53'",
      "SPEECH OUTPUT: 'tree table'",
      "SPEECH OUTPUT: 'Alex'",
      "SPEECH OUTPUT: 'cell'",
      "SPEECH OUTPUT: 'check box checked'",
+     "SPEECH OUTPUT: 'column 2 of 6'",
      "SPEECH OUTPUT: 'row 2 of 53'",
      "SPEECH OUTPUT: 'New Years Day'",
      "SPEECH OUTPUT: 'check box checked'",



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