Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement filter by mime types used by activities in the objectchooser #32

Closed
wants to merge 1 commit into from
Closed

Implement filter by mime types used by activities in the objectchooser #32

wants to merge 1 commit into from

Conversation

godiard
Copy link
Contributor

@godiard godiard commented Jun 19, 2013

Add a optative parameter filter_type to ObjectChooser constructor.
Constants to define the different filter types are defined in
sugar-toolkit-gtk3 patch. 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,
if is not used, the filter type is guessed based on the what_filter
parameter as before.

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 parameter was
added.

Signed-off-by: Gonzalo Odiard gonzalo@laptop.org

Add a optative parameter filter_type to ObjectChooser constructor.
Constants to define the different filter types are defined in
sugar-toolkit-gtk3 patch. 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,
if is not used, the filter type is guessed based on the what_filter
parameter as before.

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 parameter was
added.

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
@godiard
Copy link
Contributor Author

godiard commented Jun 19, 2013

This pull request is connected with sugar-toolkit-gtk3 sugarlabs/sugar-toolkit-gtk3#8

@godiard
Copy link
Contributor Author

godiard commented Jun 20, 2013

Closing to address the comments

@godiard godiard closed this Jun 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant