73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
gtk_list = None # Gtk widget for station treeview
gtk_cat = None # Gtk widget for category columns
ls = None # ListStore for station treeview
rowmap = None # Preserve streams-datamap
pix_entry = None # ListStore entry that contains favicon
img_resize = None # Rescale `img` references to icon size
fixed_size = [24,24] # Default height+width for favicons
# mapping of stream{} data into gtk treeview/treestore representation
datamap = [
# coltitle width [ datasrc key, type, renderer, attrs ] [cellrenderer2], ...
["", 20, ["state", str, "pixbuf", {}], ],
["Genre", 65, ['genre', str, "t", {}], ],
["Station Title",275, ["title", str, "text", {"strikethrough":11, "cell-background":12, "cell-background-set":13}], ["favicon", gtk.gdk.Pixbuf, "pixbuf", {}], ],
|
>
|
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
gtk_list = None # Gtk widget for station treeview
gtk_cat = None # Gtk widget for category columns
ls = None # ListStore for station treeview
rowmap = None # Preserve streams-datamap
pix_entry = None # ListStore entry that contains favicon
img_resize = None # Rescale `img` references to icon size
fixed_size = [24,24] # Default height+width for favicons
parent = None # reference to main window
# mapping of stream{} data into gtk treeview/treestore representation
datamap = [
# coltitle width [ datasrc key, type, renderer, attrs ] [cellrenderer2], ...
["", 20, ["state", str, "pixbuf", {}], ],
["Genre", 65, ['genre', str, "t", {}], ],
["Station Title",275, ["title", str, "text", {"strikethrough":11, "cell-background":12, "cell-background-set":13}], ["favicon", gtk.gdk.Pixbuf, "pixbuf", {}], ],
|
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
|
# Return ListStore object and Iterator for currently selected row in gtk.TreeView station list
def model_iter(self):
return self.gtk_list.get_selection().get_selected()
# Currently selected entry in stations list, return complete data dict
def row(self):
no = self.rowno()
ls = self.stations()
row = ls[no]
# resolve stream url for some plugins
if row["url"].startswith("urn:"):
row = action.resolve_urn(row)
ls[no] = row
return row
# Fetches a single varname from currently selected station entry
def selected(self, name="url"):
return self.row().get(name)
# Inject status icon into currently selected row (used by main.bookmark() call)
|
<
|
<
|
>
|
<
|
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
|
# Return ListStore object and Iterator for currently selected row in gtk.TreeView station list
def model_iter(self):
return self.gtk_list.get_selection().get_selected()
# Currently selected entry in stations list, return complete data dict
def row(self):
row = self.stations() [ self.rowno() ]
# resolve stream url for some plugins
if row.get("url", "urn:x-streamtuner2:no").startswith("urn:"):
self.status("Resolving actual stream URL for `%s`" % row["url"], timeout=2)
action.resolve_urn(row)
return row
# Fetches a single varname from currently selected station entry
def selected(self, name="url"):
return self.row().get(name)
# Inject status icon into currently selected row (used by main.bookmark() call)
|