[Sugar-devel] Unified bundles
James Simmons
jim.simmons at walgreens.com
Mon Apr 13 16:04:50 EDT 2009
Wade,
One of the things that frustrated me when I wrote my two Activities was
that there was no good way to share code between them. If we are going
to create Content Viewers as a special case of Activity I think there is
a good opportunity to create an application framework or at least some
reusable classes in Python for creating Content Viewers.
1). The Read activity has aggressive power management built in. It is
supposed to shut down everything after 5 seconds of inactivity. This
only works on the XO and is ignored elsewhere. I see this function
being included in the Content Viewer base class, because all Content
Viewers would find it useful. You would inherit a method to initialize
a number of seconds delay (5 seconds would be the default) and a method
to call that resets the timer. You would place calls to this method
when someone presses a key or changes the value of a scrollbar, etc.
2). Some common toolbars would be nice. View, Edit, Read, and Speech
would be a good start. These would be useful in places other than
Content Viewers. For instance, the View toolbar would be a valuable
addition to Develop, because I'd like to be able to adjust the font size
in the edit window. And maybe Content Viewers would not support
sharing. It might make more sense to share eBooks using the Journal
rather than build file transfer into each Content Viewer. Or maybe the
File Transfer function could be inherited as well. My only doubt about
that is that in Read Etexts I was unable to report file transfer
progress to the user possibly because of a conflict caused by
multi-threading which I needed for text to speech highlighting callbacks.
A library like this could help give the illusion that reading various
kinds of eBooks was all done by the same Activity.
I copied and pasted much code from Read to create my Activities and for
a Java developer it just seemed so wrong.
James Simmons
Wade Brainerd wrote:
> Good question.. My proposal is that activities which don't allow the
> creation of brand new content (e.g. they require some initial content
> to be used) become Content Viewers which is a special case of
> Activity.
>
> As it stands, I'm not sure whether they need to be merged into Sugar
> or whether they can exist independently, with some sort of "This
> bundle requires the Read Content Viewer".
>
> My initial instinct was that they should be merged into Sugar. But
> now, given the inspiring "Unified objects" thread, I kind of think
> they should be allowed to remain separate.
>
> -Wade
>
> On Wed, Apr 8, 2009 at 4:58 PM, James Simmons <jim.simmons at walgreens.com> wrote:
>
>> Wade,
>>
>> Thanks for your response. It clears up a lot now that I have a better idea
>> of the purpose of Unified bundles. There is still one question I have,
>> which is what becomes of Activities in this scenario? For instance, if you
>> have a bundle containing a PDF, what happens to the Read activity to make
>> that possible? Does code from Read move out of the Activity and become part
>> of Sugar? What's left in Read if you do that? Or does Read go away?
>>
>> James Simmons
>>
>>
>>
More information about the Sugar-devel
mailing list