[Sugar-devel] journal / datastore question
James Simmons
nicestep at gmail.com
Fri Dec 3 08:51:35 EST 2010
Erik,
What has been done in the Read Activity is to use the Object Chooser
when the user starts the activity from the ring, but not otherwise.
My own preference is to use the activity ring when I want to create a
new Journal entry and resume from the Journal when I want to update an
existing one. That would work if your Activity started with an empty
canvas and allowed you to create an image, maybe by pasting from the
clipboard or hand drawing, etc.
For awhile the Read Activity could not be launched from the activity
ring at all; you could only resume an existing Journal entry. My own
e-book activities followed that example, but that made the activities
harder to discover. I modified my own Read Etexts so that if you
opened it from the ring you got a "Books" tab that lets you browse a
list of books from Project Gutenberg and download and read them.
If you follow the example of Read there would be no option to open
Journal entries. The dialog would simply come up when you start it
from the ring.
James Simmons
On Fri, Dec 3, 2010 at 6:42 AM, Erik Blankinship <erikb at mediamods.com> wrote:
> Thank you for the clarification.
> An idea to make my gimp example "work" with sugar:
> If an image file is used to start the activity, I could disable the option
> to open other files, effectively making that activity session a "one off".
> That said, it would probably be confusing. The activity would look the
> same except for the missing option to open new files.
>
> On Thu, Dec 2, 2010 at 12:31 AM, James Simmons <nicestep at gmail.com> wrote:
>>
>> Erik,
>>
>> I believe that the write_file() is always to the Journal entry you
>> resumed from. You can certainly read and write to any number of other
>> Journal entries, but the write_file() only writes to the resumed
>> entry. It is possible to avoid creating a Journal entry. For
>> instance, Get Internet Archive Books downloads e-books from the IA
>> website and puts them in Journal entries, but it does not create its
>> own Journal entry and cannot be resumed from a Journal entry. There
>> are a few Activities that could benefit from that approach. For
>> instance, both Terminal and Log create Journal entries that do nothing
>> useful. (resuming from one of these entries does nothing that
>> starting the Activity from the ring does not do).
>>
>> In my opinion you should stick to flows that the user expects instead
>> of inventing new ones.
>>
>> James Simmons
>>
>>
>> On Wed, Dec 1, 2010 at 7:55 PM, Erik Blankinship <erikb at mediamods.com>
>> wrote:
>> > Let's say I have a gimp-like activity.
>> > I launch the activity and it is "empty". I open an image file via
>> > object
>> > chooser, save the file back to the datastore. I do this a few times.
>> > When
>> > I close my activity, I keep a reference to the datastore-id of the last
>> > photo I edited so that it will resume with that photo.
>> > When I reopen that activity-instance, I look up the last edited photo by
>> > its
>> > saved datastore id and can resume work on it. I close the activity
>> > again
>> > and the datastore-id of the image is preserved.
>> > Now, I go to the journal and open the gimp-line activity via an image
>> > file
>> > (A.png) in the journal with a supported mime-type.
>> > My activity's read_file figures out we are opening an image, and handles
>> > it
>> > accordingly (it also keeps a reference to the open file).
>> > The child makes some edits and saves their changes to the image. I
>> > write
>> > the changes to A.png in the datastore via the file handle I kept open.
>> > In the same activity instance, I close A.png and open another image
>> > (B.png)
>> > via an object chooser. I work on that file and then quit the activity
>> > (with
>> > an intention to save changes to B.png).
>> > At this point, I am prompted with a dialog box asking me to add
>> > metadata to
>> > A.png ... (i guess because that is the file used to open the
>> > activity?).
>> > Is there a way to end this activity session with the final write_file
>> > being
>> > to an activity instance -- not to the file used to open the instance?
>> > _______________________________________________
>> > Sugar-devel mailing list
>> > Sugar-devel at lists.sugarlabs.org
>> > http://lists.sugarlabs.org/listinfo/sugar-devel
>> >
>> >
>
>
More information about the Sugar-devel
mailing list