[gui] Remove quotes from master audio, when entering via GUI

pull/357/head
nyanpasu64 2019-01-06 01:18:31 -08:00
rodzic d65453a138
commit b4f7c8a09c
1 zmienionych plików z 16 dodań i 0 usunięć

Wyświetl plik

@ -538,11 +538,27 @@ def color2hex_property(path: str):
return property(getter, setter)
def path_fix_property(path: str):
"""Removes quotes from paths, when setting from GUI."""
def getter(self: "ConfigModel") -> str:
return rgetattr(self.cfg, path)
def setter(self: "ConfigModel", val: str):
if len(val) and val[0] == val[-1] == '"':
val = val[1:-1]
rsetattr(self.cfg, path, val)
return property(getter, setter)
class ConfigModel(PresentationModel):
cfg: Config
combo_symbols = {}
combo_text = {}
master_audio = path_fix_property("master_audio")
render__bg_color = color2hex_property("render__bg_color")
render__init_line_color = color2hex_property("render__init_line_color")