forked from openlp/openlp
Actually show the progress dialog when we're waiting for the thread to shut down.
This commit is contained in:
parent
c06cd39cab
commit
e1ca15173d
@ -28,9 +28,10 @@ import multiprocessing
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from openlp.core.common import is_win, is_macosx
|
from openlp.core.common import is_win, is_macosx
|
||||||
|
from openlp.core.common.applocation import AppLocation
|
||||||
from openlp.core import main
|
from openlp.core import main
|
||||||
|
|
||||||
faulthandler.enable()
|
faulthandler.enable(open(str(AppLocation.get_directory(AppLocation.CacheDir) / 'error.log'), 'wb'))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
"""
|
"""
|
||||||
|
@ -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 = QtWidgets.QProgressDialog('Waiting for some things to finish...', '', 0, 0, self)
|
||||||
wait_dialog.setWindowModality(QtCore.Qt.WindowModal)
|
wait_dialog.setWindowModality(QtCore.Qt.WindowModal)
|
||||||
wait_dialog.setAutoClose(False)
|
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()
|
wait_dialog.close()
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
# Ignore the RuntimeError that is thrown when Qt has already deleted the C++ thread object
|
# Ignore the RuntimeError that is thrown when Qt has already deleted the C++ thread object
|
||||||
|
Loading…
Reference in New Issue
Block a user