gui: stop scrape-all dialog from reappearing after cancel

Cancelling the store scrape now closes the dialog and drops its reference
immediately, so queued progress signals can't re-show it (QProgressDialog
re-shows on setValue while a value is pending). _scraping stays true until
the worker finishes to prevent a second concurrent scrape.
This commit is contained in:
2026-09-07 21:41:53 -04:00
parent 3032f04b72
commit 4e0218a562
+14 -1
View File
@@ -2320,7 +2320,7 @@ class StorePage(QWidget):
thread.started.connect(worker.run)
worker.progress.connect(self._on_scrape_progress)
worker.finished.connect(thread.quit)
dlg.canceled.connect(worker.cancel)
dlg.canceled.connect(self._on_scrape_cancelled)
worker.finished.connect(self._on_scrape_done)
self._scrape_thread = thread
self._scrape_worker = worker
@@ -2328,6 +2328,19 @@ class StorePage(QWidget):
self._workers.append(worker)
thread.start()
def _on_scrape_cancelled(self):
worker = self._scrape_worker
if worker is not None:
worker.cancel()
dlg = self._scrape_dialog
if dlg is not None:
dlg.close()
# Drop the dialog reference so queued progress signals can't re-show it
# (QProgressDialog re-appears on setValue while a value is pending).
# Keep _scraping True until the worker actually finishes (_on_scrape_done)
# so a re-click doesn't spawn a second scrape while this one winds down.
self._scrape_dialog = None
def _on_scrape_progress(self, done, total):
dlg = self._scrape_dialog
if dlg is not None: