48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
"scripts": [],
"timer": [],
"history": []
}
default = "favourite"
fixed_size = [32,24]
reserved_names = ["favourite", "radiotray", "scripts", "search", "timer", "history", "links", "themes"] #+ self.parent.features.keys()
# cache list, to determine if a PLS url is bookmarked
urls = []
def gui(self, parent):
parent.notebook_channels.set_menu_label_text(parent.v_bookmarks, "bookmarks")
self.update_categories()
GenericChannel.gui(self, parent)
uikit.tree_column(self.gtk_cat, "Group")
# custom categories are shown as subfolder below `favourite`
def update_categories(self):
cust_cats = list(set(self.streams.keys()) - set(self.reserved_names))
if len(self.categories) < 2 or type(self.categories[1]) is not list:
self.categories.insert(1, [])
self.categories[1] = cust_cats
# but category sub-plugins might provide a hook
category_plugins = {}
def update_streams(self, cat):
if cat in self.category_plugins:
return self.category_plugins[cat].update_streams(cat) or []
else:
return self.streams.get(cat, [])
|
>
<
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
"scripts": [],
"timer": [],
"history": []
}
default = "favourite"
fixed_size = [32,24]
reserved_names = ["favourite", "radiotray", "scripts", "search", "timer", "history", "links", "themes"] #+ self.parent.features.keys()
category_plugins = {}
# cache list, to determine if a PLS url is bookmarked
urls = []
def gui(self, parent):
parent.notebook_channels.set_menu_label_text(parent.v_bookmarks, "bookmarks")
self.update_categories()
GenericChannel.gui(self, parent)
uikit.tree_column(self.gtk_cat, "Group")
# custom categories are shown as subfolder below `favourite`
def update_categories(self):
cust_cats = list(set(self.streams.keys()) - set(self.reserved_names))
if len(self.categories) < 2 or type(self.categories[1]) is not list:
self.categories.insert(1, [])
self.categories[1] = cust_cats
# but category sub-plugins might provide a hook
def update_streams(self, cat):
if cat in self.category_plugins:
return self.category_plugins[cat].update_streams(cat) or []
else:
return self.streams.get(cat, [])
|