1
2
3
4
5
6
7
8
9
10
11
|
# encoding: utf-8
# title: Spec buttons for apps
# description: Adds configurable mini toolbar buttons
# version: 0.8
# 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, columns: "Icon,Command", description: "Icons can be `<a href='http://www.pygtk.org/pygtk2reference/gtk-stock-items.html'>gtk-xyz</a>` internal names. Else use `/usr/share/icon/*.png` file names. Icon file basenames will be expanded into full paths." }
# documentation:
|
|
|
1
2
3
4
5
6
7
8
9
10
11
|
# encoding: utf-8
# title: Spec buttons for apps
# description: Adds configurable mini toolbar buttons
# version: 0.8.1
# 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, columns: "Icon,Command", description: "Icons can be `<a href='http://www.pygtk.org/pygtk2reference/gtk-stock-items.html'>gtk-xyz</a>` internal names. Else use `/usr/share/icon/*.png` file names. Icon file basenames will be expanded into full paths." }
# documentation:
|
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
if btn:
wi.set_from_file(btn)
else:
wi.set_from_stock("gtk-image-missing", gtk.ICON_SIZE_SMALL_TOOLBAR)
return wi
# Look for image basename (e.g. "play") in /usr/share/icons/*.* and /pixmaps/*
def locate(self, btn):
f = subprocess.Popen(["locate", "/usr/share/[pi]*s/*%s*.*" % btn], stdout=subprocess.PIPE)
path, err = f.communicate()
if not err:
return path.split("\n")[0]
# Update paths when saving config dialog
def update_paths(self):
r = {}
|
|
>
|
>
>
|
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
if btn:
wi.set_from_file(btn)
else:
wi.set_from_stock("gtk-image-missing", gtk.ICON_SIZE_SMALL_TOOLBAR)
return wi
# Look for image basename (e.g. "play") in /usr/share/icons/*.* and /pixmaps/*
def locate(self, btn, f=None):
try:
f = subprocess.Popen(["locate", "/usr/share/[pi]*s/*%s*.*" % btn], stdout=subprocess.PIPE)
except:
return None
path, err = f.communicate()
if not err:
return path.split("\n")[0]
# Update paths when saving config dialog
def update_paths(self):
r = {}
|