Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/activity/activity.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-07-28 15:02:00 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-07-28 15:02:00 (GMT)
commit9e9a22b2d521d2bbbe2d79019e4292e3dc793a66 (patch)
tree66527cacb26289e69e2b954c29ef8101519b1c98 /src/sugar/activity/activity.py
parent2088bd5f2a86e2ef3f7d137654e94290679dff2b (diff)
Use activity icon for activity.toolbar button
Diffstat (limited to 'src/sugar/activity/activity.py')
-rw-r--r--src/sugar/activity/activity.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py
index e613d18..600f86b 100644
--- a/src/sugar/activity/activity.py
+++ b/src/sugar/activity/activity.py
@@ -1019,7 +1019,7 @@ def _get_session():
def get_bundle_name():
"""Return the bundle name for the current process' bundle"""
return os.environ['SUGAR_BUNDLE_NAME']
-
+
def get_bundle_path():
"""Return the bundle path for the current process' bundle"""
return os.environ['SUGAR_BUNDLE_PATH']
@@ -1039,10 +1039,18 @@ def show_object_in_journal(object_id):
journal.ShowObject(object_id)
def toolbar(activity):
+ from jarabe.journal.misc import get_icon_name
+
activity_button = ToolbarButton(
- page=ActivityToolbar(activity, hide_stop=True),
- icon_name='computer-xo')
+ page=ActivityToolbar(activity, hide_stop=True))
activity_button.show()
+
+ client = gconf.client_get_default()
+ color = XoColor(client.get_string('/desktop/sugar/user/color'))
+ icon = Icon(file=get_icon_name(activity.metadata), xo_color=color)
+ icon.show()
+ activity_button.set_icon_widget(icon)
+
return activity_button
def expander():
@@ -1123,7 +1131,10 @@ def share_button(activity, **kwargs):
activity.connect('shared', lambda activity: update_share())
activity.connect('joined', lambda activity: update_share())
- return RadioMenuButton(palette=palette)
+ share = RadioMenuButton(palette=palette)
+ share.show()
+
+ return share
def keep_button(activity, **kwargs):
client = gconf.client_get_default()
@@ -1131,7 +1142,7 @@ def keep_button(activity, **kwargs):
keep_icon = Icon(icon_name='document-save', xo_color=color)
keep_icon.show()
- keep = ToolButton(tooltip=_('Keep'))
+ keep = ToolButton(tooltip=_('Keep'), **kwargs)
keep.set_icon_widget(keep_icon)
keep.props.accelerator = '<Ctrl>S'
keep.connect('clicked', lambda button: activity.copy())