mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-02 22:48:40 +00:00
Use a blank icon when the tracker icon downloaded isn't a proper image
This commit is contained in:
parent
efecf38bcd
commit
722a5cd9e1
1 changed files with 7 additions and 3 deletions
|
@ -88,14 +88,18 @@ def cell_data_statusicon(column, cell, model, row, data):
|
||||||
|
|
||||||
def cell_data_trackericon(column, cell, model, row, data):
|
def cell_data_trackericon(column, cell, model, row, data):
|
||||||
def on_get_icon(icon):
|
def on_get_icon(icon):
|
||||||
|
def create_blank_icon():
|
||||||
|
i = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 16, 16)
|
||||||
|
i.fill(0x00000000)
|
||||||
|
return i
|
||||||
|
|
||||||
if icon:
|
if icon:
|
||||||
try:
|
try:
|
||||||
icon = gtk.gdk.pixbuf_new_from_file_at_size(icon.get_filename(), 16, 16)
|
icon = gtk.gdk.pixbuf_new_from_file_at_size(icon.get_filename(), 16, 16)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
pass
|
icon = create_blank_icon()
|
||||||
else:
|
else:
|
||||||
icon = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 16, 16)
|
icon = create_blank_icon()
|
||||||
icon.fill(0x00000000)
|
|
||||||
|
|
||||||
if cell.get_property("pixbuf") != icon:
|
if cell.get_property("pixbuf") != icon:
|
||||||
cell.set_property("pixbuf", icon)
|
cell.set_property("pixbuf", icon)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue