diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2011-07-08 18:53:53 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2011-07-08 18:53:53 (GMT) |
commit | 6a6b107b217fc775837ccffd6ae4d207468f7756 (patch) | |
tree | 80997d021f1de98122a118e00f3449e18e27a390 | |
parent | bc179c7788e5865ae4123126982e84fb7619daa6 (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.
-rw-r--r-- | AbiWordActivity.py | 17 |
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) |