added select all button and functionality

This commit is contained in:
UpstreamData
2022-05-05 13:48:57 -06:00
parent 801cfc4ff8
commit 51dae7375f
4 changed files with 49 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
from tools.cfg_util.cfg_util_qt.layout import window, TABLE_KEYS
def btn_all(table, selected):
if table in TABLE_KEYS["table"]:
if len(selected) == len(window[table].Values):
window[table].update(select_rows=())
else:
window[table].update(
select_rows=([row for row in range(len(window[table].Values))])
)
if table in TABLE_KEYS["tree"]:
if len(selected) == len(window[table].Widget.get_children()):
_tree = window[table]
_tree.Widget.selection_set([])
else:
_tree = window[table]
rows_to_select = [i for i in _tree.Widget.get_children()]
_tree.Widget.selection_set(rows_to_select)