[Sugar-devel] [PATCH sugar] Language: restore undo functionality in control panel section #10754

Samuel Greenfeld greenfeld at laptop.org
Wed Mar 16 12:00:47 EDT 2011


Tested-by: Samuel Greenfeld <greenfeld at laptop.org>


On 03/16/11 11:03, Simon Schampijer wrote:
> 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



More information about the Sugar-devel mailing list