Merge lp:~raoul-snyman/openlp/fix-wait-for-threads-error into lp:openlp

Proposed by Raoul Snyman
Status: Merged
Merged at revision: 2900
Proposed branch: lp:~raoul-snyman/openlp/fix-wait-for-threads-error
Merge into: lp:openlp
Diff against target: 42 lines (+9/-1)
2 files modified
openlp/core/display/window.py (+2/-0)
openlp/core/ui/mainwindow.py (+7/-1)
To merge this branch: bzr merge lp:~raoul-snyman/openlp/fix-wait-for-threads-error
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Review via email: mp+372669@code.launchpad.net

Commit message

Minor cosmetic fixes to remove the "<2>" from the app title in KDE:
- Name the display window "Display Window"
- Name the threads dialog "Please Wait"
- Also fix potential issue where threads remove themselves from the dictionary at shutdown and cause an error.

Description of the change

Minor cosmetic fixes to remove the "<2>" from the app title in KDE:
- Name the display window "Display Window"
- Name the threads dialog "Please Wait"
- Also fix potential issue where threads remove themselves from the dictionary at shutdown and cause an error.

To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

JavaScript tests passed!

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

Linux tests passed!

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

macOS tests passed!

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

Linting passed!

Revision history for this message
Tim Bentley (trb143) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/display/window.py'
2--- openlp/core/display/window.py 2019-06-21 22:09:36 +0000
3+++ openlp/core/display/window.py 2019-09-12 03:58:58 +0000
4@@ -29,6 +29,7 @@
5
6 from PyQt5 import QtCore, QtWebChannel, QtWidgets
7
8+from openlp.core.common.i18n import translate
9 from openlp.core.common.path import path_to_str
10 from openlp.core.common.settings import Settings
11 from openlp.core.common.registry import Registry
12@@ -113,6 +114,7 @@
13 from openlp.core.display.webengine import WebEngineView
14 self._is_initialised = False
15 self._fbo = None
16+ self.setWindowTitle(translate('OpenLP.DisplayWindow', 'Display Window'))
17 self.setWindowFlags(QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | QtCore.Qt.WindowStaysOnTopHint)
18 self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
19 self.setAutoFillBackground(True)
20
21=== modified file 'openlp/core/ui/mainwindow.py'
22--- openlp/core/ui/mainwindow.py 2019-08-25 08:20:38 +0000
23+++ openlp/core/ui/mainwindow.py 2019-09-12 03:58:58 +0000
24@@ -548,11 +548,17 @@
25 # Sometimes the threads haven't finished, let's wait for them
26 wait_dialog = QtWidgets.QProgressDialog(translate('OpenLP.MainWindow', 'Waiting for some things to finish...'),
27 '', 0, 0, self)
28+ wait_dialog.setWindowTitle(translate('OpenLP.MainWindow', 'Please Wait'))
29+ for window_flag in [QtCore.Qt.WindowContextHelpButtonHint]:
30+ wait_dialog.setWindowFlag(window_flag, False)
31 wait_dialog.setWindowModality(QtCore.Qt.WindowModal)
32 wait_dialog.setAutoClose(False)
33 wait_dialog.setCancelButton(None)
34 wait_dialog.show()
35- for thread_name in self.application.worker_threads.keys():
36+ thread_names = self.application.worker_threads.keys()
37+ for thread_name in thread_names:
38+ if thread_name not in self.application.worker_threads.keys():
39+ continue
40 self.log_debug('Waiting for thread %s' % thread_name)
41 self.application.processEvents()
42 thread = self.application.worker_threads[thread_name]['thread']