diff options
author | Simon Schampijer <simon@schampijer.de> | 2011-04-11 15:02:38 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@schampijer.de> | 2011-04-11 15:07:44 (GMT) |
commit | 39513c9d317d9cd121ba065b8e64331f8ca4296e (patch) | |
tree | e2b691110ebfcb1c7d19347ea3b736dba5d85702 | |
parent | d01235e9b5dbdf4cf550aba9bae252ddc6d8996e (diff) |
Journal detail view copy-palette: fallback to more generic icon when needed, part of OLPC #10805
The list of icon names we get in Fedora is: ['drive-removable-media-usb', 'drive-removable-media',
'drive-removable', 'drive']. Of this list our artwork only has 'drive' which is the
usb icon. This adds the fallback code to make it more robust and display the icon.
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-By: Sascha Silbe <silbe@activitycentral.com>
-rw-r--r-- | src/jarabe/journal/journaltoolbox.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/jarabe/journal/journaltoolbox.py b/src/jarabe/journal/journaltoolbox.py index cdf998d..d825bc9 100644 --- a/src/jarabe/journal/journaltoolbox.py +++ b/src/jarabe/journal/journaltoolbox.py @@ -469,9 +469,12 @@ class EntryToolbar(gtk.Toolbar): continue menu_item = MenuItem(mount.get_name()) - # TODO: fallback to the more generic icons when needed - menu_item.set_image(Icon(icon_name=mount.get_icon().props.names[0], - icon_size=gtk.ICON_SIZE_MENU)) + icon_theme = gtk.icon_theme_get_default() + for name in mount.get_icon().props.names: + if icon_theme.has_icon(name): + menu_item.set_image(Icon(icon_name=name, + icon_size=gtk.ICON_SIZE_MENU)) + break menu_item.connect('activate', self._copy_menu_item_activate_cb, |