2006-05-24 02:03:35 +02:00
|
|
|
import os
|
|
|
|
|
2006-05-18 07:17:40 +02:00
|
|
|
import pygtk
|
|
|
|
pygtk.require('2.0')
|
|
|
|
import gtk
|
|
|
|
import geckoembed
|
|
|
|
|
2006-06-21 22:54:13 +02:00
|
|
|
from sugar.activity.Activity import Activity
|
2006-05-24 02:03:35 +02:00
|
|
|
import sugar.env
|
2006-05-18 07:17:40 +02:00
|
|
|
|
2006-06-17 05:10:30 +02:00
|
|
|
_GMAIL_ACTIVITY_TYPE = "_gmail_google._tcp"
|
|
|
|
|
2006-06-21 22:54:13 +02:00
|
|
|
class GMailActivity(Activity):
|
2006-05-18 07:17:40 +02:00
|
|
|
def __init__(self):
|
2006-06-21 22:54:13 +02:00
|
|
|
Activity.__init__(self, _GMAIL_ACTIVITY_TYPE)
|
2006-05-18 07:17:40 +02:00
|
|
|
|
2006-06-02 21:02:23 +02:00
|
|
|
def on_connected_to_shell(self):
|
2006-05-24 02:03:35 +02:00
|
|
|
profile_path = os.path.join(sugar.env.get_user_dir(), 'gmail')
|
|
|
|
geckoembed.set_profile_path(profile_path)
|
2006-06-02 21:02:23 +02:00
|
|
|
self.set_tab_text("Mail")
|
|
|
|
self.set_tab_icon(name="stock_mail")
|
2006-06-21 22:56:11 +02:00
|
|
|
self.set_show_tab_icon(True)
|
2006-05-18 07:17:40 +02:00
|
|
|
|
2006-06-02 21:02:23 +02:00
|
|
|
plug = self.gtk_plug()
|
2006-05-18 07:17:40 +02:00
|
|
|
|
|
|
|
embed = geckoembed.Embed()
|
|
|
|
plug.add(embed)
|
|
|
|
embed.show()
|
|
|
|
|
|
|
|
plug.show()
|
|
|
|
|
|
|
|
embed.load_address("http://www.gmail.com")
|
|
|
|
|
|
|
|
activity = GMailActivity()
|
2006-06-02 21:02:23 +02:00
|
|
|
activity.connect_to_shell()
|
2006-05-18 07:17:40 +02:00
|
|
|
|
|
|
|
gtk.main()
|