MCPcopy Create free account
hub / github.com/LabPy/lantz / on_mode_changed

Method on_mode_changed

lantz/ui/blocks/loop.py:200–219  ·  view source on GitHub ↗
(self, new_index)

Source from the content-addressed store, hash-verified

198 pbar.setPalette(self._ok_palette)
199
200 def on_mode_changed(self, new_index):
201 if new_index == StopMode.Continuous:
202 self.widget.duration.setEnabled(False)
203 self.widget.iterations.setEnabled(False)
204 elif new_index == StopMode.Duration:
205 self.widget.duration.setEnabled(True)
206 self.widget.iterations.setEnabled(True)
207 self.widget.duration.setReadOnly(False)
208 self.widget.iterations.setReadOnly(True)
209 elif new_index == StopMode.Iterations:
210 self.widget.duration.setEnabled(True)
211 self.widget.iterations.setEnabled(True)
212 self.widget.duration.setReadOnly(True)
213 self.widget.iterations.setReadOnly(False)
214 elif new_index == StopMode.IterationsTimeOut:
215 self.widget.duration.setEnabled(True)
216 self.widget.iterations.setEnabled(True)
217 self.widget.duration.setReadOnly(False)
218 self.widget.iterations.setReadOnly(False)
219 self.recalculate()
220
221 def on_loop_done(self, cancelled):
222 self.widget.start_stop.setText('Start')

Callers

nothing calls this directly

Calls 2

recalculateMethod · 0.95
setReadOnlyMethod · 0.45

Tested by

no test coverage detected