[sugar] Launching activities from other activities

Morgan Collett morgan.collett at gmail.com
Mon Oct 13 13:57:15 EDT 2008


On Mon, Oct 13, 2008 at 17:15, Sayamindu Dasgupta <sayamindu at gmail.com> wrote:
> Hello,
> What would be the best way to launch any activity from another
> activity ? An example where this is required would be #8774 where
> teachers from Uruguay are complaining that they are not being able to
> directly open hyperlinks  embedded in PDFs from Read.
> Ideally when the user clicks on the link, Browse should start and show
> the relevant page.
> I wrote a small utility called sugar-open yesterday, similar to
> gnome-open and xdg-open, where you pass any uri to the tool, and it
> will try to open it with the first relevant Activity it can find. I'm
> planning to make Read invoke sugar-open and launch Browse if required.
> Is there any better way to do this ?
> Thanks,
> Sayamindu

Uruguay is currently using a pre-Rainbow build, so this should work.

The alternative, under Rainbow, is to do what Chat does: create a
journal entry with a mime-type of text/uri-list, and call
show_object_in_journal to switch to the journal view of that object so
it can be launched with a click:
http://dev.laptop.org/git?p=chat-activity;a=blob;f=pippy_app.py#l512

Hopefully Rainbow will grow a mechanism for activities to request it
to launch other activities given certain restrictions.

Regards
Morgan


More information about the Sugar mailing list