Re: [Sugar-devel] journal / datastore question
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 nices...@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 er...@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@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] UI: Advice about UI changes in Write
On Fri, Dec 3, 2010 at 2:40 AM, Sascha Silbe sascha-ml-reply-to-201...@silbe.org wrote: Excerpts from Gary Martin's message of Fri Dec 03 02:04:00 +0100 2010: The previous UI allowed someone to choose an unusual scaling value, say 88%, so I guess the question is if that is a feature folks are happy loosing. In my experience, unusual scaling values were to try and get to a good Page width setting manually, so would not be such a loss. Please don't remove the ability to choose arbitrary scaling values! The lack of this feature is one of the few things I hate about xpdf (the version in Debian at least - ISTR that the Gentoo version had this ability a few years back). It makes reading a lot of scientific papers (and other documents, of course) a pain (sometimes literally) because either the font is too small to read comfortably or you have to scroll constantly as lines span more than the screen width. By choosing an arbitrary scale value, I can put exactly those parts on screen that I want to read. Often, but not always this simply means zooming in to match the actual text layout instead of the paper size (most (La)TeX styles include rather wide borders to accommodate binding). You can increment/decrement the zoom with Ctrl + / - to any level. Gonzalo Sascha -- http://sascha.silbe.org/ http://www.infra-silbe.de/ ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] journal / datastore question
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 er...@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 nices...@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 er...@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@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] get list of titles in the datastore?
I tried using this bit of code to get a list of items in the journal by their title, but it is returning everything in the journal! http://bit.ly/fjgpJr ds_objects, num_objects = datastore.find({'title':'file1.txt'}) Any suggestions? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
[Sugar-devel] setting svg icon as datastore metadata?
Can I set my own svg icon as metadata for a datastore entry? How would I do that? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] setting svg icon as datastore metadata?
Erik, I don't think it's possible to change an icon for something that is already in the Journal. I can't remember exactly how things work, but I think the following is accurate: Icons are associated with Activities. Mimetypes are associated between a Journal entry and an Activity. The correct icon is inferred by finding a journal entry's mimetype and then looking up which Activity is appropriate. Tim On 4 December 2010 10:51, Erik Blankinship er...@mediamods.com wrote: Can I set my own svg icon as metadata for a datastore entry? How would I do that? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] setting svg icon as datastore metadata?
Erik, Every Journal entry has an 'activity' field which stores the bundle id of the Activity that created it. That is what gives you the icon. If your Journal entry has a MIME type but no activity then the icon is for the MIME type. I wanted Read Etexts to give its Activity icon to the Journal entries it read, so that by default these entries would open in Read Etexts and not in one of the other Activities that support that MIME type. I describe how to do this in the Add Refinements chapter of the book: In a normal Activity that writes out a file in write_file() this next line would be unnecessary: self.metadata['activity'] = self.get_bundle_id() Any Journal entry created by an Activity will automatically have this property set. In the case of Pride and Prejudice, our Activity did not create it. We are able to read it because our Activity supports its MIME type. Unfortunately, that MIME type, application/zip, is used by other Activities. I found it very frustrating to want to open a book in Read Etexts and accidentally have it opened in EToys instead. This line of code solves that problem. You only need to use Start Using... the first time you read a book. After that the book will use the Read Etexts icon and can be resumed with a single click. This does not at all affect the MIME type of the Journal entry, so if you wanted to deliberately open Pride and Prejudice with Etoys it is still possible. Giving a Journal entry some arbitrary icon is not possible. It needs to be associated with either an Activity or a MIME type. James Simmons On Fri, Dec 3, 2010 at 3:51 PM, Erik Blankinship er...@mediamods.com wrote: Can I set my own svg icon as metadata for a datastore entry? How would I do that? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel
Re: [Sugar-devel] get list of titles in the datastore?
from #sugar... *alsroot *: try datastore.find({'query':'coolthings'}) *alsroot*: for now, only uid, activity, activity_id, mime_type and keep search term are supported On Fri, Dec 3, 2010 at 4:49 PM, Erik Blankinship er...@mediamods.comwrote: I tried using this bit of code to get a list of items in the journal by their title, but it is returning everything in the journal! http://bit.ly/fjgpJr ds_objects, num_objects = datastore.find({'title':'file1.txt'}) Any suggestions? ___ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel