Internet radio browser GUI for music/video streams from various directory services.

⌈⌋ branch:  streamtuner2


Diff

Differences From Artifact [cb0390ac2c]:

To Artifact [19182e61c1]:


1
2

3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
1

2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
17

-
+







-
+







# encoding: utf-8
# title: Extra buttons for apps
# title: Spec buttons for apps
# description: Adds configurable mini toolbar buttons
# version: 0.7
# depends: streamtuner2 >= 2.2.0
# type: feature
# category: ui
# config:
#    { name: specbutton_rows, value: 2, max: 4, type: int, description: "Number of rows to arrange buttons in." }
#    { name: specbuttons, type: dict, rows: "icon,command", description: "Associate icons to external commands." }
#    { name: specbuttons, type: dict, columns: "Icon,Command", description: "Icons can either be `<a href='http://www.pygtk.org/pygtk2reference/gtk-stock-items.html'>gtk-xyz</a>` internal names, or `/usr/share/icon/*.png` path names ← which icon basenames would be expanded into. Commands can be any external program." }
# doc:
#    http://fossil.include-once.org/streamtuner2/info/43b36ed35b1488d5
#
# Adds the mini/extra buttons in the toolbar, which allow to control your
# audio player or run other system commands. The configuration list is in
# the Settings → Options tab.
#
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
46
47
48
49
50
51
52

53
54
55
56
57
58
59







-







    # Hook toolbar label
    def __init__(self, parent):
        self.parent = parent
        self.specbuttons = parent.get_widget("specbuttons")
        parent.hooks["init"].append(self.update_buttons)
        parent.hooks["config_save"].append(self.update_paths)
        parent.specbuttons.show()
        parent.tv_config_specbuttons.show()

    # Extra buttons
    def update_buttons(self, parent):
    
        # define table width (2 rows default)
        y = max(min(int(conf.specbutton_rows), 4), 1) # 1 <= y <= 4
        self.specbuttons.resize(y, int(math.ceil(len(conf.specbuttons) / y)))