[sugar] [Patch] Add palettes to people and objects in Journal
Tomeu Vizoso
tomeu
Tue Apr 22 05:44:41 EDT 2008
On Mon, Apr 21, 2008 at 10:56 PM, Eben Eliason <eben.eliason at gmail.com> wrote:
>
> On Mon, Apr 21, 2008 at 1:24 PM, Tomeu Vizoso <tomeu at tomeuvizoso.net> wrote:
> > On Mon, Apr 21, 2008 at 7:20 PM, Eben Eliason <eben.eliason at gmail.com> wrote:
> > > > +from palettes import JobjectPalette, BuddyPalette
> > > >
> > > > What about EntryPalette instead of JobjectPalette? An entry in the
> > > > journal is the UI representation of a datastore object/
> > > >
> > > > self._jobject = None
> > > > + self._jobject_palette = None
> > > >
> > > > Same here, _jobject is the data, CollapsedEntry is one of the UI views
> > > > of this data. I would call it _palette instead of _jobject_palette.
> > >
> > > Well, that's not actually accurate. See, the Collapsed entry is a
> > > "container" for the entry, which contains various details about it.
> > > The palette is specifically attached to the "object" itself, and not
> > > the entry. Consider, for instance, an entry (in the future) with
> > > several objects in it. Consider also, in the current design, that a
> > > single entry may also have several people icons (and palettes)
> > > attached to it. We need to make it clear that the palette belongs to
> > > the icon/object and not the entry as a whole.
> > >
> > > I chose JobjectPalette and BuddyPalette since a) it seems like the
> > > most direct mapping and b) these are also the classes of object that
> > > they take as arguments to the constructor.
> >
> > I see. I would prefer ObjectPalette then. a) is the right reason but
> > b) shouldn't affect the name of the class.
>
> ObjectPalette it is. I also replaced commented blocks with TODOs and
> added a condition in the delete signal handler to ensure that the
> deleted object was the one currently shown in detail view.
Sorry, missed this one:
+ self._object_palette = ObjectPalette(jobject)
+ self._icon.set_palette(self._object_palette)
I think that you don't need to keep a reference to the object_palette
in the entry, as you can access it easily by self._icon.palette.
r+ with that change.
Thanks,
Tomeu
More information about the Sugar-devel
mailing list