Check-in [cdafbe23ce]
Overview
Comment: | Typecast plugin options on initialization. Use SpinButton for `int` options instead of text label. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
cdafbe23ce0b3ea9906e167a4be6f892 |
User & Date: | mario on 2015-05-17 19:12:35 |
Other Links: | manifest | tags |
Context
2015-05-17
| ||
19:13 | Remove stray `print` statement check-in: d10f61093f user: mario tags: trunk | |
19:12 | Typecast plugin options on initialization. Use SpinButton for `int` options instead of text label. check-in: cdafbe23ce user: mario tags: trunk | |
19:11 | Introduce new hooks["switch"] for update_title(). Used by new `Channel homepage link` plugin, which brings back streamtuner1-style service homepage. check-in: f992b0792a user: mario tags: trunk | |
Changes
Modified channels/configwin.py from [3a18900ebe] to [e39ea3ed2b].
︙ | |||
50 51 52 53 54 55 56 | 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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | - + - + - + + + + - + - + - + - + + + + - + | # Load values from conf. store into gtk widgets def load_config(self, config, prefix="config_"): for key,val in config.items(): w = self.main.get_widget(prefix + key) if w: # input field |
︙ | |||
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | + + - + - + + + + + - + + + - + | cb.set_tooltip_text(self._tooltip(meta)) add_( "config_plugins_"+name, cb, color=meta.get("color"), image=meta.get("png"), align=0) # Default values are already in conf[] dict # (now done in conf.add_plugin_defaults) for opt in meta["config"]: color = opt.get("color", None) type = opt.get("type", "str") description = opt.get("description", "./.") # hidden if opt.get("hidden"): continue # display checkbox elif opt["type"] in ("bool", "boolean"): cb = gtk.CheckButton(opt["description"]) |
︙ |
Modified pluginconf.py from [33b1fa968d] to [d5e7efa673].
︙ | |||
466 467 468 469 470 471 472 | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | + + + + + + + - + | # def add_plugin_defaults(conf_options, conf_plugins, meta={}, module=""): # Option defaults, if not yet defined for opt in meta.get("config", []): if "name" in opt and "value" in opt: if opt["name"] not in conf_options: # typemap "bool" and "int" here if opt["type"] in ("bool", "boolean"): val = bool(opt["value"]) elif opt["type"] in ("int", "integer", "numeric"): val = int(opt["value"]) else: val = str(opt["value"]) |