✨ Add setting for sd cancel command (#4408)

* adds a setting for sd cancel command, #4368
not binding to settingsViewModel as expected, needs adjustment to API?

* add settings API bits for binding issue

* instantiate setting on init.
This commit is contained in:
jneilliii authored and GitHub committed 2022-02-09 18:53:10 +01:00
1 parent e9c33e1f28
commit b21099b5a0
5 files changed
+14 -1

No files matched your search

+3
View File
@@ -206,6 +206,7 @@ def getSettings():
"blockedCommands": s.get(["serial", "blockedCommands"]),
"ignoredCommands": s.get(["serial", "ignoredCommands"]),
"pausingCommands": s.get(["serial", "pausingCommands"]),
"sdCancelCommand": s.get(["serial", "sdCancelCommand"]),
"emergencyCommands": s.get(["serial", "emergencyCommands"]),
"helloCommand": s.get(["serial", "helloCommand"]),
"ignoreErrorsFromFirmware": s.getBoolean(
@@ -812,6 +813,8 @@ def _saveSettings(data):
data["serial"]["pausingCommands"], (list, tuple)
):
s.set(["serial", "pausingCommands"], data["serial"]["pausingCommands"])
if "sdCancelCommand" in data["serial"]:
s.set(["serial", "sdCancelCommand"], data["serial"]["sdCancelCommand"])
if "emergencyCommands" in data["serial"] and isinstance(
data["serial"]["emergencyCommands"], (list, tuple)
):