[orca] Move the toggleSilenceSpeech handler out of orca.py
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Move the toggleSilenceSpeech handler out of orca.py
- Date: Tue, 14 Feb 2012 19:28:31 +0000 (UTC)
commit 468efb74bfc9b728ca8a8d27ebe720eebe2fd3de
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Tue Feb 14 14:28:06 2012 -0500
Move the toggleSilenceSpeech handler out of orca.py
src/orca/orca.py | 20 --------------------
src/orca/scripts/default.py | 22 +++++++++++++++++++++-
2 files changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/src/orca/orca.py b/src/orca/orca.py
index 0afdf2c..5f4b874 100644
--- a/src/orca/orca.py
+++ b/src/orca/orca.py
@@ -680,26 +680,6 @@ def _processBrailleEvent(event):
# #
########################################################################
-def toggleSilenceSpeech(script=None, inputEvent=None):
- """Toggle the silencing of speech.
-
- Returns True to indicate the input event has been consumed.
- """
- speech.stop()
- if settings.silenceSpeech:
- settings.silenceSpeech = False
- # Translators: this is a spoken prompt letting the user know
- # that speech synthesis has been turned back on.
- #
- orca_state.activeScript.presentMessage(_("Speech enabled."))
- else:
- # Translators: this is a spoken prompt letting the user know
- # that speech synthesis has been temporarily turned off.
- #
- orca_state.activeScript.presentMessage(_("Speech disabled."))
- settings.silenceSpeech = True
- return True
-
def _setXmodmap(xkbmap):
"""Set the keyboard map using xkbcomp."""
p = subprocess.Popen(['xkbcomp', '-w0', '-', os.environ['DISPLAY']],
diff --git a/src/orca/scripts/default.py b/src/orca/scripts/default.py
index c2e9739..409fa1b 100644
--- a/src/orca/scripts/default.py
+++ b/src/orca/scripts/default.py
@@ -850,7 +850,7 @@ class Script(script.Script):
self.inputEventHandlers["toggleSilenceSpeechHandler"] = \
input_event.InputEventHandler(
- orca.toggleSilenceSpeech,
+ Script.toggleSilenceSpeech,
# Translators: Orca allows the user to turn speech synthesis
# on or off. We call it 'silencing'.
#
@@ -2627,6 +2627,26 @@ class Script(script.Script):
return True
+ def toggleSilenceSpeech(self, inputEvent=None):
+ """Toggle the silencing of speech.
+
+ Returns True to indicate the input event has been consumed.
+ """
+ speech.stop()
+ if _settingsManager.getSetting('silenceSpeech'):
+ _settingsManager.setSetting('silenceSpeech', False)
+ # Translators: this is a spoken prompt letting the user know
+ # that speech synthesis has been turned back on.
+ #
+ self.presentMessage(_("Speech enabled."))
+ else:
+ # Translators: this is a spoken prompt letting the user know
+ # that speech synthesis has been temporarily turned off.
+ #
+ self.presentMessage(_("Speech disabled."))
+ _settingsManager.setSetting('silenceSpeech', True)
+ return True
+
def toggleSpeakingIndentationJustification(self, inputEvent=None):
"""Toggles the speaking of indentation and justification."""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]