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

Daniel Narvaez dwnarvaez at gmail.com
Tue Jan 21 18:15:38 EST 2014


Without having considered it carefully, I'm a bit concerned about reusing
sugar-launch because it's not quite the same code path normal launching is
going through.

But before getting to implementation details I think it would useful to
consider the Android intents suggestion that has been made. API wise a way
to launch the activity associated to a certain object_id makes a lot of
sense to me. Things would get more complicated if we wanted to launch a new
instance of an activity.


On 21 January 2014 18:00, Manuel Quiñones <manuq at laptop.org> wrote:

> 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:
> https://github.com/manuq/get-books/compare/open-activity
>
> 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).
>
> Thoughts?
>
>
> --
> .. manuq ..
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



-- 
Daniel Narvaez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20140122/4d878cf7/attachment.html>


More information about the Sugar-devel mailing list