Adapt to the new API
This commit is contained in:
parent
43b5e7e1a1
commit
e1fb6ca1d5
@ -5,21 +5,20 @@ pygtk.require('2.0')
|
|||||||
import gtk
|
import gtk
|
||||||
import geckoembed
|
import geckoembed
|
||||||
|
|
||||||
from sugar.shell import activity
|
from sugar.activity.Activity import Activity
|
||||||
import sugar.env
|
import sugar.env
|
||||||
|
|
||||||
_GMAIL_ACTIVITY_TYPE = "_gmail_google._tcp"
|
_GMAIL_ACTIVITY_TYPE = "_gmail_google._tcp"
|
||||||
|
|
||||||
class GMailActivity(activity.Activity):
|
class GMailActivity(Activity):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
activity.Activity.__init__(self, _GMAIL_ACTIVITY_TYPE)
|
Activity.__init__(self, _GMAIL_ACTIVITY_TYPE)
|
||||||
|
|
||||||
def on_connected_to_shell(self):
|
def on_connected_to_shell(self):
|
||||||
profile_path = os.path.join(sugar.env.get_user_dir(), 'gmail')
|
profile_path = os.path.join(sugar.env.get_user_dir(), 'gmail')
|
||||||
geckoembed.set_profile_path(profile_path)
|
geckoembed.set_profile_path(profile_path)
|
||||||
self.set_tab_text("Mail")
|
self.set_tab_text("Mail")
|
||||||
self.set_tab_icon(name="stock_mail")
|
self.set_tab_icon(name="stock_mail")
|
||||||
self.set_show_icon(True)
|
|
||||||
|
|
||||||
plug = self.gtk_plug()
|
plug = self.gtk_plug()
|
||||||
|
|
||||||
@ -31,9 +30,6 @@ class GMailActivity(activity.Activity):
|
|||||||
|
|
||||||
embed.load_address("http://www.gmail.com")
|
embed.load_address("http://www.gmail.com")
|
||||||
|
|
||||||
def on_disconnected_from_shell(self):
|
|
||||||
gtk.main_quit()
|
|
||||||
|
|
||||||
activity = GMailActivity()
|
activity = GMailActivity()
|
||||||
activity.connect_to_shell()
|
activity.connect_to_shell()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user