diff --git a/aqt/browser.py b/aqt/browser.py index 9c8dbc418..b12dcfd77 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -296,15 +296,19 @@ class StatusDelegate(QItemDelegate): def __init__(self, browser, model): QItemDelegate.__init__(self, browser) + self.browser = browser self.model = model def paint(self, painter, option, index): + self.browser.mw.progress.blockUpdates = True try: c = self.model.getCard(index) except: # in the the middle of a reset; return nothing so this row is not # rendered until we have a chance to reset the model return + finally: + self.browser.mw.progress.blockUpdates = True col = None if c.note().hasTag("Marked"): col = COLOUR_MARKED diff --git a/aqt/progress.py b/aqt/progress.py index e9d62664a..b622cec82 100644 --- a/aqt/progress.py +++ b/aqt/progress.py @@ -18,6 +18,7 @@ class ProgressManager(object): self.mw = mw self.app = QApplication.instance() self.inDB = False + self.blockUpdates = False self._win = None self._levels = 0 @@ -49,8 +50,9 @@ Your pysqlite2 is too old. Anki will appear frozen during long operations.""" # ensure timers don't fire self.inDB = True # handle GUI events - self._maybeShow() - self.app.processEvents(QEventLoop.ExcludeUserInputEvents) + if not self.blockUpdates: + self._maybeShow() + self.app.processEvents(QEventLoop.ExcludeUserInputEvents) self.inDB = False # DB-safe timers