Set the activity icon on new journal entries.

This commit is contained in:
Tomeu Vizoso 2007-05-19 20:06:36 +02:00
parent abec4df66e
commit 5d4b9b1dfa

View File

@ -28,6 +28,7 @@ import gtk, gobject
from sugar.presence import presenceservice
from sugar.activity.activityservice import ActivityService
from sugar.activity import bundleregistry
from sugar.graphics.window import Window
from sugar.graphics.toolbox import Toolbox
from sugar.graphics.toolbutton import ToolButton
@ -206,7 +207,7 @@ class Activity(Window, gtk.Container):
self.jobject['title'] = '%s %s' % (get_bundle_name(), 'Activity')
self.jobject['activity'] = self.get_service_name()
self.jobject['date'] = str(time.time())
self.jobject['icon'] = ''
self.jobject['icon'] = self._get_icon()
self.jobject['keep'] = '0'
self.jobject['buddies'] = ''
self.jobject['preview'] = ''
@ -329,6 +330,10 @@ class Activity(Window, gtk.Container):
raise
self.destroy()
def _get_icon(self):
registry = bundleregistry.get_registry()
return registry.get_bundle(self.get_service_name()).get_icon()
def get_bundle_name():
"""Return the bundle name for the current process' bundle
"""