Skip to content

Commit 4b7d57c

Browse files
bugfix: Fix issue labscript-suite#61, shuffle checkstate not preserved upon removing and adding 'outer' globals.
Also fix that the checkox is initially set to be a tristate one. It should not be settable to a partially checked state by the user.
1 parent 75c0577 commit 4b7d57c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

__main__.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -2031,13 +2031,19 @@ def update_global_shuffle_state(self, *args, **kwargs):
20312031
if not all_checked and not none_checked:
20322032
self.ui.pushButton_shuffle.setTristate(True)
20332033
self.ui.pushButton_shuffle.setCheckState(QtCore.Qt.PartiallyChecked)
2034-
elif none_checked:
2034+
elif none_checked and not all_checked:
20352035
self.ui.pushButton_shuffle.setTristate(False)
20362036
self.ui.pushButton_shuffle.setCheckState(QtCore.Qt.Unchecked)
2037-
else:
2037+
elif all_checked and not none_checked:
20382038
self.ui.pushButton_shuffle.setTristate(False)
20392039
self.ui.pushButton_shuffle.setCheckState(QtCore.Qt.Checked)
2040-
2040+
else:
2041+
# No axes. Clear if partially checked, otherwise else leave it alone:
2042+
if self.ui.pushButton_shuffle.checkState() == QtCore.Qt.PartiallyChecked:
2043+
self.ui.pushButton_shuffle.setTristate(False)
2044+
self.ui.pushButton_shuffle.setCheckState(QtCore.Qt.Unchecked)
2045+
2046+
20412047
def on_master_shuffle_clicked(self, state):
20422048
if state in [QtCore.Qt.Checked, QtCore.Qt.Unchecked]:
20432049
self.ui.pushButton_shuffle.setTristate(False)

main.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ subprocess</string>
229229
<bool>true</bool>
230230
</property>
231231
<property name="tristate">
232-
<bool>true</bool>
232+
<bool>false</bool>
233233
</property>
234234
</widget>
235235
</item>

0 commit comments

Comments
 (0)