[Sugar-devel] [PATCH 4/4] Restore load homepage functionality
Manuel Quiñones
manuq at laptop.org
Tue Nov 29 23:41:43 EST 2011
Signed-off-by: Manuel Quiñones <manuq at laptop.org>
---
browser.py | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/browser.py b/browser.py
index 320cb62..789988d 100644
--- a/browser.py
+++ b/browser.py
@@ -39,7 +39,11 @@ import sessionstore
from widgets import BrowserNotebook
_ZOOM_AMOUNT = 0.1
-_LIBRARY_PATH = '/usr/share/library-common/index.html'
+if os.path.isfile('/usr/share/library-common/index.html'):
+ _HOMEPAGE_PATH = '/usr/share/library-common/index.html'
+else:
+ _HOMEPAGE_PATH = os.path.join(activity.get_bundle_path(),
+ "data/index.html")
class SaveListener(object):
@@ -272,13 +276,7 @@ class TabbedView(BrowserNotebook):
def load_homepage(self):
browser = self.current_browser
-
- if os.path.isfile(_LIBRARY_PATH):
- browser.load_uri('file://' + _LIBRARY_PATH)
- else:
- default_page = os.path.join(activity.get_bundle_path(),
- "data/index.html")
- browser.load_uri(default_page)
+ browser.load_uri('file://' + _HOMEPAGE_PATH)
def _get_current_browser(self):
return self.get_nth_page(self.get_current_page()).get_child()
--
1.7.7.3
More information about the Sugar-devel
mailing list