Fix title handling. Hide old browser and chat.

This commit is contained in:
Marco Pesenti Gritti 2006-10-13 11:17:35 +02:00
parent f1778669ba
commit c7fdae2606
4 changed files with 11 additions and 3 deletions

View File

@ -3,4 +3,4 @@ name = Web
id = com.redhat.Sugar.BrowserActivity id = com.redhat.Sugar.BrowserActivity
icon = activity-web icon = activity-web
python_module = browser.BrowserActivity.BrowserActivity python_module = browser.BrowserActivity.BrowserActivity
show_launcher = yes show_launcher = no

View File

@ -3,4 +3,4 @@ name = GroupChat
icon = activity-groupchat icon = activity-groupchat
id = com.redhat.Sugar.GroupChatActivity id = com.redhat.Sugar.GroupChatActivity
python_module = groupchat.GroupChatActivity.GroupChatActivity python_module = groupchat.GroupChatActivity.GroupChatActivity
show_launcher = yes show_launcher = no

View File

@ -1,4 +1,5 @@
import gtk import gtk
from gettext import gettext as _
from sugar.activity.Activity import Activity from sugar.activity.Activity import Activity
from webbrowser import WebBrowser from webbrowser import WebBrowser
@ -10,9 +11,12 @@ class WebActivity(Activity):
def __init__(self): def __init__(self):
Activity.__init__(self) Activity.__init__(self)
self.set_title(_('Web Activity'))
vbox = gtk.VBox() vbox = gtk.VBox()
self._browser = WebBrowser() self._browser = WebBrowser()
self._browser.connect('notify::title', self._title_changed_cb)
toolbar = Toolbar(self._browser) toolbar = Toolbar(self._browser)
vbox.pack_start(toolbar, False) vbox.pack_start(toolbar, False)
@ -25,3 +29,6 @@ class WebActivity(Activity):
vbox.show() vbox.show()
self._browser.load_url(_HOMEPAGE) self._browser.load_url(_HOMEPAGE)
def _title_changed_cb(self, embed, pspec):
self.set_title(embed.props.title)

View File

@ -104,6 +104,7 @@ class _ActivityRegistry:
self._activities.append(module) self._activities.append(module)
if cp.has_option('Activity', 'show_launcher'): if cp.has_option('Activity', 'show_launcher'):
if cp.get('Activity', 'show_launcher') == 'yes':
module.set_show_launcher(True) module.set_show_launcher(True)
if cp.has_option('Activity', 'icon'): if cp.has_option('Activity', 'icon'):