From da2d4073c95837141c1d62ecf41a0be1ed673a14 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 4 Dec 2011 15:34:31 +0900 Subject: [PATCH] to avoid conflicts, make sure the progress dialog can't be closed --- aqt/progress.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aqt/progress.py b/aqt/progress.py index 69ff92f94..1da9a9404 100644 --- a/aqt/progress.py +++ b/aqt/progress.py @@ -71,6 +71,10 @@ class ProgressManager(object): # Creating progress dialogs ########################################################################## + class ProgressNoCancel(QProgressDialog): + def closeEvent(self, evt): + evt.ignore() + def start(self, max=0, min=0, label=None, parent=None, immediate=False): self._levels += 1 if self._levels > 1: @@ -78,7 +82,7 @@ class ProgressManager(object): # setup window parent = parent or self.app.activeWindow() or self.mw label = label or _("Processing...") - self._win = QProgressDialog(label, "", min, max, parent) + self._win = self.ProgressNoCancel(label, "", min, max, parent) self._win.setWindowTitle("Anki") self._win.setCancelButton(None) self._win.setAutoClose(False)