Do not crash if cannot find icon
This commit is contained in:
parent
2ae62db4cc
commit
6d7e1dcb4c
@ -9,7 +9,7 @@ from sugar.shell import shell
|
||||
|
||||
def start(console):
|
||||
shell.main()
|
||||
print 'aaaa'
|
||||
|
||||
activities = ['sugar/chat/chat', 'sugar/browser/browser']
|
||||
|
||||
for activity in activities:
|
||||
|
@ -105,6 +105,7 @@ class Activity(dbus.service.Object):
|
||||
def activity_set_tab_icon_name(self, icon_name):
|
||||
icon_theme = gtk.icon_theme_get_default()
|
||||
icon_info = icon_theme.lookup_icon(icon_name, gtk.ICON_SIZE_MENU, 0)
|
||||
if icon_info:
|
||||
pixbuf = icon_info.load_icon()
|
||||
scaled_pixbuf = pixbuf.scale_simple(16, 16, gtk.gdk.INTERP_BILINEAR)
|
||||
self.activity_set_icon(scaled_pixbuf)
|
||||
|
Loading…
Reference in New Issue
Block a user