[Sugar-devel] Proposing ObjectChooser with preview feature

Gonzalo Odiard gonzalo at laptop.org
Fri Jul 5 06:32:22 EDT 2013


As the time to include new features has ended,
I want request a exception to include one more change.

This feature modify the ObjectChooser, adding a option show_preview,
if the option is True, instead of showing a listview similar to the Journal,
show a IconView with the object preview, and the object title.

This is useful for activities with a option to include images from the
Journal,
as Paint, Write, Fototoon, and Memorize.

I added the option instead of adding the iconview to all the ObjectChooser,
because is a bit slower to start if you have a Journal with many images.

Regarding implementation, there are changes in sugar [1] and
sugar-toolkit-gtk3 [2]
Every branch have two patches, the first is a preparation, moving the code
used
to generate a image from the datastore preview data, from expandedentry.py
in sugar,
to datastore.py in sugar-toolkit-gtk3. I moved this to the toolkit,
because there are activities using that too, like Portfolio and
JournalShare.
May be should be better create another package as datastore/utils or similar
instead of using datastore/datastore, because I couldn't use the size
constants
defined in activity.py, because activity.py already import
datastore/datastore.

The other change implement a iconmodel/iconview, similar to
listmodel/listview,
using a custom CellRendererPIxbuf to genereate the pixbuf as needed,
instead of generate all the images at once. In the future we can show a star
for the favorite objects using the same renderer.

Comments are welcome,

Gonzalo

[1] https://github.com/sugarlabs/sugar/pull/48
[2] https://github.com/sugarlabs/sugar-toolkit-gtk3/pull/17
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130705/da7fb31f/attachment.html>


More information about the Sugar-devel mailing list