[Sugar-devel] Feature proposal: ability to start an activity from inside another

Manuel Quiñones manuq at laptop.org
Tue Jan 21 12:00:21 EST 2014

This topic appears once in a while in this mailing list, and as far as
I know, each time it happens no one objects.
So, time to bring it again.

One of Sugar key principles is simplicity.
Activities are meant to be simple, and users can make interesting
things happen when they interoperate with the activities.
They do so by using the Journal and the Clipboard.

However, there are cases where you want to start an activity from
inside another, thus skipping the step through the Journal.
For example, a user wants to download and read a book.  The current steps are:
- start GetBooks activity
- search for the book
- download the book (get book)
- show book in Journal
- start Read activity from the Journal object

If activities could start other activities, the steps are simpler:
- start GetBooks activity
- search for the book
- download the book (get book)
- start Read activity

This limitation (among others) has made Ceibal find a replacement for
GetBooks and Read, their own BibliotecaSegura.

So I've been investigating a bit, and found that is preety easy to add
this feature.
In fact it is already possible.
I was able to change GetBooks to open Read after a book is downloaded.  See:

This is a bit hackish,
- imports a model from the shell
- the bundle_id of the activity is hardcoded

I think the more elegant option is to extend sugar-launch to something like:

    sugar-launch --object_id object_id

And reuse the code in the Journal that starts or resumes activities (misc.py).


.. manuq ..

More information about the Sugar-devel mailing list