Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/webactivity.py
diff options
context:
space:
mode:
authorMarco 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)
commit780f9ca4a116ac253d49a5cbf11537012e4558a6 (patch)
tree66488c76262d52dacaaf5681981fc32669b45b30 /webactivity.py
parent7a6611f4d7a83c72fccdc7cb9b3351ca0b2bbdea (diff)
Put back library as homepage. If it doesn't exist just load about:blank.
Diffstat (limited to 'webactivity.py')
-rwxr-xr-xwebactivity.py10
1 files changed, 8 insertions, 2 deletions
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)