From e1ca15173d13b0f82d5e940134e316bde7b3d852 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Fri, 22 Sep 2017 20:50:45 -0700 Subject: [PATCH] Actually show the progress dialog when we're waiting for the thread to shut down. --- openlp.py | 3 ++- openlp/core/ui/mainwindow.py | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/openlp.py b/openlp.py index 68001f2d1..73c0d9033 100755 --- a/openlp.py +++ b/openlp.py @@ -28,9 +28,10 @@ import multiprocessing import sys from openlp.core.common import is_win, is_macosx +from openlp.core.common.applocation import AppLocation from openlp.core import main -faulthandler.enable() +faulthandler.enable(open(str(AppLocation.get_directory(AppLocation.CacheDir) / 'error.log'), 'wb')) if __name__ == '__main__': """ diff --git a/openlp/core/ui/mainwindow.py b/openlp/core/ui/mainwindow.py index ae32c0347..14b34a715 100644 --- a/openlp/core/ui/mainwindow.py +++ b/openlp/core/ui/mainwindow.py @@ -1017,7 +1017,13 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow, RegistryProperties): wait_dialog = QtWidgets.QProgressDialog('Waiting for some things to finish...', '', 0, 0, self) wait_dialog.setWindowModality(QtCore.Qt.WindowModal) wait_dialog.setAutoClose(False) - self.version_thread.wait() + wait_dialog.show() + retry = 0 + while self.version_thread.isRunning() and retry < 10: + self.application.processEvents() + self.version_thread.wait(500) + if self.version_thread.isRunning(): + self.version_thread.terminate() wait_dialog.close() except RuntimeError: # Ignore the RuntimeError that is thrown when Qt has already deleted the C++ thread object