mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
fixes to progress window
- make sure _shown reset to False on finish() - ignore calls to .update() after finish() called, which can happen with async signals in the sync code
This commit is contained in:
parent
9bc0e99e2c
commit
1c390218fc
1 changed files with 4 additions and 1 deletions
|
@ -134,10 +134,12 @@ class ProgressManager:
|
|||
return
|
||||
if maybeShow:
|
||||
self._maybeShow()
|
||||
if not self._shown:
|
||||
return
|
||||
elapsed = time.time() - self._lastUpdate
|
||||
if label:
|
||||
self._win.form.label.setText(label)
|
||||
if self._max and self._shown:
|
||||
if self._max:
|
||||
self._counter = value or (self._counter+1)
|
||||
self._win.form.progressBar.setValue(self._counter)
|
||||
if process and elapsed >= 0.2:
|
||||
|
@ -187,6 +189,7 @@ class ProgressManager:
|
|||
self.app.processEvents(QEventLoop.ExcludeUserInputEvents)
|
||||
self._win.cancel()
|
||||
self._win = None
|
||||
self._shown = False
|
||||
self._unsetBusy()
|
||||
|
||||
def _setBusy(self):
|
||||
|
|
Loading…
Reference in a new issue