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

Rafael Ortiz rafael at activitycentral.com
Thu Apr 26 16:14:28 EDT 2012


On Thu, Apr 26, 2012 at 9:03 AM, <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>
> ---
>  TamTamMini.py |   11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/TamTamMini.py b/TamTamMini.py
> index 02d614d..5d94cc3 100644
> --- a/TamTamMini.py
> +++ b/TamTamMini.py
> @@ -76,6 +76,17 @@ class TamTamMini(activity.Activity):
>             self.toolbox = ToolbarBox()
>             self.toolbox.toolbar.insert(widgets.ActivityButton(self), -1)
>             self.toolbox.toolbar.insert(widgets.TitleEntry(self), -1)
> +
> +            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)
> +                self.toolbox.toolbar.insert(description_item, -1)
> +                description_item.show()
> +
>             self.toolbox.toolbar.insert(widgets.ShareButton(self), -1)
>         else:
>             self.toolbox = activity.ActivityToolbox(self)
> --
> 1.7.10
>
>
Pushed as:
http://git.sugarlabs.org/tamtam/tamtam/commit/ecef93e50fba96dc95daedd9fc5e3858df4c6609

Should be in next version.


Thanks.



> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20120426/c2754bf2/attachment.html>


More information about the Sugar-devel mailing list