mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-17 05:47:50 +00:00
Update gtk ui to use new TrackerIcons
This commit is contained in:
parent
6ded75caef
commit
d7fa383da3
@ -195,6 +195,10 @@ class FilterTreeView(component.Component):
|
|||||||
self.select_default_filter()
|
self.select_default_filter()
|
||||||
|
|
||||||
def update_row(self, cat, value , count):
|
def update_row(self, cat, value , count):
|
||||||
|
def on_get_icon(icon):
|
||||||
|
if icon:
|
||||||
|
self.set_row_image(cat, value, icon.get_filename())
|
||||||
|
|
||||||
if (cat, value) in self.filters:
|
if (cat, value) in self.filters:
|
||||||
row = self.filters[(cat, value)]
|
row = self.filters[(cat, value)]
|
||||||
self.treestore.set_value(row, 3, count)
|
self.treestore.set_value(row, 3, count)
|
||||||
@ -207,7 +211,8 @@ class FilterTreeView(component.Component):
|
|||||||
self.filters[(cat, value)] = row
|
self.filters[(cat, value)] = row
|
||||||
|
|
||||||
if cat == "tracker_host" or cat == "label":
|
if cat == "tracker_host" or cat == "label":
|
||||||
self.tracker_icons.get_async(value, lambda filename: self.set_row_image(cat, value, filename))
|
d = self.tracker_icons.get(value)
|
||||||
|
d.addCallback(on_get_icon)
|
||||||
|
|
||||||
self.treestore.set_value(row, FILTER_COLUMN, True)
|
self.treestore.set_value(row, FILTER_COLUMN, True)
|
||||||
return row
|
return row
|
||||||
|
@ -87,19 +87,21 @@ def cell_data_statusicon(column, cell, model, row, data):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def cell_data_trackericon(column, cell, model, row, data):
|
def cell_data_trackericon(column, cell, model, row, data):
|
||||||
icon_path = component.get("TrackerIcons").get(model[row][data])
|
def on_get_icon(icon):
|
||||||
if icon_path:
|
if icon:
|
||||||
try:
|
try:
|
||||||
icon = gtk.gdk.pixbuf_new_from_file_at_size(icon_path, 16, 16)
|
icon = gtk.gdk.pixbuf_new_from_file_at_size(icon.get_filename(), 16, 16)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
icon = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 16, 16)
|
icon = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, True, 8, 16, 16)
|
||||||
icon.fill(0x00000000)
|
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)
|
||||||
|
|
||||||
|
d = component.get("TrackerIcons").get(model[row][data])
|
||||||
|
d.addCallback(on_get_icon)
|
||||||
|
|
||||||
def cell_data_progress(column, cell, model, row, data):
|
def cell_data_progress(column, cell, model, row, data):
|
||||||
"""Display progress bar with text"""
|
"""Display progress bar with text"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user