[orca] Add 'includeContext' support
- From: William Walker <wwalker src gnome org>
- To: svn-commits-list gnome org
- Subject: [orca] Add 'includeContext' support
- Date: Mon, 1 Jun 2009 09:16:14 -0400 (EDT)
commit fa5de207309069376fb2485cf96fcaf5c8b35cba
Author: Willie Walker <william walker sun com>
Date: Mon Jun 1 09:12:24 2009 -0400
Add 'includeContext' support
The includeContext support (default=True) allows a caller to override whether
the generated speech includes the context for the object or not.
---
src/orca/scripts/apps/evolution/script.py | 24 +++++++++++++++++++-----
src/orca/speech_generator.py | 11 ++++++-----
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/src/orca/scripts/apps/evolution/script.py b/src/orca/scripts/apps/evolution/script.py
index abada76..040f34f 100644
--- a/src/orca/scripts/apps/evolution/script.py
+++ b/src/orca/scripts/apps/evolution/script.py
@@ -947,7 +947,10 @@ class Script(default.Script):
settings.speechVerbosityLevel = \
settings.VERBOSITY_LEVEL_BRIEF
- utterances = speechGen.getSpeech(header)
+ utterances = speechGen.getSpeech(
+ header,
+ includeContext=False,
+ priorObj=oldLocusOfFocus)
[headerRegions, focusedRegion] = \
brailleGen.getBrailleRegions(header)
brailleRegions.extend(headerRegions)
@@ -973,7 +976,10 @@ class Script(default.Script):
settings.VERBOSITY_LEVEL_BRIEF
settings.speechVerbosityLevel = \
savedSpeechVerbosityLevel
- utterances = speechGen.getSpeech(cell)
+ utterances = speechGen.getSpeech(
+ cell,
+ includeContext=False,
+ priorObj=oldLocusOfFocus)
[cellRegions, focusedRegion] = \
brailleGen.getBrailleRegions(cell)
@@ -1064,7 +1070,9 @@ class Script(default.Script):
+ "day view: tabbing to day with appts.")
parent = event.source.parent
- utterances = speechGen.getSpeech(parent)
+ utterances = speechGen.getSpeech(parent,
+ includeContext=False,
+ priorObj=oldLocusOfFocus)
[brailleRegions, focusedRegion] = \
brailleGen.getBrailleRegions(parent)
speech.speak(utterances)
@@ -1080,7 +1088,10 @@ class Script(default.Script):
appt = childTable.getAccessibleAt(row, 0)
extents = appt.queryComponent().getExtents(0)
if extents.y == apptExtents.y:
- utterances = speechGen.getSpeech(event.source)
+ utterances = speechGen.getSpeech(
+ event.source,
+ includeContext=False,
+ priorObj=oldLocusOfFocus)
[apptRegions, focusedRegion] = \
brailleGen.getBrailleRegions(event.source)
brailleRegions.extend(apptRegions)
@@ -1141,7 +1152,10 @@ class Script(default.Script):
apptExtents = child.queryComponent().getExtents(0)
if extents.y == apptExtents.y:
- utterances = speechGen.getSpeech(child)
+ utterances = speechGen.getSpeech(
+ child,
+ includeContext=False,
+ priorObj=oldLocusOfFocus)
[apptRegions, focusedRegion] = \
brailleGen.getBrailleRegions(child)
brailleRegions.extend(apptRegions)
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index d8076ee..cf39d62 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -1407,11 +1407,12 @@ class SpeechGenerator:
# we've been called.
#
if not args.get('recursing', False):
- prefix = self._script.formatting.getPrefix('speech',
- **args)
- suffix = self._script.formatting.getSuffix('speech',
- **args)
- format = '%s + %s + %s' % (prefix, format, suffix)
+ if args.get('includeContext', True):
+ prefix = self._script.formatting.getPrefix('speech',
+ **args)
+ suffix = self._script.formatting.getSuffix('speech',
+ **args)
+ format = '%s + %s + %s' % (prefix, format, suffix)
debug.println(debug.LEVEL_ALL, "getSpeech for %s using '%s'" \
% (repr(args), format))
args['recursing'] = True
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]