Index: channels/ui_cht.py ================================================================== --- channels/ui_cht.py +++ channels/ui_cht.py @@ -1,10 +1,10 @@ # encoding: utf-8 # title: Channel toolbar link # description: Shows current channel and a link to online service in toolbar. -# version: 1.1 -# depends: streamtuner2 >= 2.1.9 +# version: 1.2 +# depends: streamtuner2 >= 2.2.2 # type: feature # category: ui # # Reintroduces the channel/service link in the toolbar, # just like in streamtuner1. @@ -12,23 +12,30 @@ # Note this requires '[✔] Add current channel name to window title' # in the general Options. import re - +from config import conf,log +from uikit import * # Channel Homepage in Toolbar class ui_cht(object): module = 'ui_cht' # Hook toolbar label def __init__(self, parent): self.label = parent.toolbar_link + self.icon = parent.get_widget("toolbar_icon") parent.hooks["switch"].append(self.switchy) # Update link label def switchy(self, meta, *x, **y): title = meta.get("title", meta.get("id", (""))) url = meta.get("url", "") domain = re.sub("^.+?//|/.+$", "", url) self.label.set_markup("{}\n{}".format(title, url, domain)) + # icon (since 2.2.2) + if self.icon and meta.get("png"): + pixbuf = uikit.pixbuf(meta["png"]) + pixbuf = pixbuf.scale_simple(32, 32, gtk.gdk.INTERP_BILINEAR) + self.icon.set_from_pixbuf(pixbuf) Index: gtk3.xml.gz ================================================================== --- gtk3.xml.gz +++ gtk3.xml.gz cannot compute difference between binary files