[Activities] using the browser to display help/docs

S Page info at skierpage.com
Sat Feb 21 20:49:23 EST 2009


pgf at laptop.org wrote:
> can someone remind me if there's any reasonable way for an
> activity to display html help or documentation using Browse?
> 
> normally i'd simply have the app run "firefox file:///path-to-file",
> but that won't work. 

In candidate-800, Browse can view
file:///home/olpc/Activities/Maze.activity/activity/activity-maze.svg , 
so you would think you could tell it to launch and show your HTML help.

I dunno if Rainbow restricts one activity from launching another. 
Ignoring that, you would think you could run one activity from another 
using a) Python code, b) exec(), or c) DBus.
a) I couldn't figure out Journal's Start/Resume code, it seems to reach 
into datastore and activityfactory, which ends up invoking DBus.

b) From Terminal Activity you would think that
   sugar-activity -u 'file:///{PATH_TO_YOUR_ACTIVITY}/myhtml/help.html'
would work, but I can't even get the sugar-activity exec line in 
Activities/Browse.activity/activity/activity.info to work.  The 
connection between its BUNDLE_ID, ACTIVITY_ID, OBJECT_ID and an 
activity's metadata like service_name is a mystery to me.

>  are there any workarounds (like tricking the
> file to be in the journal so that browse can see it, or something like
> that?

You could write code to display the HTML within your own activity...

>   how does the new pdf-in-browse trick work?

 From 
http://sayamindu.randomink.org/ramblings/2008/10/14/14th-october-2008/ ,
"Wrote a small PDF viewer tool with support for the Journal which is 
then used by mozplugger to show PDF files within Browse. (You can put 
the file in your journal if you like it)"

I.e. he's taking code that displays PDFs and running it inside the 
browser as a plug-in.  That seems unrelated to what you're trying to do.

Disclaimer: I have written four lines of Python code and zero activities ;-)
--
=S Page


More information about the Activities mailing list