[sugar] [PATCH] Add support for adding/removing activities to/from ring in palettes
Tomeu Vizoso
tomeu at tomeuvizoso.net
Mon Apr 21 15:51:16 EDT 2008
r+
On Thu, Apr 17, 2008 at 7:08 PM, Eben Eliason <eben.eliason at gmail.com> wrote:
> 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
>
More information about the Sugar
mailing list