Allow Start to restart a finished Sud from the beginning
start() only allowed a fresh run from IDLE, so once a brew reached DONE, clicking Start again (the GUI correctly re-enables it once not running) was silently a no-op. DONE now restarts the same way IDLE does.
This commit is contained in:
+4
-3
@@ -140,13 +140,14 @@ class Sud(AttributeChange):
|
||||
}
|
||||
|
||||
def start(self):
|
||||
"""Starts a fresh run from IDLE, or resumes a paused one - whichever
|
||||
applies. No-op otherwise."""
|
||||
"""Starts a fresh run from IDLE or DONE (i.e. restarts from the
|
||||
beginning once a previous run has finished), or resumes a paused
|
||||
one - whichever applies. No-op otherwise."""
|
||||
if self.state == SudState.PAUSED:
|
||||
self.state = self._paused_from
|
||||
self._paused_from = None
|
||||
return
|
||||
if self.state != SudState.IDLE:
|
||||
if self.state not in (SudState.IDLE, SudState.DONE):
|
||||
return
|
||||
self.index = -1
|
||||
self._advance()
|
||||
|
||||
Reference in New Issue
Block a user