[Sugar-devel] [PATCH sugar] Language: restore undo functionality in control panel section #10754
Simon Schampijer
simon at schampijer.de
Wed Mar 16 11:03:49 EDT 2011
The control panel has a builtin undo functionality that does
call the set_* method of the model. As we have different formats of
setting a language we need to compensate for that.
---
extensions/cpsection/language/model.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/extensions/cpsection/language/model.py b/extensions/cpsection/language/model.py
index 240e562..17de6bb 100644
--- a/extensions/cpsection/language/model.py
+++ b/extensions/cpsection/language/model.py
@@ -134,6 +134,10 @@ def set_languages(languages):
languages :
"""
+ if isinstance(languages, list):
+ set_languages_list(languages)
+ return
+
if languages.endswith('utf8'):
set_languages_list([languages])
return 1
--
1.7.4
More information about the Sugar-devel
mailing list