diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-25 15:44:45 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-25 15:44:45 (GMT) |
commit | 8ac55c287ebf678a1166fd5d4f3c3d6676168f2d (patch) | |
tree | 9b3c8dc6890f725fc28d0b57bfa15d4f87d62c78 /shell | |
parent | cbfb10d02033787d7b37eafa23c50b96cd689eef (diff) | |
parent | f0a445910366e54de3365140bdc51933c2a9c171 (diff) |
Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar
Diffstat (limited to 'shell')
-rw-r--r-- | shell/panel/VerbsPanel.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/shell/panel/VerbsPanel.py b/shell/panel/VerbsPanel.py index 780c657..4c48769 100644 --- a/shell/panel/VerbsPanel.py +++ b/shell/panel/VerbsPanel.py @@ -5,10 +5,15 @@ from sugar.canvas.IconItem import IconItem from sugar.canvas.IconColor import IconColor from sugar import conf from panel.Panel import Panel +import logging class ActivityItem(IconItem): def __init__(self, activity, size): - IconItem.__init__(self, activity.get_icon(), + icon_name = activity.get_icon() + if not icon_name: + act_type = activity.get_default_type() + raise RuntimeError("Actvity %s did not have an icon!" % act_type) + IconItem.__init__(self, icon_name, IconColor('white'), size) self._activity = activity @@ -28,6 +33,12 @@ class ActivityBar(goocanvas.Group): self.add_activity(activity) def add_activity(self, activity): + # Need an icon to show up on the bar + if not activity.get_icon(): + name = activity.get_name() + logging.info("Activity %s did not have an icon. Won't show it." % name) + return + item = ActivityItem(activity, self._height) icon_size = self._height |