diff --git a/bin/sugar-session b/bin/sugar-session
index eb38fb8..41c9255 100644
a
|
b
|
def setup_keyboard_cb(gconf_client): |
164 | 164 | |
165 | 165 | model = gconf_client.get_string(\ |
166 | 166 | '/desktop/sugar/peripherals/keyboard/model') |
167 | | if model is not None: |
| 167 | if model: |
168 | 168 | configrec.set_model(model) |
169 | 169 | |
170 | 170 | options = gconf_client.get_list(\ |
diff --git a/extensions/cpsection/keyboard/model.py b/extensions/cpsection/keyboard/model.py
index b0c48c9..9d61c0c 100644
a
|
b
|
class KeyboardManager(object): |
133 | 133 | |
134 | 134 | def set_model(self, model): |
135 | 135 | """Sets the supplied keyboard model""" |
| 136 | if model is None or not model: |
| 137 | return |
136 | 138 | self._gconf_client.set_string(_MODEL_KEY, model) |
137 | 139 | self._configrec.set_model(model) |
138 | 140 | self._configrec.activate(self._engine) |
… |
… |
class KeyboardManager(object): |
150 | 152 | |
151 | 153 | def set_layouts(self, layouts): |
152 | 154 | """Sets the supplied keyboard layouts (with variants)""" |
| 155 | if layouts is None or not layouts: |
| 156 | return |
153 | 157 | self._gconf_client.set_list(_LAYOUTS_KEY, gconf.VALUE_STRING, layouts) |
154 | 158 | layouts_list = [] |
155 | 159 | variants_list = [] |
diff --git a/extensions/cpsection/keyboard/view.py b/extensions/cpsection/keyboard/view.py
index 074d298..5527cc8 100644
a
|
b
|
class Keyboard(SectionView): |
204 | 204 | kmodel_combo.add_attribute(cell, 'text', 1) |
205 | 205 | |
206 | 206 | self._kmodel = self._keyboard_manager.get_current_model() |
207 | | for row in kmodel_store: |
208 | | if self._kmodel in row[0]: |
209 | | kmodel_combo.set_active_iter(row.iter) |
210 | | break |
| 207 | if self._kmodel is not None: |
| 208 | for row in kmodel_store: |
| 209 | if self._kmodel in row[0]: |
| 210 | kmodel_combo.set_active_iter(row.iter) |
| 211 | break |
211 | 212 | |
212 | 213 | box_kmodel.pack_start(kmodel_combo, expand = False) |
213 | 214 | self._vbox.pack_start(box_kmodel, expand=False) |