Actually show the progress dialog when we're waiting for the thread to shut down.

This commit is contained in:
Raoul Snyman 2017-09-22 20:50:45 -07:00
parent c06cd39cab
commit e1ca15173d
2 changed files with 9 additions and 2 deletions

View File

@ -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__':
"""

View File

@ -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