From e10b0af2ed9aa4e8853fd5fd97cb4e6705685fd5 Mon Sep 17 00:00:00 2001 From: Wade Brainerd Date: Tue, 03 Feb 2009 08:35:18 +0000 Subject: Switch to simplejson for better error reporting. Nepali fixes. Updated translations. --- (limited to 'keyboard.py') diff --git a/keyboard.py b/keyboard.py index d272bdd..bba8ad7 100644 --- a/keyboard.py +++ b/keyboard.py @@ -249,7 +249,8 @@ class KeyboardData: self.scale = KEYBOARD_SCALE def set_layout(self, layout): - pass + self._build_key_list(layout) + self._layout_keys() def _build_key_list(self, layout): """Builds a list of Keys objects from a layout description. @@ -331,12 +332,6 @@ class KeyboardData: k['key-width'] = int(k['key-width'] * self.scale) k['key-height'] = int(k['key-height'] * self.scale) - def set_layout(self, layout): - """Sets the keyboard's layout from a layout description.""" - self._build_key_list(layout) - self._layout_keys() - self._make_key_images() - def find_key_by_label(self, label): for k in self.keys: if k['key-label'] == label: @@ -426,6 +421,11 @@ class KeyboardWidget(KeyboardData, gtk.DrawingArea): self.root_window.disconnect(self.key_press_cb_id) self.root_window.disconnect(self.key_release_cb_id) + def set_layout(self, layout): + """Sets the keyboard's layout from a layout description.""" + KeyboardData.set_layout(self, layout) + self._make_key_images() + def _make_key_images(self): group = self.active_group -- cgit v0.9.1