updates to coretk to fix displaying boolean configs properly and updating config values for config services when changing mode
This commit is contained in:
parent
6f2a840710
commit
93ad6b588a
1 changed files with 7 additions and 1 deletions
|
@ -99,7 +99,7 @@ class ConfigFrame(ttk.Notebook):
|
||||||
label.grid(row=index, pady=PADY, padx=PADX, sticky="w")
|
label.grid(row=index, pady=PADY, padx=PADX, sticky="w")
|
||||||
value = tk.StringVar()
|
value = tk.StringVar()
|
||||||
if option.type == core_pb2.ConfigOptionType.BOOL:
|
if option.type == core_pb2.ConfigOptionType.BOOL:
|
||||||
select = tuple(option.select)
|
select = ("On", "Off")
|
||||||
combobox = ttk.Combobox(
|
combobox = ttk.Combobox(
|
||||||
tab.frame, textvariable=value, values=select, state="readonly"
|
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:
|
def set_values(self, config: Dict[str, str]) -> None:
|
||||||
for name, data in config.items():
|
for name, data in config.items():
|
||||||
|
option = self.config[name]
|
||||||
value = self.values[name]
|
value = self.values[name]
|
||||||
|
if option.type == core_pb2.ConfigOptionType.BOOL:
|
||||||
|
if data == "1":
|
||||||
|
data = "On"
|
||||||
|
else:
|
||||||
|
data = "Off"
|
||||||
value.set(data)
|
value.set(data)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue