mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
to avoid conflicts, make sure the progress dialog can't be closed
This commit is contained in:
parent
67285cd230
commit
da2d4073c9
1 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue