updates to coretk to fix displaying boolean configs properly and updating config values for config services when changing mode

This commit is contained in:
Blake Harnden 2020-01-24 12:51:57 -08:00
parent 6f2a840710
commit 93ad6b588a

View file

@ -99,7 +99,7 @@ class ConfigFrame(ttk.Notebook):
label.grid(row=index, pady=PADY, padx=PADX, sticky="w")
value = tk.StringVar()
if option.type == core_pb2.ConfigOptionType.BOOL:
select = tuple(option.select)
select = ("On", "Off")
combobox = ttk.Combobox(
tab.frame, textvariable=value, values=select, state="readonly"
)
@ -186,7 +186,13 @@ class ConfigFrame(ttk.Notebook):
def set_values(self, config: Dict[str, str]) -> None:
for name, data in config.items():
option = self.config[name]
value = self.values[name]
if option.type == core_pb2.ConfigOptionType.BOOL:
if data == "1":
data = "On"
else:
data = "Off"
value.set(data)