[orca] Add event listeners for, and presentation of, table row and column re-ordering
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Add event listeners for, and presentation of, table row and column re-ordering
- Date: Thu, 7 Feb 2013 21:13:16 +0000 (UTC)
commit 9f4337b994361688fe1d07b668521db91f738b67
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Thu Feb 7 16:12:29 2013 -0500
Add event listeners for, and presentation of, table row and column re-ordering
src/orca/scripts/default.py | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index 0c8de4a..f005593 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -1084,6 +1084,10 @@ class Script(script.Script):
self.onValueChanged
listeners["object:value-changed"] = \
self.onValueChanged
+ listeners["object:column-reordered"] = \
+ self.onColumnReordered
+ listeners["object:row-reordered"] = \
+ self.onRowReordered
listeners["window:activate"] = \
self.onWindowActivated
listeners["window:deactivate"] = \
@@ -3969,6 +3973,39 @@ class Script(script.Script):
self.speakTextSelectionState(obj, startOffset, endOffset)
+ def onColumnReordered(self, event):
+ """Called whenever the columns in a table are reordered.
+
+ Arguments:
+ - event: the Event
+ """
+
+ parentTable = self.utilities.ancestorWithRole(
+ orca_state.locusOfFocus, [pyatspi.ROLE_TABLE], [pyatspi.ROLE_FRAME])
+ if event.source != parentTable:
+ return
+
+ # Translators: This is a message presented to users when the
+ # columns in a table have been reordered.
+ self.presentMessage(_("Columns reordered"))
+
+ def onRowReordered(self, event):
+ """Called whenever the rows in a table are reordered.
+
+ Arguments:
+ - event: the Event
+ """
+
+ parentTable = self.utilities.ancestorWithRole(
+ orca_state.locusOfFocus, [pyatspi.ROLE_TABLE], [pyatspi.ROLE_FRAME])
+ if event.source != parentTable:
+ return
+
+ # Translators: This is a message presented to users when the
+ # rows in a table have been reordered, as would happen when
+ # re-sorting the table by clicking on its header.
+ self.presentMessage(_("Rows reordered"))
+
def onValueChanged(self, event):
"""Called whenever an object's value changes. Currently, the
value changes for non-focused objects are ignored.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]