[sugar] how does an activity connect to the journal?
Paul Fox
pgf
Thu Feb 28 11:26:12 EST 2008
tomeu wrote:
> On Thu, Feb 28, 2008 at 3:10 PM, Paul Fox <pgf at foxharp.boston.ma.us> wrote:
> > ah -- okay -- the "Datastore" section says my app must store its
> > complete state in the datastore, to let it show up in the journal.
> > but i'm not sure what "complete state" means
>
> All the data that your activity needs to restore its UI and underlying
> model as it was when it was closed.
okay -- i'm beginning to understand the notion of "instance" more
completely, and the notion of any past instance in time being
resumable. i didn't get that before.
> > -- that's pretty
> > daunting, esp. for a program that already saves a lot of state in
> > other ways.
>
> In which other ways? Can you elaborate?
well, like many existing non-sugar programs, this program creates
a subdirectory in $HOME and saves some state there. it's a mapping
program, so things like current location on the map, current zoom
level, name of of the GPS route being followed, the current GPS
track, etc. also per-user configuration: personal landmarks,
trips, previously saved tracks, etc. (this app is clearly a long
way from being sugarized, and probably never will be.)
> > is there a minimum that i need to do / can do? and
> > this is all accessed via DBUS? that's not completely clear from
> > the page text. (and again, a pointer to how to figure out how
> > to access the datastore/journal from non-python languages might
> > be useful.)
>
> Some activities have already done that. One that comes to my mind is eToys.
>
> You certainly don't need to implement state saving to the perfection.
> Having something working quickly and then keep improving would make
> sense.
i'll take a look at eToys. clearly a minimum of "where on the map
was i?" might be good state to be able to resume.
> that. The Journal is not supposed to access arbitrary data on the file
> system. If you explain what you want to do with the logs someone might
> be able to help.
as i wrote in the other mail, it was more of an assumption that i
made, that i should be able to see that data. (it's actually not
very important, except to the developer. but that happens to be me. ;-)
paul
=---------------------
paul fox, pgf at foxharp.boston.ma.us (arlington, ma, where it's 22.5 degrees)
More information about the Sugar-devel
mailing list