Skip to content

Commit

Permalink
Avoid errors with incomplete icon themes (LP bug 782303)
Browse files Browse the repository at this point in the history
  • Loading branch information
thp committed May 14, 2011
1 parent d56149a commit 717b417
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/gpodder/gtkui/desktop/deviceplaylist.py
Expand Up @@ -46,7 +46,11 @@ def new(self):
self.playlist_file = os.path.join(self.mountpoint,
self._config.mp3_player_playlist_file)
icon_theme = gtk.icon_theme_get_default()
self.icon_new = icon_theme.load_icon(gtk.STOCK_NEW, 16, 0)
try:
self.icon_new = icon_theme.load_icon(gtk.STOCK_NEW, 16, 0)
except Exception, e:
log('Icon missing from theme: %s', gtk.STOCK_NEW, sender=self)
self.icon_new = None

# add column two
check_cell = gtk.CellRendererToggle()
Expand Down
3 changes: 2 additions & 1 deletion src/gpodder/gtkui/desktop/trayicon.py
Expand Up @@ -64,7 +64,8 @@ def __init__(self, gp, icon_filename, config):
self.__icon = gtk.gdk.pixbuf_new_from_file(self.__icon_filename)
except Exception, exc:
log('Warning: Cannot load gPodder icon, will use the default icon (%s)', exc, sender=self)
self.__icon = gtk.icon_theme_get_default().load_icon(gtk.STOCK_DIALOG_QUESTION, 30, 30)
self.__icon = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 30, 30)
self.__icon.fill(0xFF00007F)

# Reset trayicon (default icon, default tooltip)
self.__current_pixbuf = None
Expand Down

0 comments on commit 717b417

Please sign in to comment.