From e03fd4ddde95d8fcdf857f6cbdb0b05e9fd36471 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Thu, 30 Jul 2009 05:43:36 +0000 Subject: [PATCH] Minor tweaks --- src/sugar/activity/activity.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py index 30cd0a10..7b6c0941 100644 --- a/src/sugar/activity/activity.py +++ b/src/sugar/activity/activity.py @@ -1055,9 +1055,6 @@ def paste_button(**kwargs): return paste def share_button(activity, **kwargs): - def neighborhood_cb(button): - activity.share() - palette = RadioPalette() private = RadioToolButton( @@ -1067,11 +1064,12 @@ def share_button(activity, **kwargs): neighborhood = RadioToolButton( icon_name='zoom-neighborhood', group=private) - neighborhood.connect('clicked', neighborhood_cb) + neighborhood_handle = neighborhood.connect('clicked', + lambda button: activity.share()) palette.append(neighborhood, _('My Neighborhood')) def update_share(): - neighborhood.handler_block_by_func(neighborhood_cb) + neighborhood.handler_block(neighborhood_handle) try: if activity.get_shared(): private.props.sensitive = False @@ -1082,7 +1080,7 @@ def share_button(activity, **kwargs): neighborhood.props.sensitive = True private.props.active = True finally: - neighborhood.handler_unblock_by_func(neighborhood_cb) + neighborhood.handler_unblock(neighborhood_handle) activity.connect('shared', lambda activity: update_share()) activity.connect('joined', lambda activity: update_share())