Set the activity icon on new journal entries.
This commit is contained in:
parent
abec4df66e
commit
5d4b9b1dfa
@ -28,6 +28,7 @@ import gtk, gobject
|
|||||||
|
|
||||||
from sugar.presence import presenceservice
|
from sugar.presence import presenceservice
|
||||||
from sugar.activity.activityservice import ActivityService
|
from sugar.activity.activityservice import ActivityService
|
||||||
|
from sugar.activity import bundleregistry
|
||||||
from sugar.graphics.window import Window
|
from sugar.graphics.window import Window
|
||||||
from sugar.graphics.toolbox import Toolbox
|
from sugar.graphics.toolbox import Toolbox
|
||||||
from sugar.graphics.toolbutton import ToolButton
|
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['title'] = '%s %s' % (get_bundle_name(), 'Activity')
|
||||||
self.jobject['activity'] = self.get_service_name()
|
self.jobject['activity'] = self.get_service_name()
|
||||||
self.jobject['date'] = str(time.time())
|
self.jobject['date'] = str(time.time())
|
||||||
self.jobject['icon'] = ''
|
self.jobject['icon'] = self._get_icon()
|
||||||
self.jobject['keep'] = '0'
|
self.jobject['keep'] = '0'
|
||||||
self.jobject['buddies'] = ''
|
self.jobject['buddies'] = ''
|
||||||
self.jobject['preview'] = ''
|
self.jobject['preview'] = ''
|
||||||
@ -329,6 +330,10 @@ class Activity(Window, gtk.Container):
|
|||||||
raise
|
raise
|
||||||
self.destroy()
|
self.destroy()
|
||||||
|
|
||||||
|
def _get_icon(self):
|
||||||
|
registry = bundleregistry.get_registry()
|
||||||
|
return registry.get_bundle(self.get_service_name()).get_icon()
|
||||||
|
|
||||||
def get_bundle_name():
|
def get_bundle_name():
|
||||||
"""Return the bundle name for the current process' bundle
|
"""Return the bundle name for the current process' bundle
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user