Adapt to the new API
This commit is contained in:
parent
02c697d862
commit
326f372f54
@ -1,2 +1,4 @@
|
|||||||
[Activity]
|
[Activity]
|
||||||
python_class = gmail
|
name = GMail
|
||||||
|
id = org.sugar.GMail
|
||||||
|
python_module = gmail.GMailActivity
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
import pygtk
|
|
||||||
pygtk.require('2.0')
|
|
||||||
import gtk
|
|
||||||
import geckoembed
|
import geckoembed
|
||||||
|
|
||||||
from sugar.activity.Activity import Activity
|
from sugar.activity.Activity import Activity
|
||||||
@ -11,27 +8,15 @@ import sugar.env
|
|||||||
_GMAIL_ACTIVITY_TYPE = "_gmail_google._tcp"
|
_GMAIL_ACTIVITY_TYPE = "_gmail_google._tcp"
|
||||||
|
|
||||||
class GMailActivity(Activity):
|
class GMailActivity(Activity):
|
||||||
def __init__(self):
|
def __init__(self, args):
|
||||||
Activity.__init__(self, _GMAIL_ACTIVITY_TYPE)
|
Activity.__init__(self, _GMAIL_ACTIVITY_TYPE)
|
||||||
|
|
||||||
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_title("Mail")
|
||||||
self.set_tab_icon(name="stock_mail")
|
|
||||||
self.set_show_tab_icon(True)
|
|
||||||
|
|
||||||
plug = self.gtk_plug()
|
|
||||||
|
|
||||||
embed = geckoembed.Embed()
|
embed = geckoembed.Embed()
|
||||||
plug.add(embed)
|
self.add(embed)
|
||||||
embed.show()
|
embed.show()
|
||||||
|
|
||||||
plug.show()
|
|
||||||
|
|
||||||
embed.load_address("http://www.gmail.com")
|
embed.load_address("http://www.gmail.com")
|
||||||
|
|
||||||
activity = GMailActivity()
|
|
||||||
activity.connect_to_shell()
|
|
||||||
|
|
||||||
gtk.main()
|
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
[Activity]
|
[Activity]
|
||||||
python_class = terminal
|
name = Terminal
|
||||||
|
id = org.sugar.Terminal
|
||||||
|
python_module = terminal.TerminalActivity
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
import vte
|
import vte
|
||||||
import pango
|
import pango
|
||||||
@ -26,7 +24,7 @@ class Terminal(gtk.HBox):
|
|||||||
self._vte.connect("child-exited", lambda term: term.fork_command())
|
self._vte.connect("child-exited", lambda term: term.fork_command())
|
||||||
|
|
||||||
self._vte.fork_command()
|
self._vte.fork_command()
|
||||||
|
|
||||||
def _configure_vte(self):
|
def _configure_vte(self):
|
||||||
self._vte.set_font(pango.FontDescription('Monospace 10'))
|
self._vte.set_font(pango.FontDescription('Monospace 10'))
|
||||||
self._vte.set_colors(gtk.gdk.color_parse ('#AAAAAA'),
|
self._vte.set_colors(gtk.gdk.color_parse ('#AAAAAA'),
|
||||||
@ -53,24 +51,11 @@ class Terminal(gtk.HBox):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
class TerminalActivity(Activity):
|
class TerminalActivity(Activity):
|
||||||
def __init__(self):
|
def __init__(self, args):
|
||||||
Activity.__init__(self, _TERMINAL_ACTIVITY_TYPE)
|
Activity.__init__(self, _TERMINAL_ACTIVITY_TYPE)
|
||||||
|
|
||||||
def on_connected_to_shell(self):
|
self.set_title("Terminal")
|
||||||
self.set_tab_text("Terminal")
|
|
||||||
|
|
||||||
plug = self.gtk_plug()
|
|
||||||
|
|
||||||
terminal = Terminal()
|
terminal = Terminal()
|
||||||
plug.add(terminal)
|
self.add(terminal)
|
||||||
terminal.show()
|
terminal.show()
|
||||||
|
|
||||||
plug.show()
|
|
||||||
|
|
||||||
activity = TerminalActivity()
|
|
||||||
activity.connect_to_shell()
|
|
||||||
|
|
||||||
try:
|
|
||||||
gtk.main()
|
|
||||||
except KeyboardInterrupt:
|
|
||||||
pass
|
|
||||||
|
Loading…
Reference in New Issue
Block a user