[Sugar-devel] [PATCH Sugar-toolkit-gtk3] ActivityButton should handle the case of activities without metadata

Anish Mangal anish at activitycentral.com
Mon May 14 14:45:37 EDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 14 May 2012 11:52:33 PM IST, godiard at sugarlabs.org wrote:
> From: Gonzalo Odiard <godiard at gmail.com>
>
> We already manage this cae in the icon creation but not when we set

Typo s/cae/case

> the button tooltip
>
> Signed-off-by: Gonzalo Odiard <gonzalo at laptop.org>
>
> -------------------
>
> v2: Improve description.
>     Do not try to connect the 'updated' signal.
> ---
>  src/sugar3/activity/widgets.py |    5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/sugar3/activity/widgets.py b/src/sugar3/activity/widgets.py
> index 97450f2..c7683cf 100644
> --- a/src/sugar3/activity/widgets.py
> +++ b/src/sugar3/activity/widgets.py
> @@ -60,8 +60,9 @@ class ActivityButton(ToolButton):
>          self.set_icon_widget(icon)
>          icon.show()
>
> -        self.props.tooltip = activity.metadata['title']
> -        activity.metadata.connect('updated', self.__jobject_updated_cb)
> +        if activity.metadata:
> +            self.props.tooltip = activity.metadata['title']
> +            activity.metadata.connect('updated', self.__jobject_updated_cb)
>
>      def __jobject_updated_cb(self, jobject):
>          self.props.tooltip = jobject['title']


Looks good otherwise.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPsVLRAAoJEBoxUdDHDZVp7bYH/jHwr5FbgWVNBpw+cF+CMOVA
8aUjDKqIlkU5ZDNUv+upMjIzJb5UhdzDnzQYxZf/3MSuTZyDSE/+AR1cM07t4+Ux
Tby7tXPcJQVAKxYXr97YsV3oDyjKevcrICbZPT5vTc0kZc2UOZ/RlOXZfk/xP73D
Fl3iLF7PT8kSPGGLMe6h3p5GI3JBHuS1A1BreKt6CEXUl+cpXcXaiyJntJnsdfqt
DjEsuKZbN5/mbKCSmriSkN/JBkIQtaSp/0GCKUPZZGVvo2FK9+b20q5wDlTznlyJ
iBo6YND+GrjodP1xOoOPDogZJEquBNJkJCabFPCwcmd6DFYew193ko4eDRM7o3U=
=6PQT
-----END PGP SIGNATURE-----



More information about the Sugar-devel mailing list