[Bugs] #2400 UNSP: Object Chooser API awkward / too limited
Sugar Labs Bugs
bugtracker-noreply at sugarlabs.org
Mon Oct 4 06:35:58 EDT 2010
#2400: Object Chooser API awkward / too limited
------------------------------------------+---------------------------------
Reporter: sascha_silbe | Owner: alsroot
Type: enhancement | Status: new
Priority: Unspecified by Maintainer | Milestone: 1.0
Component: journal | Version: Git as of bugdate
Severity: Major | Keywords:
Status_field: New | Distribution:
Seeta_dev: |
------------------------------------------+---------------------------------
The
[http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/journal/objectchooser.py
Object Chooser API] is rather awkward to work with if one wants to let the
user select a specific kind of object from the Journal. {{{what_filter}}}
takes a single string which is either the bundle ID of an activity or the
name of a [https://api.sugarlabs.org/epydocs/sugar.mime-
module.html#GENERIC_TYPE_TEXT generic MIME type collection] (e.g.
'Audio'). There is no way to select objects
1. that are not part of a predefined collection (e.g. a TIFF image as TIFF
is not yet part of the 'Image' collection) or
2. have a specific MIME type (e.g. only Ogg Vorbis audio files, but no
MP3s).
From an API point of view, passing a query dictionary like we do in
[http://git.sugarlabs.org/projects/sugar-
toolkit/repos/mainline/blobs/master/src/sugar/datastore/datastore.py
sugar.datastore.datastore.find()] would be a good way to approach this.
I'm not sure about the UI part, though: Currently we use the what_filter
to preselect the
[https://wiki.sugarlabs.org/go/Design_Team/Designs/Object_Chooser "What"
combo box]. Some parts of a query dictionary translate more or less easily
into the existing filters while others have no UI equivalent at all.
A compromise might be supporting only specific filters, but with a clean
API. E.g.
[https://wiki.sugarlabs.org/go/Design_Team/Designs/Object_Chooser#03 one
of the mockups] explains:
> The object chooser supports some extra parameters from activities,
including lists of filters and mime-types. The filter list specifies
presets for the controls in the toolbar, for instance allowing an "insert
image" button to automatically filter for all entries of type "image". A
boolean for each specified filter determines whether or not the preset is
locked, or remains adjustable by the child. The mime-type list specifies
the formats which the activity can support. Items which do not match on
this list and therefore cannot be selected are rendered with gray text,
and do not receive a highlight on rollover.
--
Ticket URL: <http://bugs.sugarlabs.org/ticket/2400>
Sugar Labs <http://sugarlabs.org/>
Sugar Labs bug tracking system
More information about the Bugs
mailing list