diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-07-15 00:33:41 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-07-15 00:33:41 (GMT) |
commit | 780f9ca4a116ac253d49a5cbf11537012e4558a6 (patch) | |
tree | 66488c76262d52dacaaf5681981fc32669b45b30 | |
parent | 7a6611f4d7a83c72fccdc7cb9b3351ca0b2bbdea (diff) |
Put back library as homepage. If it doesn't exist just load about:blank.
-rw-r--r-- | NEWS | 2 | ||||
-rwxr-xr-x | webactivity.py | 10 |
2 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,5 @@ +* #2718: Make the library the browser homepage. (marco) + 28 * #1996: Rename to "Browse". (marco) diff --git a/webactivity.py b/webactivity.py index c0798af..1e5e8f4 100755 --- a/webactivity.py +++ b/webactivity.py @@ -36,7 +36,7 @@ import filepicker import sessionhistory import progresslistener -_HOMEPAGE = 'http://www.google.com' +_LIBRARY_PATH = '/home/olpc/Library/index.html' class WebActivity(activity.Activity): def __init__(self, handle, browser=None): @@ -71,7 +71,13 @@ class WebActivity(activity.Activity): elif not self._jobject.file_path and not browser: # TODO: we need this hack until we extend the activity API for # opening URIs and default docs. - self._browser.load_uri(_HOMEPAGE) + self._load_homepage() + + def _load_homepage(self): + if os.path.isfile(_LIBRARY_PATH): + self._browser.load_uri('file://' + _LIBRARY_PATH) + else: + self._browser.load_uri('about:blank') def _title_changed_cb(self, embed, pspec): self.set_title(embed.props.title) |