Index: channels/configwin.py
==================================================================
--- channels/configwin.py
+++ channels/configwin.py
@@ -64,15 +64,22 @@
w.set_default(val)
# number
elif isinstance(w, gtk.SpinButton):
w.set_value(int(val))
# list
- elif isinstance(w, gtk.ListStore) and isinstance(val, dict):
+ elif isinstance(w, gtk.ListStore):
w.clear()
- for k,v in val.items():
- w.append([k, v, uikit.app_bin_check(v)])
- w.append(["", "", gtk.STOCK_NEW])
+ if isinstance(val, dict):
+ for k,v in val.items():
+ w.append([k, v, uikit.app_bin_check(v)])
+ w.append(["", "", gtk.STOCK_NEW])
+ elif isinstance(val, list):
+ for row in val:
+ log.DATA(row)
+ w.append([str(e) for e in row])
+ if len(val):
+ w.append(["" for e in val[0]])
#log.CONF("config load", prefix+key, val, type(w))
# Store gtk widget valus back into conf. dict
def save_config(self, config, prefix="config_", save=0):
for key,val in config.items():
@@ -90,14 +97,19 @@
# int
elif isinstance(w, gtk.SpinButton):
config[key] = int(w.get_value(val))
# dict
elif isinstance(w, gtk.ListStore):
- config[key] = {}
- for row in w:
- if row[0] and row[1]:
- config[key][row[0]] = row[1]
+ if key in config and isinstance(config[key], list):
+ config[key] = []
+ for row in w:
+ config[key].append([str(e) for e in row])
+ else:
+ config[key] = {}
+ for row in w:
+ if row[0] and row[1]:
+ config[key][row[0]] = row[1]
log.CONF("config save", prefix+key, val)
# iterate over channel and feature plugins
def add_plugins(self):
Index: channels/specbuttons.py
==================================================================
--- channels/specbuttons.py
+++ channels/specbuttons.py
@@ -5,11 +5,11 @@
# 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 either be `gtk-xyz` internal names, or `/usr/share/icon/*.png` path names ← which icon basenames would be expanded into. Commands can be any external program." }
+# { name: specbuttons, type: dict, columns: "Icon,Command", description: "Icons can be `gtk-xyz` internal names. Else use `/usr/share/icon/*.png` file names. Icon file basenames will be expanded into full paths. "}
# 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
Index: help/specbuttons.page
==================================================================
--- help/specbuttons.page
+++ help/specbuttons.page
@@ -7,19 +7,20 @@
Using the specbuttons plugin, you can define additional shortcuts. This is meant as convenience - allows to start other audio apps or system ontrols from within streamtuner2.
-The settings list can be found in the Settings → Options tab. It - follows the layout of the player/recording configuration. Except - that it lists icons and their according action commands:
+The settings list can be found with th plugin options in the
+
Icon | Cmd |
Note that the icon name can either be Gtk-builtin icon. Their +
Note that the icon name can also be that of a Gtk-builtin icon. Their
names always start with "
With the "number of rows" setting, more buttons can be packed together. + It looks okay with up to 3 rows - when using the large sized main toolbar. + The defined icon shortcuts will always be packed column-wise.
+The icon list isn't ordered. So you cannot - define which button appears first.