From 17d7afaba202119e5a4f567141b7cbcb2f9d3757 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Wed, 16 Sep 2015 20:54:41 -1000 Subject: [PATCH] showProgress no longer shows immediately and no longer processes events Not processing events means "Cancel" is broken, but it was already broken anyway. Processing events before the modal dialog is shown can cause edits to occur while the level is saved. (Oops.) --- src/mcedit2/util/showprogress.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mcedit2/util/showprogress.py b/src/mcedit2/util/showprogress.py index ebbbc90..a12778c 100644 --- a/src/mcedit2/util/showprogress.py +++ b/src/mcedit2/util/showprogress.py @@ -36,7 +36,7 @@ def showProgress(text, *tasks, **kwargs): dialog = QtGui.QProgressDialog(QtGui.qApp.mainWindow) dialog.setWindowTitle(text) dialog.setWindowModality(Qt.WindowModal) - dialog.show() + #dialog.show() log.info("Starting progress: %d tasks." % len(tasks)) maximum = len(tasks) * 100 for i, task in enumerate(tasks): @@ -59,7 +59,7 @@ def showProgress(text, *tasks, **kwargs): dialog.setValue(current) dialog.setMaximum(maximum) dialog.setLabelText(status) - QtGui.QApplication.processEvents() + #QtGui.QApplication.processEvents() if dialog.wasCanceled(): return False