Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-09-18 14:43:44 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-09-18 14:43:44 (GMT)
commitaac27244f0afa012bdac7d5a89e72b59dbb84a76 (patch)
tree537e8496fb00d53f5f9303c5d7e16da0e41b996c /extensions
parentbda49d8fd539bb577f597bee291f21737c747c53 (diff)
Sugar craches during undo for the first Keyboard component startup #1341
Diffstat (limited to 'extensions')
-rw-r--r--extensions/cpsection/keyboard/model.py13
-rw-r--r--extensions/cpsection/keyboard/view.py2
2 files changed, 11 insertions, 4 deletions
diff --git a/extensions/cpsection/keyboard/model.py b/extensions/cpsection/keyboard/model.py
index a5721cd..11edb9b 100644
--- a/extensions/cpsection/keyboard/model.py
+++ b/extensions/cpsection/keyboard/model.py
@@ -87,7 +87,9 @@ class KeyboardManager(object):
if model:
return model
else:
- return self._configrec.get_model()
+ model = self._configrec.get_model()
+ self.set_model(model)
+ return model
def get_current_layouts(self):
"""Return the enabled keyboard layouts with variants"""
@@ -107,19 +109,22 @@ class KeyboardManager(object):
layout_list.append('%s(%s)' % (layout, variants[i]))
i += 1
+ self.set_layouts(layout_list)
+
return layout_list
def get_current_option_group(self):
"""Return the enabled option for switching keyboard group"""
options = self._gconf_client.get_list(_OPTIONS_KEY, gconf.VALUE_STRING)
-
+
if not options:
options = self._configrec.get_options()
+ self.set_option_group(options)
for option in options:
if option.startswith(_GROUP_NAME):
return option
-
+
return None
def get_max_layouts(self):
@@ -135,6 +140,8 @@ class KeyboardManager(object):
def set_option_group(self, option_group):
"""Sets the supplied option for switching keyboard group"""
#XXX: Merge, not overwrite previous options
+ if option_group is None:
+ option_group = ''
options = [option_group]
self._gconf_client.set_list(_OPTIONS_KEY, gconf.VALUE_STRING, options)
self._configrec.set_options(options)
diff --git a/extensions/cpsection/keyboard/view.py b/extensions/cpsection/keyboard/view.py
index 04edc4d..074d298 100644
--- a/extensions/cpsection/keyboard/view.py
+++ b/extensions/cpsection/keyboard/view.py
@@ -30,7 +30,7 @@ CLASS = 'Language'
ICON = 'module-keyboard'
TITLE = _('Keyboard')
-_APPLY_TIMEOUT = 3000
+_APPLY_TIMEOUT = 500
#TODO: This cpsection adds checks for xklavier in bin/sugar-session and
# src/jarabe/controlpanel/gui.py. We should get rid of these checks