#!/usr/bin/env python

import gtk, webkit
import os

view = webkit.WebView()
win = gtk.Window(gtk.WINDOW_TOPLEVEL)
win.connect('destroy', lambda w: gtk.main_quit())
win.set_size_request(750,460)
win.set_title("Welcome to Edubuntu")
win.set_position(gtk.WIN_POS_CENTER)
win.set_resizable(False)
win.add(view)
win.show_all()

# WebKit puts file URLs in their own domain by default.
# This means that anything which checks for the same origin,
# such as creating a XMLHttpRequest, will fail unless this
# is disabled.
# http://www.gitorious.org/webkit/webkit/commit/624b9463c33adbffa7f6705210384d0d7cf122d6
s = view.get_settings()
s.set_property('enable-file-access-from-file-uris', True)
s.set_property('enable-default-context-menu', False)

view.open("file:///usr/share/edubuntu/slideshows/edubuntu-live-welcome/slides/index.html")
gtk.main()
