Ticket #1341: dslo1341.patch

File dslo1341.patch, 2.0 KB (added by sayamindu, 15 years ago)

Proposed fix

  • extensions/cpsection/keyboard/model.py

    diff --git a/extensions/cpsection/keyboard/model.py b/extensions/cpsection/keyboard/model.py
    index a5721cd..f34a25b 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            return
     132
    131133        self._gconf_client.set_string(_MODEL_KEY, model)
    132134        self._configrec.set_model(model)
    133135        self._configrec.activate(self._engine)
    134136
    135137    def set_option_group(self, option_group):
    136138        """Sets the supplied option for switching keyboard group"""
     139        if option_group is None:
     140            return
     141
    137142        #XXX: Merge, not overwrite previous options
    138143        options = [option_group]
    139144        self._gconf_client.set_list(_OPTIONS_KEY, gconf.VALUE_STRING, options)
    class KeyboardManager(object): 
    142147
    143148    def set_layouts(self, layouts):
    144149        """Sets the supplied keyboard layouts (with variants)"""
     150        if layouts is None or layouts == []:
     151            return
     152
    145153        self._gconf_client.set_list(_LAYOUTS_KEY, gconf.VALUE_STRING, layouts)
    146154        layouts_list = []
    147155        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