[sugar] Gmail Activity

Walter Bender walter.bender at gmail.com
Tue Sep 9 21:02:55 EDT 2008


I have finally gotten around to recreating the Gmail activity based on
Browse-96.
There is almost no resemblance to the original gmail activity, which
was based on the old web activity.

So the question is, do I try to make a giant patch, or just start from scratch?

-walter

diff -u Gmail.activity/webactivity.py Browse.activity/webactivity.py
--- Gmail.activity/webactivity.py	2008-09-09 19:22:15.000000000 -0500
+++ Browse.activity/webactivity.py	2008-08-27 11:49:20.000000000 -0500
@@ -74,23 +74,23 @@
 import filepicker
 import globalhistory

-_HOME_PAGE = 'http://gmail.com'
+_LIBRARY_PATH = '/usr/share/library-common/index.html'

 from model import Model
 from sugar.presence.tubeconn import TubeConnection
 from messenger import Messenger
 from linkbutton import LinkButton

-SERVICE = "org.laptop.GmailActivity"
+SERVICE = "org.laptop.WebActivity"
 IFACE = SERVICE
-PATH = "/org/laptop/GmailActivity"
+PATH = "/org/laptop/WebActivity"

 _TOOLBAR_EDIT = 1
 _TOOLBAR_BROWSE = 2

 _logger = logging.getLogger('web-activity')

-class GmailActivity(activity.Activity):
+class WebActivity(activity.Activity):
     def __init__(self, handle):
         activity.Activity.__init__(self, handle)

@@ -276,7 +276,10 @@


     def _load_homepage(self):
-        self._browser.load_uri(_HOME_PAGE)
+        if os.path.isfile(_LIBRARY_PATH):
+            self._browser.load_uri('file://' + _LIBRARY_PATH)
+        else:
+            self._browser.load_uri('about:blank')

     def _session_history_changed_cb(self, session_history, link):
         _logger.debug('NewPage: %s.' %link)


More information about the Sugar mailing list