Ticket #1341: dslo1341_2.patch

File dslo1341_2.patch, 2.3 KB (added by sayamindu, 15 years ago)

Slightly updated patch to handle the Options problem.

  • extensions/cpsection/keyboard/model.py

    diff --git a/extensions/cpsection/keyboard/model.py b/extensions/cpsection/keyboard/model.py
    index a5721cd..eed63a7 100644
    a b class KeyboardManager(object): 
    112112    def get_current_option_group(self):
    113113        """Return the enabled option for switching keyboard group"""
    114114        options = self._gconf_client.get_list(_OPTIONS_KEY, gconf.VALUE_STRING)
    115        
    116115        if not options:
    117116            options = self._configrec.get_options()
    118117
    class KeyboardManager(object): 
    128127
    129128    def set_model(self, model):
    130129        """Sets the supplied keyboard model"""
     130        if model is None:
     131            self._gconf_client.set_string(_MODEL_KEY, '')
     132            return
     133
    131134        self._gconf_client.set_string(_MODEL_KEY, model)
    132135        self._configrec.set_model(model)
    133136        self._configrec.activate(self._engine)
    134137
    135138    def set_option_group(self, option_group):
    136139        """Sets the supplied option for switching keyboard group"""
     140        if option_group is None or option_group == '':
     141            self._gconf_client.set_list(_OPTIONS_KEY, gconf.VALUE_STRING, [])
     142            return
     143
    137144        #XXX: Merge, not overwrite previous options
    138145        options = [option_group]
    139146        self._gconf_client.set_list(_OPTIONS_KEY, gconf.VALUE_STRING, options)
    class KeyboardManager(object): 
    142149
    143150    def set_layouts(self, layouts):
    144151        """Sets the supplied keyboard layouts (with variants)"""
     152        if layouts is None or layouts == []:
     153            self._gconf_client.set_list(_LAYOUTS_KEY, gconf.VALUE_STRING, [])
     154            return
     155
    145156        self._gconf_client.set_list(_LAYOUTS_KEY, gconf.VALUE_STRING, layouts)
    146157        layouts_list = []
    147158        variants_list = []
  • extensions/cpsection/keyboard/view.py

    diff --git a/extensions/cpsection/keyboard/view.py b/extensions/cpsection/keyboard/view.py
    index 04edc4d..074d298 100644
    a b CLASS = 'Language' 
    3030ICON = 'module-keyboard'
    3131TITLE = _('Keyboard')
    3232
    33 _APPLY_TIMEOUT = 3000
     33_APPLY_TIMEOUT = 500
    3434
    3535#TODO: This cpsection adds checks for xklavier in bin/sugar-session and
    3636#      src/jarabe/controlpanel/gui.py. We should get rid of these checks