Merge lp:~raoul-snyman/openlp/bug-1314469 into lp:openlp
- bug-1314469
- Merge into trunk
Proposed by
Raoul Snyman
Status: | Merged |
---|---|
Approved by: | Tim Bentley |
Approved revision: | 2460 |
Merged at revision: | 2472 |
Proposed branch: | lp:~raoul-snyman/openlp/bug-1314469 |
Merge into: | lp:openlp |
Diff against target: |
407 lines (+117/-47) 14 files modified
openlp/core/ui/maindisplay.py (+24/-7) tests/functional/openlp_core_ui/test_maindisplay.py (+54/-19) tests/functional/openlp_core_ui/test_mainwindow.py (+3/-2) tests/functional/openlp_core_ui/test_themeform.py (+1/-1) tests/interfaces/openlp_core_common/test_historycombobox.py (+8/-1) tests/interfaces/openlp_core_lib/test_pluginmanager.py (+10/-10) tests/interfaces/openlp_core_lib/test_searchedit.py (+5/-0) tests/interfaces/openlp_core_ui/__init__.py (+6/-3) tests/interfaces/openlp_core_ui/test_projectormanager.py (+1/-1) tests/interfaces/openlp_core_ui/test_thememanager.py (+1/-1) tests/interfaces/openlp_plugins/bibles/test_lib_manager.py (+1/-0) tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py (+1/-0) tests/interfaces/openlp_plugins/custom/forms/test_customform.py (+1/-1) tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py (+1/-1) |
To merge this branch: | bzr merge lp:~raoul-snyman/openlp/bug-1314469 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Bentley | Approve | ||
Review via email:
|
This proposal supersedes a proposal from 2015-01-11.
Commit message
Description of the change
[bug 1314469] Fix the border seen in the main display on KDE by not overwriting that bit of the stylesheet
Add this to your merge proposal:
-------
lp:~raoul-snyman/openlp/bug-1314469 (revision 2460)
[SUCCESS] http://
[SUCCESS] http://
[SUCCESS] http://
[FAILURE] http://
Stopping after failure
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
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/ui/maindisplay.py' | |||
2 | --- openlp/core/ui/maindisplay.py 2014-12-31 10:58:13 +0000 | |||
3 | +++ openlp/core/ui/maindisplay.py 2015-01-11 15:24:19 +0000 | |||
4 | @@ -38,20 +38,37 @@ | |||
5 | 38 | 38 | ||
6 | 39 | import cgi | 39 | import cgi |
7 | 40 | import logging | 40 | import logging |
8 | 41 | import sys | ||
9 | 42 | 41 | ||
10 | 43 | from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL | 42 | from PyQt4 import QtCore, QtGui, QtWebKit, QtOpenGL |
11 | 44 | from PyQt4.phonon import Phonon | 43 | from PyQt4.phonon import Phonon |
12 | 45 | 44 | ||
13 | 46 | from openlp.core.common import Registry, RegistryProperties, OpenLPMixin, Settings, translate, is_macosx | 45 | from openlp.core.common import Registry, RegistryProperties, OpenLPMixin, Settings, translate, is_macosx |
15 | 47 | from openlp.core.lib import ServiceItem, ImageSource, build_html, expand_tags, image_to_byte | 46 | from openlp.core.lib import ServiceItem, ImageSource, ScreenList, build_html, expand_tags, image_to_byte |
16 | 48 | from openlp.core.lib.theme import BackgroundType | 47 | from openlp.core.lib.theme import BackgroundType |
17 | 49 | |||
18 | 50 | from openlp.core.lib import ScreenList | ||
19 | 51 | from openlp.core.ui import HideMode, AlertLocation | 48 | from openlp.core.ui import HideMode, AlertLocation |
20 | 52 | 49 | ||
21 | 53 | log = logging.getLogger(__name__) | 50 | log = logging.getLogger(__name__) |
22 | 54 | 51 | ||
23 | 52 | OPAQUE_STYLESHEET = """ | ||
24 | 53 | QWidget { | ||
25 | 54 | border: 0px; | ||
26 | 55 | margin: 0px; | ||
27 | 56 | padding: 0px; | ||
28 | 57 | } | ||
29 | 58 | QGraphicsView {} | ||
30 | 59 | """ | ||
31 | 60 | TRANSPARENT_STYLESHEET = """ | ||
32 | 61 | QWidget { | ||
33 | 62 | border: 0px; | ||
34 | 63 | margin: 0px; | ||
35 | 64 | padding: 0px; | ||
36 | 65 | } | ||
37 | 66 | QGraphicsView { | ||
38 | 67 | background: transparent; | ||
39 | 68 | border: 0px; | ||
40 | 69 | } | ||
41 | 70 | """ | ||
42 | 71 | |||
43 | 55 | 72 | ||
44 | 56 | class Display(QtGui.QGraphicsView): | 73 | class Display(QtGui.QGraphicsView): |
45 | 57 | """ | 74 | """ |
46 | @@ -135,7 +152,7 @@ | |||
47 | 135 | self.audio_player = None | 152 | self.audio_player = None |
48 | 136 | self.first_time = True | 153 | self.first_time = True |
49 | 137 | self.web_loaded = True | 154 | self.web_loaded = True |
51 | 138 | self.setStyleSheet('border: 0px; margin: 0px; padding: 0px;') | 155 | self.setStyleSheet(OPAQUE_STYLESHEET) |
52 | 139 | window_flags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | QtCore.Qt.WindowStaysOnTopHint | 156 | window_flags = QtCore.Qt.FramelessWindowHint | QtCore.Qt.Tool | QtCore.Qt.WindowStaysOnTopHint |
53 | 140 | if Settings().value('advanced/x11 bypass wm'): | 157 | if Settings().value('advanced/x11 bypass wm'): |
54 | 141 | window_flags |= QtCore.Qt.X11BypassWindowManagerHint | 158 | window_flags |= QtCore.Qt.X11BypassWindowManagerHint |
55 | @@ -175,10 +192,10 @@ | |||
56 | 175 | """ | 192 | """ |
57 | 176 | if enabled: | 193 | if enabled: |
58 | 177 | self.setAutoFillBackground(False) | 194 | self.setAutoFillBackground(False) |
60 | 178 | self.setStyleSheet("QGraphicsView {background: transparent; border: 0px;}") | 195 | self.setStyleSheet(TRANSPARENT_STYLESHEET) |
61 | 179 | else: | 196 | else: |
62 | 180 | self.setAttribute(QtCore.Qt.WA_NoSystemBackground, False) | 197 | self.setAttribute(QtCore.Qt.WA_NoSystemBackground, False) |
64 | 181 | self.setStyleSheet("QGraphicsView {}") | 198 | self.setStyleSheet(OPAQUE_STYLESHEET) |
65 | 182 | self.setAttribute(QtCore.Qt.WA_TranslucentBackground, enabled) | 199 | self.setAttribute(QtCore.Qt.WA_TranslucentBackground, enabled) |
66 | 183 | self.repaint() | 200 | self.repaint() |
67 | 184 | 201 | ||
68 | 185 | 202 | ||
69 | === modified file 'tests/functional/openlp_core_ui/test_maindisplay.py' | |||
70 | --- tests/functional/openlp_core_ui/test_maindisplay.py 2014-12-31 10:58:13 +0000 | |||
71 | +++ tests/functional/openlp_core_ui/test_maindisplay.py 2015-01-11 15:24:19 +0000 | |||
72 | @@ -36,8 +36,10 @@ | |||
73 | 36 | from openlp.core.common import Registry | 36 | from openlp.core.common import Registry |
74 | 37 | from openlp.core.lib import ScreenList | 37 | from openlp.core.lib import ScreenList |
75 | 38 | from openlp.core.ui import MainDisplay | 38 | from openlp.core.ui import MainDisplay |
76 | 39 | from openlp.core.ui.maindisplay import TRANSPARENT_STYLESHEET, OPAQUE_STYLESHEET | ||
77 | 39 | 40 | ||
79 | 40 | from tests.interfaces import MagicMock, patch | 41 | from tests.helpers.testmixin import TestMixin |
80 | 42 | from tests.interfaces import MagicMock | ||
81 | 41 | 43 | ||
82 | 42 | SCREEN = { | 44 | SCREEN = { |
83 | 43 | 'primary': False, | 45 | 'primary': False, |
84 | @@ -46,7 +48,7 @@ | |||
85 | 46 | } | 48 | } |
86 | 47 | 49 | ||
87 | 48 | 50 | ||
89 | 49 | class TestMainDisplay(TestCase): | 51 | class TestMainDisplay(TestCase, TestMixin): |
90 | 50 | 52 | ||
91 | 51 | def setUp(self): | 53 | def setUp(self): |
92 | 52 | """ | 54 | """ |
93 | @@ -59,6 +61,9 @@ | |||
94 | 59 | self.desktop.screenGeometry.return_value = SCREEN['size'] | 61 | self.desktop.screenGeometry.return_value = SCREEN['size'] |
95 | 60 | self.screens = ScreenList.create(self.desktop) | 62 | self.screens = ScreenList.create(self.desktop) |
96 | 61 | Registry.create() | 63 | Registry.create() |
97 | 64 | self.registry = Registry() | ||
98 | 65 | self.setup_application() | ||
99 | 66 | Registry().register('application', self.app) | ||
100 | 62 | 67 | ||
101 | 63 | def tearDown(self): | 68 | def tearDown(self): |
102 | 64 | """ | 69 | """ |
103 | @@ -80,30 +85,60 @@ | |||
104 | 80 | # THEN: The controller should not be a live controller. | 85 | # THEN: The controller should not be a live controller. |
105 | 81 | self.assertEqual(main_display.is_live, True, 'The main display should be a live controller') | 86 | self.assertEqual(main_display.is_live, True, 'The main display should be a live controller') |
106 | 82 | 87 | ||
112 | 83 | def set_transparency_test(self): | 88 | def set_transparency_enabled_test(self): |
113 | 84 | """ | 89 | """ |
114 | 85 | Test creating an instance of the MainDisplay class | 90 | Test setting the display to be transparent |
115 | 86 | """ | 91 | """ |
116 | 87 | # GIVEN: get an instance of MainDisplay | 92 | # GIVEN: An instance of MainDisplay |
117 | 88 | display = MagicMock() | 93 | display = MagicMock() |
118 | 89 | main_display = MainDisplay(display) | 94 | main_display = MainDisplay(display) |
119 | 90 | 95 | ||
121 | 91 | # WHEN: We enable transparency | 96 | # WHEN: Transparency is enabled |
122 | 92 | main_display.set_transparency(True) | 97 | main_display.set_transparency(True) |
123 | 93 | 98 | ||
127 | 94 | # THEN: There should be a Stylesheet | 99 | # THEN: The transparent stylesheet should be used |
128 | 95 | self.assertEqual('QGraphicsView {background: transparent; border: 0px;}', main_display.styleSheet(), | 100 | self.assertEqual(TRANSPARENT_STYLESHEET, main_display.styleSheet(), |
129 | 96 | 'MainDisplay instance should be transparent') | 101 | 'The MainDisplay should use the transparent stylesheet') |
130 | 97 | self.assertFalse(main_display.autoFillBackground(), | 102 | self.assertFalse(main_display.autoFillBackground(), |
132 | 98 | 'MainDisplay instance should be without background auto fill') | 103 | 'The MainDisplay should not have autoFillBackground set') |
133 | 99 | self.assertTrue(main_display.testAttribute(QtCore.Qt.WA_TranslucentBackground), | 104 | self.assertTrue(main_display.testAttribute(QtCore.Qt.WA_TranslucentBackground), |
137 | 100 | 'MainDisplay hasnt translucent background') | 105 | 'The MainDisplay should have a translucent background') |
138 | 101 | 106 | ||
139 | 102 | # WHEN: We disable transparency | 107 | def set_transparency_disabled_test(self): |
140 | 108 | """ | ||
141 | 109 | Test setting the display to be opaque | ||
142 | 110 | """ | ||
143 | 111 | # GIVEN: An instance of MainDisplay | ||
144 | 112 | display = MagicMock() | ||
145 | 113 | main_display = MainDisplay(display) | ||
146 | 114 | |||
147 | 115 | # WHEN: Transparency is disabled | ||
148 | 103 | main_display.set_transparency(False) | 116 | main_display.set_transparency(False) |
149 | 104 | 117 | ||
153 | 105 | # THEN: The Stylesheet should be empty | 118 | # THEN: The opaque stylesheet should be used |
154 | 106 | self.assertEqual('QGraphicsView {}', main_display.styleSheet(), | 119 | self.assertEqual(OPAQUE_STYLESHEET, main_display.styleSheet(), |
155 | 107 | 'MainDisplay instance should not be transparent') | 120 | 'The MainDisplay should use the opaque stylesheet') |
156 | 108 | self.assertFalse(main_display.testAttribute(QtCore.Qt.WA_TranslucentBackground), | 121 | self.assertFalse(main_display.testAttribute(QtCore.Qt.WA_TranslucentBackground), |
158 | 109 | 'MainDisplay hasnt translucent background') | 122 | 'The MainDisplay should not have a translucent background') |
159 | 123 | |||
160 | 124 | def css_changed_test(self): | ||
161 | 125 | """ | ||
162 | 126 | Test that when the CSS changes, the plugins are looped over and given an opportunity to update the CSS | ||
163 | 127 | """ | ||
164 | 128 | # GIVEN: A mocked list of plugins, a mocked display and a MainDisplay | ||
165 | 129 | mocked_songs_plugin = MagicMock() | ||
166 | 130 | mocked_bibles_plugin = MagicMock() | ||
167 | 131 | mocked_plugin_manager = MagicMock() | ||
168 | 132 | mocked_plugin_manager.plugins = [mocked_songs_plugin, mocked_bibles_plugin] | ||
169 | 133 | Registry().register('plugin_manager', mocked_plugin_manager) | ||
170 | 134 | display = MagicMock() | ||
171 | 135 | main_display = MainDisplay(display) | ||
172 | 136 | # This is set up dynamically, so we need to mock it out for now | ||
173 | 137 | main_display.frame = MagicMock() | ||
174 | 138 | |||
175 | 139 | # WHEN: The css_changed() method is triggered | ||
176 | 140 | main_display.css_changed() | ||
177 | 141 | |||
178 | 142 | # THEN: The plugins should have each been given an opportunity to add their bit to the CSS | ||
179 | 143 | mocked_songs_plugin.refresh_css.assert_called_with(main_display.frame) | ||
180 | 144 | mocked_bibles_plugin.refresh_css.assert_called_with(main_display.frame) | ||
181 | 110 | 145 | ||
182 | === modified file 'tests/functional/openlp_core_ui/test_mainwindow.py' | |||
183 | --- tests/functional/openlp_core_ui/test_mainwindow.py 2014-12-31 10:58:13 +0000 | |||
184 | +++ tests/functional/openlp_core_ui/test_mainwindow.py 2015-01-11 15:24:19 +0000 | |||
185 | @@ -36,9 +36,10 @@ | |||
186 | 36 | from openlp.core.ui.mainwindow import MainWindow | 36 | from openlp.core.ui.mainwindow import MainWindow |
187 | 37 | from openlp.core.lib.ui import UiStrings | 37 | from openlp.core.lib.ui import UiStrings |
188 | 38 | from openlp.core.common.registry import Registry | 38 | from openlp.core.common.registry import Registry |
189 | 39 | |||
190 | 40 | from tests.functional import MagicMock, patch | ||
191 | 41 | from tests.helpers.testmixin import TestMixin | ||
192 | 39 | from tests.utils.constants import TEST_RESOURCES_PATH | 42 | from tests.utils.constants import TEST_RESOURCES_PATH |
193 | 40 | from tests.helpers.testmixin import TestMixin | ||
194 | 41 | from tests.functional import MagicMock, patch | ||
195 | 42 | 43 | ||
196 | 43 | 44 | ||
197 | 44 | class TestMainWindow(TestCase, TestMixin): | 45 | class TestMainWindow(TestCase, TestMixin): |
198 | 45 | 46 | ||
199 | === modified file 'tests/functional/openlp_core_ui/test_themeform.py' | |||
200 | --- tests/functional/openlp_core_ui/test_themeform.py 2015-01-09 19:51:39 +0000 | |||
201 | +++ tests/functional/openlp_core_ui/test_themeform.py 2015-01-11 15:24:19 +0000 | |||
202 | @@ -34,7 +34,7 @@ | |||
203 | 34 | 34 | ||
204 | 35 | from openlp.core.ui import ThemeForm | 35 | from openlp.core.ui import ThemeForm |
205 | 36 | 36 | ||
207 | 37 | from tests.interfaces import MagicMock, patch | 37 | from tests.functional import MagicMock, patch |
208 | 38 | 38 | ||
209 | 39 | 39 | ||
210 | 40 | class TestThemeManager(TestCase): | 40 | class TestThemeManager(TestCase): |
211 | 41 | 41 | ||
212 | === modified file 'tests/interfaces/openlp_core_common/test_historycombobox.py' | |||
213 | --- tests/interfaces/openlp_core_common/test_historycombobox.py 2014-12-31 10:58:13 +0000 | |||
214 | +++ tests/interfaces/openlp_core_common/test_historycombobox.py 2015-01-11 15:24:19 +0000 | |||
215 | @@ -42,6 +42,9 @@ | |||
216 | 42 | 42 | ||
217 | 43 | class TestHistoryComboBox(TestCase, TestMixin): | 43 | class TestHistoryComboBox(TestCase, TestMixin): |
218 | 44 | def setUp(self): | 44 | def setUp(self): |
219 | 45 | """ | ||
220 | 46 | Some pre-test setup required. | ||
221 | 47 | """ | ||
222 | 45 | Registry.create() | 48 | Registry.create() |
223 | 46 | self.setup_application() | 49 | self.setup_application() |
224 | 47 | self.main_window = QtGui.QMainWindow() | 50 | self.main_window = QtGui.QMainWindow() |
225 | @@ -49,9 +52,13 @@ | |||
226 | 49 | self.combo = HistoryComboBox(self.main_window) | 52 | self.combo = HistoryComboBox(self.main_window) |
227 | 50 | 53 | ||
228 | 51 | def tearDown(self): | 54 | def tearDown(self): |
229 | 55 | """ | ||
230 | 56 | Delete all the C++ objects at the end so that we don't have a segfault | ||
231 | 57 | """ | ||
232 | 52 | del self.combo | 58 | del self.combo |
233 | 59 | del self.main_window | ||
234 | 53 | 60 | ||
236 | 54 | def getItems_test(self): | 61 | def get_items_test(self): |
237 | 55 | """ | 62 | """ |
238 | 56 | Test the getItems() method | 63 | Test the getItems() method |
239 | 57 | """ | 64 | """ |
240 | 58 | 65 | ||
241 | === modified file 'tests/interfaces/openlp_core_lib/test_pluginmanager.py' | |||
242 | --- tests/interfaces/openlp_core_lib/test_pluginmanager.py 2014-12-31 10:58:13 +0000 | |||
243 | +++ tests/interfaces/openlp_core_lib/test_pluginmanager.py 2015-01-11 15:24:19 +0000 | |||
244 | @@ -63,9 +63,9 @@ | |||
245 | 63 | Registry().register('main_window', self.main_window) | 63 | Registry().register('main_window', self.main_window) |
246 | 64 | 64 | ||
247 | 65 | def tearDown(self): | 65 | def tearDown(self): |
248 | 66 | del self.main_window | ||
249 | 67 | Settings().remove('advanced/data path') | 66 | Settings().remove('advanced/data path') |
250 | 68 | self.destroy_settings() | 67 | self.destroy_settings() |
251 | 68 | del self.main_window | ||
252 | 69 | # On windows we need to manually garbage collect to close sqlalchemy files | 69 | # On windows we need to manually garbage collect to close sqlalchemy files |
253 | 70 | # to avoid errors when temporary files are deleted. | 70 | # to avoid errors when temporary files are deleted. |
254 | 71 | gc.collect() | 71 | gc.collect() |
255 | @@ -86,12 +86,12 @@ | |||
256 | 86 | 86 | ||
257 | 87 | # THEN: We should find the "Songs", "Bibles", etc in the plugins list | 87 | # THEN: We should find the "Songs", "Bibles", etc in the plugins list |
258 | 88 | plugin_names = [plugin.name for plugin in plugin_manager.plugins] | 88 | plugin_names = [plugin.name for plugin in plugin_manager.plugins] |
268 | 89 | assert 'songs' in plugin_names, 'There should be a "songs" plugin.' | 89 | self.assertIn('songs', plugin_names, 'There should be a "songs" plugin') |
269 | 90 | assert 'bibles' in plugin_names, 'There should be a "bibles" plugin.' | 90 | self.assertIn('bibles', plugin_names, 'There should be a "bibles" plugin') |
270 | 91 | assert 'presentations' in plugin_names, 'There should be a "presentations" plugin.' | 91 | self.assertIn('presentations', plugin_names, 'There should be a "presentations" plugin') |
271 | 92 | assert 'images' in plugin_names, 'There should be a "images" plugin.' | 92 | self.assertIn('images', plugin_names, 'There should be a "images" plugin') |
272 | 93 | assert 'media' in plugin_names, 'There should be a "media" plugin.' | 93 | self.assertIn('media', plugin_names, 'There should be a "media" plugin') |
273 | 94 | assert 'custom' in plugin_names, 'There should be a "custom" plugin.' | 94 | self.assertIn('custom', plugin_names, 'There should be a "custom" plugin') |
274 | 95 | assert 'songusage' in plugin_names, 'There should be a "songusage" plugin.' | 95 | self.assertIn('songusage', plugin_names, 'There should be a "songusage" plugin') |
275 | 96 | assert 'alerts' in plugin_names, 'There should be a "alerts" plugin.' | 96 | self.assertIn('alerts', plugin_names, 'There should be a "alerts" plugin') |
276 | 97 | assert 'remotes' in plugin_names, 'There should be a "remotes" plugin.' | 97 | self.assertIn('remotes', plugin_names, 'There should be a "remotes" plugin') |
277 | 98 | 98 | ||
278 | === modified file 'tests/interfaces/openlp_core_lib/test_searchedit.py' | |||
279 | --- tests/interfaces/openlp_core_lib/test_searchedit.py 2014-12-31 10:58:13 +0000 | |||
280 | +++ tests/interfaces/openlp_core_lib/test_searchedit.py 2015-01-11 15:24:19 +0000 | |||
281 | @@ -35,10 +35,14 @@ | |||
282 | 35 | 35 | ||
283 | 36 | from openlp.core.common import Registry | 36 | from openlp.core.common import Registry |
284 | 37 | from openlp.core.lib.searchedit import SearchEdit | 37 | from openlp.core.lib.searchedit import SearchEdit |
285 | 38 | |||
286 | 38 | from tests.helpers.testmixin import TestMixin | 39 | from tests.helpers.testmixin import TestMixin |
287 | 39 | 40 | ||
288 | 40 | 41 | ||
289 | 41 | class SearchTypes(object): | 42 | class SearchTypes(object): |
290 | 43 | """ | ||
291 | 44 | Types of search | ||
292 | 45 | """ | ||
293 | 42 | First = 0 | 46 | First = 0 |
294 | 43 | Second = 1 | 47 | Second = 1 |
295 | 44 | 48 | ||
296 | @@ -69,6 +73,7 @@ | |||
297 | 69 | """ | 73 | """ |
298 | 70 | Delete all the C++ objects at the end so that we don't have a segfault | 74 | Delete all the C++ objects at the end so that we don't have a segfault |
299 | 71 | """ | 75 | """ |
300 | 76 | del self.search_edit | ||
301 | 72 | del self.main_window | 77 | del self.main_window |
302 | 73 | 78 | ||
303 | 74 | def set_search_types_test(self): | 79 | def set_search_types_test(self): |
304 | 75 | 80 | ||
305 | === modified file 'tests/interfaces/openlp_core_ui/__init__.py' | |||
306 | --- tests/interfaces/openlp_core_ui/__init__.py 2014-12-31 10:58:13 +0000 | |||
307 | +++ tests/interfaces/openlp_core_ui/__init__.py 2015-01-11 15:24:19 +0000 | |||
308 | @@ -31,14 +31,17 @@ | |||
309 | 31 | """ | 31 | """ |
310 | 32 | 32 | ||
311 | 33 | import os | 33 | import os |
312 | 34 | |||
313 | 35 | from openlp.core.common import is_win | ||
314 | 36 | |||
315 | 34 | from tests.interfaces import patch | 37 | from tests.interfaces import patch |
316 | 35 | |||
317 | 36 | from openlp.core.common import is_win | ||
318 | 37 | |||
319 | 38 | from .test_projectormanager import tmpfile | 38 | from .test_projectormanager import tmpfile |
320 | 39 | 39 | ||
321 | 40 | 40 | ||
322 | 41 | def setUp(): | 41 | def setUp(): |
323 | 42 | """ | ||
324 | 43 | Set up this module of tests | ||
325 | 44 | """ | ||
326 | 42 | if not is_win(): | 45 | if not is_win(): |
327 | 43 | # Wine creates a sharing violation during tests. Ignore. | 46 | # Wine creates a sharing violation during tests. Ignore. |
328 | 44 | try: | 47 | try: |
329 | 45 | 48 | ||
330 | === modified file 'tests/interfaces/openlp_core_ui/test_projectormanager.py' | |||
331 | --- tests/interfaces/openlp_core_ui/test_projectormanager.py 2014-12-31 10:58:13 +0000 | |||
332 | +++ tests/interfaces/openlp_core_ui/test_projectormanager.py 2015-01-11 15:24:19 +0000 | |||
333 | @@ -70,8 +70,8 @@ | |||
334 | 70 | Delete all the C++ objects at the end so that we don't have a segfault. | 70 | Delete all the C++ objects at the end so that we don't have a segfault. |
335 | 71 | """ | 71 | """ |
336 | 72 | self.projectordb.session.close() | 72 | self.projectordb.session.close() |
337 | 73 | self.destroy_settings() | ||
338 | 73 | del self.projector_manager | 74 | del self.projector_manager |
339 | 74 | self.destroy_settings() | ||
340 | 75 | 75 | ||
341 | 76 | def bootstrap_initialise_test(self): | 76 | def bootstrap_initialise_test(self): |
342 | 77 | """ | 77 | """ |
343 | 78 | 78 | ||
344 | === modified file 'tests/interfaces/openlp_core_ui/test_thememanager.py' | |||
345 | --- tests/interfaces/openlp_core_ui/test_thememanager.py 2014-12-31 10:58:13 +0000 | |||
346 | +++ tests/interfaces/openlp_core_ui/test_thememanager.py 2015-01-11 15:24:19 +0000 | |||
347 | @@ -54,8 +54,8 @@ | |||
348 | 54 | """ | 54 | """ |
349 | 55 | Delete all the C++ objects at the end so that we don't have a segfault | 55 | Delete all the C++ objects at the end so that we don't have a segfault |
350 | 56 | """ | 56 | """ |
351 | 57 | |||
352 | 58 | self.destroy_settings() | 57 | self.destroy_settings() |
353 | 58 | del self.theme_manager | ||
354 | 59 | 59 | ||
355 | 60 | def initialise_test(self): | 60 | def initialise_test(self): |
356 | 61 | """ | 61 | """ |
357 | 62 | 62 | ||
358 | === modified file 'tests/interfaces/openlp_plugins/bibles/test_lib_manager.py' | |||
359 | --- tests/interfaces/openlp_plugins/bibles/test_lib_manager.py 2014-12-31 10:58:13 +0000 | |||
360 | +++ tests/interfaces/openlp_plugins/bibles/test_lib_manager.py 2015-01-11 15:24:19 +0000 | |||
361 | @@ -73,6 +73,7 @@ | |||
362 | 73 | """ | 73 | """ |
363 | 74 | Delete all the C++ objects at the end so that we don't have a segfault | 74 | Delete all the C++ objects at the end so that we don't have a segfault |
364 | 75 | """ | 75 | """ |
365 | 76 | del self.manager | ||
366 | 76 | self.destroy_settings() | 77 | self.destroy_settings() |
367 | 77 | 78 | ||
368 | 78 | def get_books_test(self): | 79 | def get_books_test(self): |
369 | 79 | 80 | ||
370 | === modified file 'tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py' | |||
371 | --- tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py 2014-12-31 10:58:13 +0000 | |||
372 | +++ tests/interfaces/openlp_plugins/bibles/test_lib_parse_reference.py 2015-01-11 15:24:19 +0000 | |||
373 | @@ -73,6 +73,7 @@ | |||
374 | 73 | """ | 73 | """ |
375 | 74 | Delete all the C++ objects at the end so that we don't have a segfault | 74 | Delete all the C++ objects at the end so that we don't have a segfault |
376 | 75 | """ | 75 | """ |
377 | 76 | del self.manager | ||
378 | 76 | self.destroy_settings() | 77 | self.destroy_settings() |
379 | 77 | 78 | ||
380 | 78 | def parse_reference_one_test(self): | 79 | def parse_reference_one_test(self): |
381 | 79 | 80 | ||
382 | === modified file 'tests/interfaces/openlp_plugins/custom/forms/test_customform.py' | |||
383 | --- tests/interfaces/openlp_plugins/custom/forms/test_customform.py 2014-12-31 10:58:13 +0000 | |||
384 | +++ tests/interfaces/openlp_plugins/custom/forms/test_customform.py 2015-01-11 15:24:19 +0000 | |||
385 | @@ -34,7 +34,7 @@ | |||
386 | 34 | from PyQt4 import QtGui, QtTest, QtCore | 34 | from PyQt4 import QtGui, QtTest, QtCore |
387 | 35 | 35 | ||
388 | 36 | from openlp.core.common import Registry | 36 | from openlp.core.common import Registry |
390 | 37 | # Import needed due to import problems. | 37 | # TODO: FIXME: Import needed due to horrible bad imports |
391 | 38 | from openlp.plugins.custom.lib.mediaitem import CustomMediaItem | 38 | from openlp.plugins.custom.lib.mediaitem import CustomMediaItem |
392 | 39 | from openlp.plugins.custom.forms.editcustomform import EditCustomForm | 39 | from openlp.plugins.custom.forms.editcustomform import EditCustomForm |
393 | 40 | from tests.interfaces import MagicMock, patch | 40 | from tests.interfaces import MagicMock, patch |
394 | 41 | 41 | ||
395 | === modified file 'tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py' | |||
396 | --- tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py 2014-12-31 10:58:13 +0000 | |||
397 | +++ tests/interfaces/openlp_plugins/media/forms/test_mediaclipselectorform.py 2015-01-11 15:24:19 +0000 | |||
398 | @@ -76,8 +76,8 @@ | |||
399 | 76 | """ | 76 | """ |
400 | 77 | Delete all the C++ objects at the end so that we don't have a segfault | 77 | Delete all the C++ objects at the end so that we don't have a segfault |
401 | 78 | """ | 78 | """ |
402 | 79 | del self.form | ||
403 | 79 | self.vlc_patcher.stop() | 80 | self.vlc_patcher.stop() |
404 | 80 | del self.form | ||
405 | 81 | del self.main_window | 81 | del self.main_window |
406 | 82 | 82 | ||
407 | 83 | def basic_test(self): | 83 | def basic_test(self): |