| | 1 | diff --git a/extensions/cpsection/keyboard/model.py b/extensions/cpsection/keyboard/model.py |
| | 2 | index a5721cd..ab2cd88 100644 |
| | 3 | --- a/extensions/cpsection/keyboard/model.py |
| | 4 | +++ b/extensions/cpsection/keyboard/model.py |
| | 5 | @@ -18,6 +18,7 @@ |
| | 6 | |
| | 7 | import xklavier |
| | 8 | import gconf |
| | 9 | +import logging |
| | 10 | |
| | 11 | |
| | 12 | _GROUP_NAME = 'grp' # The XKB name for group switch options |
| | 13 | @@ -87,7 +88,10 @@ class KeyboardManager(object): |
| | 14 | if model: |
| | 15 | return model |
| | 16 | else: |
| | 17 | - return self._configrec.get_model() |
| | 18 | + model = self._configrec.get_model() |
| | 19 | + logging.error('> %r', model) |
| | 20 | + self._gconf_client.set_string(_MODEL_KEY, model) |
| | 21 | + return model |
| | 22 | |
| | 23 | def get_current_layouts(self): |
| | 24 | """Return the enabled keyboard layouts with variants""" |
| | 25 | @@ -107,14 +111,21 @@ class KeyboardManager(object): |
| | 26 | layout_list.append('%s(%s)' % (layout, variants[i])) |
| | 27 | i += 1 |
| | 28 | |
| | 29 | + logging.error('>> %r', layout_list) |
| | 30 | + self._gconf_client.set_list(_LAYOUTS_KEY, gconf.VALUE_STRING, |
| | 31 | + layout_list) |
| | 32 | + |
| | 33 | return layout_list |
| | 34 | |
| | 35 | def get_current_option_group(self): |
| | 36 | """Return the enabled option for switching keyboard group""" |
| | 37 | options = self._gconf_client.get_list(_OPTIONS_KEY, gconf.VALUE_STRING) |
| | 38 | - |
| | 39 | + |
| | 40 | if not options: |
| | 41 | options = self._configrec.get_options() |
| | 42 | + logging.error('>>> %r', options) |
| | 43 | + self._gconf_client.set_list(_OPTIONS_KEY, gconf.VALUE_STRING, |
| | 44 | + options) |
| | 45 | |
| | 46 | for option in options: |
| | 47 | if option.startswith(_GROUP_NAME): |
| | 48 | @@ -128,6 +139,7 @@ class KeyboardManager(object): |
| | 49 | |
| | 50 | def set_model(self, model): |
| | 51 | """Sets the supplied keyboard model""" |
| | 52 | + logging.error('-> %r', model) |
| | 53 | self._gconf_client.set_string(_MODEL_KEY, model) |
| | 54 | self._configrec.set_model(model) |
| | 55 | self._configrec.activate(self._engine) |
| | 56 | @@ -135,13 +147,18 @@ class KeyboardManager(object): |
| | 57 | def set_option_group(self, option_group): |
| | 58 | """Sets the supplied option for switching keyboard group""" |
| | 59 | #XXX: Merge, not overwrite previous options |
| | 60 | - options = [option_group] |
| | 61 | + if option_group is None: |
| | 62 | + options = [] |
| | 63 | + else: |
| | 64 | + options = [option_group] |
| | 65 | + logging.error('->>> %r', options) |
| | 66 | self._gconf_client.set_list(_OPTIONS_KEY, gconf.VALUE_STRING, options) |
| | 67 | self._configrec.set_options(options) |
| | 68 | self._configrec.activate(self._engine) |
| | 69 | |
| | 70 | def set_layouts(self, layouts): |
| | 71 | """Sets the supplied keyboard layouts (with variants)""" |
| | 72 | + logging.error('->> %r', layouts) |
| | 73 | self._gconf_client.set_list(_LAYOUTS_KEY, gconf.VALUE_STRING, layouts) |
| | 74 | layouts_list = [] |
| | 75 | variants_list = [] |
| | 76 | diff --git a/extensions/cpsection/keyboard/view.py b/extensions/cpsection/keyboard/view.py |
| | 77 | index 04edc4d..074d298 100644 |
| | 78 | --- a/extensions/cpsection/keyboard/view.py |
| | 79 | +++ b/extensions/cpsection/keyboard/view.py |
| | 80 | @@ -30,7 +30,7 @@ CLASS = 'Language' |
| | 81 | ICON = 'module-keyboard' |
| | 82 | TITLE = _('Keyboard') |
| | 83 | |
| | 84 | -_APPLY_TIMEOUT = 3000 |
| | 85 | +_APPLY_TIMEOUT = 500 |
| | 86 | |
| | 87 | #TODO: This cpsection adds checks for xklavier in bin/sugar-session and |
| | 88 | # src/jarabe/controlpanel/gui.py. We should get rid of these checks |