[Sugar-devel] [PATCH Words] Add description item to the toolbar if available - SL# 3525

rafael ortiz dirakx at gmail.com
Thu Apr 26 14:49:34 EDT 2012


On 26/04/12 09:14, godiard at sugarlabs.org wrote:
> From: Gonzalo Odiard<godiard at gmail.com>
>
> The activity have a custom toolbar, then need add the DescriptionItem
> to implement the feature "Write to Journal Anytime"
>
> http://wiki.sugarlabs.org/go/Features/Write_to_journal_anytime
>
> Signed-off-by: Gonzalo Odiard<gonzalo at laptop.org>
> ---
>   wordsactivity.py |   10 ++++++++++
>   1 file changed, 10 insertions(+)
>
> diff --git a/wordsactivity.py b/wordsactivity.py
> index cfb8794..31666eb 100644
> --- a/wordsactivity.py
> +++ b/wordsactivity.py
> @@ -79,6 +79,16 @@ class WordsActivity(activity.Activity):
>               toolbar_box.toolbar.insert(title_entry, -1)
>               title_entry.show()
>
> +            try:
> +                from sugar.activity.widgets import DescriptionItem
> +            except ImportError:
> +               logging.debug('DescriptionItem button is not available,' +
> +                    'toolkit version<  0.96')
> +            else:
> +                description_item = DescriptionItem(self)
> +                toolbar_box.toolbar.insert(description_item, -1)
> +                description_item.show()
> +
>               share_button = ShareButton(self)
>               toolbar_box.toolbar.insert(share_button, -1)
>               share_button.show()
Pushed  as:

http://git.sugarlabs.org/words-activity/words-activity/commit/412c143fb1732bb5a640c7b1063d53d8785007e4

Should be in next version thanks.





More information about the Sugar-devel mailing list