[sugar] [PATCH] Add support for adding/removing activities to/from ring in palettes

Eben Eliason eben.eliason
Thu Apr 17 13:08:49 EDT 2008


On Thu, Apr 17, 2008 at 11:42 AM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
> Hi,
>
>  +        self._bundle_id = activity_info.bundle_id
>  +        self._version = activity_info.version
>  +        self._favorite = activity_info.favorite
>
>  Do we really need to store favorite in a member variable? Cannot just
>  use whatever value has favorite when activity-changed?

Actually, we do need to hold onto it.  We need this value when the
favorite button is clicked on, to what value to set in the registry.
Apart from that, your suggestion would work fine.

>  +        self._favorite_item = MenuItem(_('Add to ring'))
>
>  You are defining this same string twice. Why not just create the
>  _favorite_item in the constructor as you are doing, but without
>  passing any label? After the menuitem is created, you can just call
>  _update_favorite_item() and that would set the label and the color.

Good idea.  The attached patch fixes this, and cleans up the way that
the label is accessed for setting as well.  Unfortunately, do to the
internals of MenuItem, I have to pass a '' null string to the
constructor anyway, or it's not possible to later set the label.

Thanks!

- Eben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-suport-for-adding-removing-activities-to-from-ri.patch
Type: text/x-patch
Size: 7014 bytes
Desc: not available
Url : http://lists.laptop.org/pipermail/sugar/attachments/20080417/fd55f96c/attachment.bin 



More information about the Sugar-devel mailing list