sugarlabs/sugar — pull request #25 by godiard (2013-06-19 18:14:36+00:00)
Title: Implement filter by mime types used by activities in the objectchooser

Add a optative parameter filter_type to ObjectChooser constructor.
This parametrer have only a value possible right now,
but other can be added later. If is equals to 'mime_by_activity'
the parameter what_filter should be a bundle_id,
and the filter will be set to the collection of mime types
the activity can manage, as configured in the activity.info file.
The title in the toolbar is changed, and the what_filter combo
is not visible when this parameter is used.
If filter_type have a invalid value, a exeception is throw.

A example of use is:

from sugar3.graphics.objectchooser import ObjectChooser
from sugar3.graphics.objectchooser import FILTER_TYPE_MIME_BY_ACTIVITY

chooser = ObjectChooser(parent=self, what_filter=self.get_bundle_id(),
filter_type=FILTER_TYPE_MIME_BY_ACTIVITY)

This patch need a change in sugar-toolkit-gtk3 because a paramter was
added.

Signed-off-by: Gonzalo Odiard