[orca] Fix for BGO #617113 - Need unbound keybinding for toggling speaking of indentation and justification



commit ae80a7d21e53b51c86ab83c819a76cd04e92a939
Author: Mesar Hameed <mhameed src gnome org>
Date:   Wed Apr 28 19:24:33 2010 +0100

    Fix for BGO #617113 - Need unbound keybinding for toggling speaking of indentation and justification.
    
    Signed-off-by: Mesar Hameed <mhameed src gnome org>

 src/orca/default.py |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/default.py b/src/orca/default.py
index 1bbf7c9..f0749a1 100644
--- a/src/orca/default.py
+++ b/src/orca/default.py
@@ -847,6 +847,15 @@ class Script(script.Script):
                 #
                 _("Toggles the silencing of speech."))
 
+        self.inputEventHandlers[ \
+          "toggleSpeakingIndentationJustificationHandler"] = \
+            input_event.InputEventHandler(
+                Script.toggleSpeakingIndentationJustification,
+                # Translators: Orca allows the user to enable/disable
+                # the speaking of indentation and justification.
+                #
+                _("Toggles the speaking of indentation and justification."))
+
         self.inputEventHandlers["listAppsHandler"] = \
             input_event.InputEventHandler(
                 Script.printAppsHandler,
@@ -2042,6 +2051,14 @@ class Script(script.Script):
                 settings.NO_MODIFIER_MASK,
                 self.inputEventHandlers["toggleMouseReviewHandler"]))
 
+        keyBindings.add(
+            keybindings.KeyBinding(
+                "",
+                settings.defaultModifierMask,
+                settings.NO_MODIFIER_MASK,
+                self.inputEventHandlers[ \
+                  "toggleSpeakingIndentationJustificationHandler"]))
+
         try:
             keyBindings = settings.overrideKeyBindings(self, keyBindings)
         except:
@@ -4449,6 +4466,25 @@ class Script(script.Script):
 
         return layoutOnly
 
+    def toggleSpeakingIndentationJustification(self, inputEvent=None):
+        """Toggles the speaking of indentation and justification."""
+
+        settings.enableSpeechIndentation = not settings.enableSpeechIndentation 
+        if settings.enableSpeechIndentation :
+            # Translators: A message indicating that
+            # indentation and justification will be spoken.
+            #
+            line = _("Speaking of indentation and justification enabled.")
+        else:
+            # Translators: A message indicating that
+            # indentation and justification will not be spoken.
+            #
+            line = _("Speaking of indentation and justification disabled.")
+
+        speech.speak(line)
+
+        return True
+
     def toggleTableCellReadMode(self, inputEvent=None):
         """Toggles an indicator for whether we should just read the current
         table cell or read the whole row."""



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