9.1 proposal: View source key everywhere

Bert Freudenberg bert at freudenbergs.de
Thu Oct 23 09:18:51 EDT 2008

Am 23.10.2008 um 14:53 schrieb Tomeu Vizoso:

> Hi,
> I think that with a small effort, we could implement something much
> better than what we have today.
> We have glorious plans for the view source key, but as no resources
> have been devoted to them, perhaps we should scale back and make sure
> that we provide the best we can today. And let the future deal with
> the dreams.
> Have hacked a quick way of displaying the contents of the currently
> active activity bundle, along with displaying the source code if the
> activity ships its source inside the bundle.
> Screenshot of Implode's source: http://dev.laptop.org/~tomeu/viewsource.png
> The approach I have followed is installing a global keybinding that is
> handled in the shell. If you want to try it, it's a matter of dropping
> the file in the url below into
> ~/sugar-jhbuild/install/share/sugar/extensions/globalkey, if you have
> a recent enough sugar-jhbuild.
> http://dev.laptop.org/~tomeu/viewsource.py
> This approach has a good thing that is that works everywhere, but has
> a major problem: doesn't let activities override it and handle
> themselves the view source key event. This is very bad for activities
> like Etoys, the ones produced by Pippy or activities that would prefer
> to display the source code for the _content_ loaded in that moment
> (Browse).
> Alternative 1: Move it to sugar-toolkit, would be available to all
> python activities, and activities would be able to override it easily.
> Inconvenient: non-python activities wouldn't benefit from it.
> Alternative 2: Add a mechanism for the shell to know if an activity
> wishes to provide its own view source window. It could be done by
> adding one more D-Bus method or by adding one more property to
> activity.info. Inconvenient: adds complexity to activity development.
> Opinions?

This would definitely be an improvement :)

I'd add a DBus method to the activity protocol answering a boolean. If  
the activity answers False (or does not implement the method) the  
system would do its best to show the source. If it answers True, the  
activity handled the request on its own.

- Bert -

More information about the Devel mailing list