[sugar] filtering result of an object chooser
Tomeu Vizoso
tomeu
Sat Mar 1 13:25:14 EST 2008
On Sat, Mar 1, 2008 at 2:55 PM, Bert Freudenberg <bert at freudenbergs.de> wrote:
> On Mar 1, 2008, at 14:14 , Tomeu Vizoso wrote:
>
> > On Sat, Mar 1, 2008 at 2:03 PM, Bert Freudenberg
> > <bert at freudenbergs.de> wrote:
> >> On Mar 1, 2008, at 1:02 , Erik Blankinship wrote:
> >>
> >>> Is there a way to filter the mime types of the objects presented
> >>> with an object chooser (e.g., only png)?
> >>
> >> Not currently, but I agree that adding a query parameter would be
> >> rather useful. A work-around is to query the datastore directly and
> >> present the entries within your own UI.
> >
> > This will work for now, but in the future activities won't be able to
> > freely access all the entries in the DS.
>
> I thought since this dialog involves explicit user interaction this
> is okay and not restricted by Rainbow?
Oh, I thought you we proposing not using the object chooser at all?
That's what I understood by "A work-around is to query the datastore
directly and present the entries within your own UI".
> > Which API do you suggest to add to ObjectChooser? I'm willing to look
> > into this in the near future.
>
> I'd simply add a query parameter to the ChooseObject() DBus call.
> Since no shipping activity uses this call directly AFAIK, it should
> be okay at to do at this time.
I think Bitfrost says that activities that wish to access other
objects from the journal will need to ask for permission to read an
specific object type. Michael, can you comment on this?
I wonder which are the use cases for activities that wish to prefilter
further by date or other parameters.
> The Python ObjectChooser's __init__() could grow a "query" keyword
> argument so it would be compatible with existing code.
Yup, that will be nice.
Thanks,
Tomeu
More information about the Sugar-devel
mailing list