Skip to content

Commit

Permalink
Merge pull request #64 from zauberzeug/automation_controls
Browse files Browse the repository at this point in the history
Disable resume button if automator is disabled
  • Loading branch information
falkoschindler authored Dec 25, 2023
2 parents 71da115 + 5309048 commit b89837c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions rosys/automation/automation_controls_.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@ def refresh() -> None:
play_button.visible = automator.is_stopped
pause_button.visible = automator.is_running
resume_button.visible = automator.is_paused
self._disable(play_button, automator.default_automation is None or not automator.enabled)
self._disable(stop_button, automator.is_stopped)
play_button.enabled = automator.default_automation is not None and automator.enabled
resume_button.enabled = automator.enabled
stop_button.enabled = not automator.is_stopped

ui.timer(config.ui_update_interval, refresh)

def _disable(self, button: ui.button, should_disable: bool) -> None:
if should_disable:
button.props('disable')
else:
button.props(remove='disable')

0 comments on commit b89837c

Please sign in to comment.