[orca] Fix for bgo#618464 - Convert scripts/apps/{evolution, soffice}/script.py to be more legible.



commit 736f933fe39edd57b589c6a6e4bdfe8bcd5a1f2b
Author: Mesar Hameed <mhameed src gnome org>
Date:   Wed May 12 16:58:57 2010 +0100

    Fix for bgo#618464 - Convert scripts/apps/{evolution,soffice}/script.py to be more legible.

 src/orca/scripts/apps/evolution/script.py |   12 +++----
 src/orca/scripts/apps/soffice/script.py   |   55 ++++++++--------------------
 2 files changed, 21 insertions(+), 46 deletions(-)
---
diff --git a/src/orca/scripts/apps/evolution/script.py b/src/orca/scripts/apps/evolution/script.py
index 406e5b1..0e2b475 100644
--- a/src/orca/scripts/apps/evolution/script.py
+++ b/src/orca/scripts/apps/evolution/script.py
@@ -30,7 +30,6 @@ import pyatspi
 import orca.debug as debug
 import orca.default as default
 import orca.input_event as input_event
-import orca.keybindings as keybindings
 import orca.rolenames as rolenames
 import orca.braille as braille
 import orca.orca as orca
@@ -181,12 +180,11 @@ class Script(default.Script):
 
         keyBindings = default.Script.getKeyBindings(self)
 
-        keyBindings.add(
-            keybindings.KeyBinding(
-                "n",
-                settings.defaultModifierMask,
-                settings.ORCA_MODIFIER_MASK,
-                self.inputEventHandlers["toggleReadMailHandler"]))
+        keymap = (
+          ("n", settings.defaultModifierMask, settings.ORCA_MODIFIER_MASK,
+          "toggleReadMailHandler")
+        )
+        keyBindings.load(keymap, self.inputEventHandlers)
         return keyBindings
 
     def getListeners(self):
diff --git a/src/orca/scripts/apps/soffice/script.py b/src/orca/scripts/apps/soffice/script.py
index 4b88401..4fd1729 100644
--- a/src/orca/scripts/apps/soffice/script.py
+++ b/src/orca/scripts/apps/soffice/script.py
@@ -47,7 +47,6 @@ import orca.orca as orca
 import orca.orca_state as orca_state
 import orca.speech as speech
 import orca.settings as settings
-import orca.keybindings as keybindings
 
 from orca.orca_i18n import _ # for gettext support
 
@@ -282,45 +281,23 @@ class Script(default.Script):
 
         keyBindings = default.Script.getKeyBindings(self)
 
-        keyBindings.add(
-            keybindings.KeyBinding(
-                "a",
-                settings.defaultModifierMask,
-                settings.ORCA_MODIFIER_MASK,
-                self.inputEventHandlers["presentInputLineHandler"]))
-
-        keyBindings.add(
-            keybindings.KeyBinding(
-                "r",
-                settings.defaultModifierMask,
-                settings.ORCA_MODIFIER_MASK,
-                self.inputEventHandlers["setDynamicColumnHeadersHandler"],
-                1))
-
-        keyBindings.add(
-            keybindings.KeyBinding(
-                "r",
-                settings.defaultModifierMask,
-                settings.ORCA_MODIFIER_MASK,
-                self.inputEventHandlers["clearDynamicColumnHeadersHandler"],
-                2))
-
-        keyBindings.add(
-            keybindings.KeyBinding(
-                "c",
-                settings.defaultModifierMask,
-                settings.ORCA_MODIFIER_MASK,
-                self.inputEventHandlers["setDynamicRowHeadersHandler"],
-                1))
-
-        keyBindings.add(
-            keybindings.KeyBinding(
-                "c",
-                settings.defaultModifierMask,
-                settings.ORCA_MODIFIER_MASK,
-                self.inputEventHandlers["clearDynamicRowHeadersHandler"],
-                2))
+        keymap = (
+          ("a", settings.defaultModifierMask, settings.ORCA_MODIFIER_MASK,
+          "presentInputLineHandler"),
 
+          ("r", settings.defaultModifierMask, settings.ORCA_MODIFIER_MASK,
+          "setDynamicColumnHeadersHandler", 1),
+
+          ("r", settings.defaultModifierMask, settings.ORCA_MODIFIER_MASK,
+          "clearDynamicColumnHeadersHandler", 2),
+
+          ("c", settings.defaultModifierMask, settings.ORCA_MODIFIER_MASK,
+          "setDynamicRowHeadersHandler", 1),
+
+          ("c", settings.defaultModifierMask, settings.ORCA_MODIFIER_MASK,
+          "clearDynamicRowHeadersHandler", 2),
+        )
+        keyBindings.load(keymap, self.inputEventHandlers)
         bindings = self.structuralNavigation.keyBindings
         for keyBinding in bindings.keyBindings:
             keyBindings.add(keyBinding)



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