Check-in [7b225c5888]
Overview
| Comment: | Fix typo in default config save/load filename. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
7b225c58881f6e7dfd3ba3ef896ccb68 |
| User & Date: | mario on 2017-01-01 15:31:05 |
| Other Links: | manifest | tags |
Context
|
2017-01-01
| ||
| 15:32 | Try/catch abent cache/ or icons/ folders in ~/.config/streamtuner2/ check-in: 60feceaf39 user: mario tags: trunk | |
| 15:31 | Fix typo in default config save/load filename. check-in: 7b225c5888 user: mario tags: trunk | |
| 15:25 | Prevent .row() - row["url"]/urn_resolve from crashing for homepage-only entries (from e.g. links channel). check-in: 4fb2d74c67 user: mario tags: trunk | |
Changes
Modified contrib/prefstore.py from [32a9e10322] to [c16a79a726].
1 2 3 4 | # encoding: UTF-8 # api: streamtuner2 # title: Config save/import/reset # description: Allows to store, reimport or delete all preferences | | | 1 2 3 4 5 6 7 8 9 10 11 12 | # encoding: UTF-8 # api: streamtuner2 # title: Config save/import/reset # description: Allows to store, reimport or delete all preferences # version: 0.2.1 # type: feature # category: config # priority: optional # # Adds a context menu "Staton > Extensions > Config ...", which allows # to save or restore settings, or reset them to defaults. |
| ︙ | ︙ | |||
33 34 35 36 37 38 39 |
self.parent = parent
uikit.add_menu([parent.extensions], "Config save", self.save)
uikit.add_menu([parent.extensions], "Config restore", self.restore)
uikit.add_menu([parent.extensions], "Config delete", self.reset)
# Save conf.
def save(self, *w):
| | | | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
self.parent = parent
uikit.add_menu([parent.extensions], "Config save", self.save)
uikit.add_menu([parent.extensions], "Config restore", self.restore)
uikit.add_menu([parent.extensions], "Config delete", self.reset)
# Save conf.
def save(self, *w):
fn = uikit.save_file(title="Export streamtuner2 config", fn="streamtuner2.config.json", formats=[("*.json", "*.json")])
if not fn:
return
data = vars(conf)
del data["args"]
with open(fn, "w") as f:
f.write(json.dumps(data, indent=4, sort_keys=True))
self.parent.status("Settings saved to " + fn)
# Save conf.
def restore(self, *w):
fn = uikit.save_file(title="Import streamtuner2 config", fn="streamtuner2.config.json", formats=[("*.json", "*.json")], action=gtk.FILE_CHOOSER_ACTION_OPEN, action_btn=gtk.STOCK_OPEN)
if not fn:
return
with open(fn, "r") as f:
conf.update(json.load(f))
conf.save()
self.parent.status("Restart streamtuner2 for changes to take effect.")
|
| ︙ | ︙ |