set signs on unprinted on sign change
This commit is contained in:
parent
4992d7b91a
commit
e777be80fe
1 changed files with 5 additions and 0 deletions
|
@ -341,9 +341,14 @@ def show_thing_changer(ui_element: nicegui.ui.element, thing: Thing) -> None:
|
|||
def save_sign_value(event, member):
|
||||
"""Copy input field value to sign member."""
|
||||
if not event.value:
|
||||
if hasattr(thing.sign, "printed") and hasattr(thing.sign, member):
|
||||
del vars(thing.sign)["printed"]
|
||||
del vars(thing.sign)[member]
|
||||
else:
|
||||
previous = vars(thing.sign)[member]
|
||||
vars(thing.sign)[member] = try_conversion(event.value, (int, float, "bool"))
|
||||
if previous != vars(thing.sign)[member] and hasattr(thing.sign, "printed"):
|
||||
del vars(thing.sign)["printed"]
|
||||
|
||||
def save_list_value(event, member):
|
||||
"""Split input field at '; ' and save ta thing member."""
|
||||
|
|
Loading…
Reference in a new issue