[sugar] filtering result of an object chooser

Bert Freudenberg bert at freudenbergs.de
Sat Mar 1 08:55:54 EST 2008


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?

> 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.

The Python ObjectChooser's __init__() could grow a "query" keyword  
argument so it would be compatible with existing code.

- Bert -



More information about the Sugar mailing list