Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/AbiWordActivity.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2011-07-08 18:53:53 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2011-07-08 18:53:53 (GMT)
commit6a6b107b217fc775837ccffd6ae4d207468f7756 (patch)
tree80997d021f1de98122a118e00f3449e18e27a390 /AbiWordActivity.py
parentbc179c7788e5865ae4123126982e84fb7619daa6 (diff)
Fix load of keybindings - OLPC #11049
Moved call to load of keybindings to map callback of activity to delay the call, without this, when we open a new file keybindings are not applied.
Diffstat (limited to 'AbiWordActivity.py')
-rw-r--r--AbiWordActivity.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/AbiWordActivity.py b/AbiWordActivity.py
index 06b9cf8..09543dd 100644
--- a/AbiWordActivity.py
+++ b/AbiWordActivity.py
@@ -169,6 +169,7 @@ class AbiWordActivity(activity.Activity):
self.set_canvas(self.abiword_canvas)
self.abiword_canvas.connect_after('map-event', self.__map_event_cb)
self.abiword_canvas.show()
+ self.connect_after('map-event', self.__map_activity_event_cb)
self._zoom_handler = self.abiword_canvas.connect("zoom",
self.__zoom_cb)
@@ -202,13 +203,6 @@ class AbiWordActivity(activity.Activity):
def __map_event_cb(self, event, activity):
logger.debug('__map_event_cb')
- # set custom keybindings for Write
- logger.debug('Loading keybindings')
- keybindings_file = os.path.join(get_bundle_path(), 'keybindings.xml')
- self.abiword_canvas.invoke_cmd(
- 'com.abisource.abiword.loadbindings.fromURI',
- keybindings_file, 0, 0)
-
# no ugly borders please
self.abiword_canvas.set_property("shadow-type", gtk.SHADOW_NONE)
@@ -238,6 +232,15 @@ class AbiWordActivity(activity.Activity):
# we are creating the activity
logger.error("We are creating an activity")
+ def __map_activity_event_cb(self, event, activity):
+ # set custom keybindings for Write
+ # we do it later because have problems if done before - OLPC #11049
+ logger.error('Loading keybindings')
+ keybindings_file = os.path.join(get_bundle_path(), 'keybindings.xml')
+ self.abiword_canvas.invoke_cmd(
+ 'com.abisource.abiword.loadbindings.fromURI',
+ keybindings_file, 0, 0)
+
def get_preview(self):
if not hasattr(self.abiword_canvas, 'render_page_to_image'):
return activity.Activity.get_preview(self)