[Sugar-devel] Use ObjectChooser filtering by activity

Gonzalo Odiard gonzalo at laptop.org
Thu Jun 13 11:58:38 EDT 2013


Replaying to myself.

Filtering by activity have a problem right now: show the objects in the
journal filtered by activity.
While solve the Read problem, and probably is good for Jukebox,
is a problem by example for ImageViewer and Paint.
Both can open images, but like the Journal filter by activity, will show
only
the images opened the last time by the activity used as filter.
Example:
* Draw something with Paint
* In the Journal will be seen filtered by Paint but not by ImageViewer.
* Open the same draw using ImageViewer
* In the Journal will be seen filtered by ImageViewer but not by Paint.

I think this is a bug, not a feature.

What you think about switch to filter by all the mime type the activity
selected can open?

Gonzalo



On Thu, Jun 13, 2013 at 9:48 AM, Gonzalo Odiard <gonzalo at laptop.org> wrote:

> I am trying to solve AU ticket #2439 in a way than can be upstreamed.
>
> The problem is with the limitations about how we define our generic mime
> types.
> In this case, "Text files" are defined as all the files than can be edited
> by Write,
> but that is not useful for Read, because can't open open office or abiword
> files
> and crashes.
>
> A similar problem happen in the Jukebox activity, because we have defined
> "Audio files"
> and "Video Files", but not "Multimedia" or "Audio and Video".
>
> Looking at the code, I found is possible do:
>
> chooser = ObjectChooser(None, what_filter=self.get_bundle_id())
>
> instead of:
>
> chooser = ObjectChooser(None, what_filter=mime.GENERIC_TYPE_TEXT)
>
> and that work in the Journal, filtering all the files availables for the
> activity.
>
> I think this is good to know for activity developers.
>
> This does not work in Documents or external devices, the "activity"
> parameter
> is ignored. I filled the ticket [2] and will provide a patch
>
> Gonzalo
>
> [1] https://sugardextrose.org/issues/2439
>
> [2] http://bugs.sugarlabs.org/ticket/4523
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130613/f64ec01c/attachment-0001.html>


More information about the Sugar-devel mailing list