60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
-
|
# Also order them by conf.channel_order
#
def module_list():
# Should list plugins within zips as well as local paths
ls = pkgutil.iter_modules([conf.share+"/channels", "channels"])
ls = [name for loader,name,ispkg in ls]
print ls
# resort with tab order
order = [module.strip() for module in conf.channel_order.lower().replace(".","_").replace("-","_").split(",")]
ls = [module for module in (order) if (module in ls)] + [module for module in (ls) if (module not in order)]
return ls
|
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
|
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
|
-
-
-
-
-
+
+
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
|
tv2.set_property("enable_tree_lines", True)
tv2.connect("row_activated", parent.on_play_clicked)
tv2.show()
sw2.add(tv2)
vbox.pack2(sw2, resize=True, shrink=True)
# prepare label
label = gtk.HBox()
label.set_property("visible", True)
fn = conf.share + "/channels/" + self.module + ".png"
pixbuf = None
if "png" in self.meta:
pixbuf = uikit.pixbuf(self.meta["png"])
elif os.path.exists(fn):
pixbuf = gtk.gdk.pixbuf_new_from_file(fn)
else:
png = pkgutil.get_data("config", "channels/" + self.module + ".png")
pixbuf = uikit.pixbuf(png)
if pixbuf:
icon = gtk.Image()
icon.set_from_pixbuf(pixbuf)
icon = gtk.image_new_from_pixbuf(pixbuf)
else:
icon.set_property("icon-size", 1)
icon.set_property("visible", True)
label.pack_start(icon, expand=False, fill=True)
icon = gtk.image_new_from_stock(gtk.STOCK_DIRECTORY, size=1)
label = gtk.HBox()
label.pack_start(icon, expand=False, fill=True)
if self.meta["title"]:
text = gtk.Label(self.meta["title"])
text.set_property("visible", True)
label.pack_start(text, expand=True, fill=True)
label.pack_start(gtk.Label(self.meta.get("title", self.module)), expand=True, fill=True)
# pack it into an event container to catch double-clicks
ev_label = gtk.EventBox()
ev_label.add(label)
ev_label.connect('event', parent.on_homepage_channel_clicked)
plain_label = gtk.Label(self.module)
# to widgets
self.gtk_cat = tv1
parent.widgets[module + "_cat"] = tv1
self.gtk_list = tv2
parent.widgets[module + "_list"] = tv2
ev_label.show_all()
vbox.show_all()
parent.widgets["v_" + module] = vbox
parent.widgets["c_" + module] = ev_label
tv2.connect('button-press-event', parent.station_context_menu)
# try to initialize superclass now, before adding to channel tabs
GenericChannel.gui(self, parent)
|