Commit 409e4b6f authored by 3Yan's avatar 3Yan
Browse files

DRL - select all button in daughter table - fix

parent 5df8dc21
......@@ -553,22 +553,26 @@ def key_pressed(event, ds, drls, drlspectrum):
def select_all_btn_up(ds, drls, drlspectrum, state=None):
logger.info('''Change of the select-all button detected''')
if state == None:
if state in (0,2):
for row in range(drls['dt'].rowCount()):
drls['dt'].cellWidget(row, 0).blockSignals(True)
drls['dt'].cellWidget(row, 0).setCheckState(state)
drls['dt'].cellWidget(row, 0).blockSignals(False)
update_drlspectrum(ds, drls, drlspectrum)
elif state == 1:
drls['checkAll'].setCheckState(2)
else:
drls['checkAll'].blockSignals(True)
btns = []
for row in range(drls['dt'].rowCount()):
btns.append(drls['dt'].cellWidget(row, 0).checkState())
if any(btns):
drls['checkAll'].setCheckState(1)
elif all(btns):
if all(btns):
drls['checkAll'].setCheckState(2)
elif any(btns):
drls['checkAll'].setCheckState(1)
else:
drls['checkAll'].setCheckState(0)
if state in (0, 2):
for row in range(drls['dt'].rowCount()):
drls['dt'].cellWidget(row, 0).blockSignals(True)
drls['dt'].cellWidget(row, 0).setCheckState(state)
drls['dt'].cellWidget(row, 0).blockSignals(False)
update_drlspectrum(ds, drls, drlspectrum)
drls['checkAll'].blockSignals(False)
def main_window(parent, ds, filename, cache):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment