[Sugar-devel] Limiting Object Chooser to specified MIME types

Aleksey Lim alsroot at member.fsf.org
Fri May 8 12:55:19 EDT 2009


On Fri, May 08, 2009 at 10:03:33AM -0500, James Simmons wrote:
> Aleksey, I was interested in your comment about wrapping Object Chooser  
> for backward compatibility. Currently both of my Activities use Object  
> Chooser, but don't make any attempt to limit what Journal entries can be  
> chosen. I would like to limit Read Etexts to the MIME types text/plain  
> and application/zip, and View Slides to just application/zip. In  
> Sayamindu's code he is using mime.GENERIC_TYPE_IMAGE. There does not  
> seem to be anything comparable that would select what I want selected.  
> I'm looking at the code for sugar.mime here:  
> http://api.sugarlabs.org/sugar.mime-pysrc.html I'm wondering if I could  
> make my own filter in my own Activities that would limit the Object  
> Chooser to just plain text and Zip files.
yup, there is a problem with custom mime types in ObjectChooser
I've created http://dev.sugarlabs.org/ticket/834 for that reason

> I would of course follow your  
> suggestion for backward compatibility.
after fixing #834 I'll add custom mime types support to sugar-port
(w/o breaking backwards compatibility)

-- 
Aleksey


More information about the Sugar-devel mailing list