fixed scanning to the tree for commands

This commit is contained in:
UpstreamData
2022-05-04 15:06:15 -06:00
parent 184ada417f
commit c0b21ebc23

View File

@@ -1,13 +1,13 @@
from tools.cfg_util.cfg_util_qt.layout import TABLE_KEYS, TABLE_HEADERS, window from tools.cfg_util.cfg_util_qt.layout import TABLE_KEYS, TABLE_HEADERS, window
from tools.cfg_util.cfg_util_qt.imgs import LIGHT from tools.cfg_util.cfg_util_qt.imgs import LIGHT
from PySimpleGUI import TreeData import PySimpleGUI as sg
def clear_tables(): def clear_tables():
for table in TABLE_KEYS["table"]: for table in TABLE_KEYS["table"]:
window[table].update([]) window[table].update([])
for tree in TABLE_KEYS["tree"]: for tree in TABLE_KEYS["tree"]:
window[tree].update(TreeData()) window[tree].update(sg.TreeData())
def update_tables(data: dict): def update_tables(data: dict):
@@ -28,8 +28,8 @@ def update_tables(data: dict):
window["pools_table"].update(tables["POOLS"]) window["pools_table"].update(tables["POOLS"])
window["cfg_table"].update(tables["CONFIG"]) window["cfg_table"].update(tables["CONFIG"])
tree_data = TreeData() treedata = sg.TreeData()
for item in tables["CMD"]: for idx, item in enumerate(tables["CMD"]):
tree_data.insert("", "", "", item, icon=LIGHT) treedata.insert("", idx, "", item, icon=LIGHT)
window["cmd_table"].update(tree_data) window["cmd_table"].update(treedata)