Merge lp:~knightrider0xd/openlp/non-text-item-height-default into lp:openlp
- non-text-item-height-default
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Tim Bentley |
Approved revision: | 2674 |
Merged at revision: | 2674 |
Proposed branch: | lp:~knightrider0xd/openlp/non-text-item-height-default |
Merge into: | lp:openlp |
Diff against target: |
252 lines (+111/-19) 7 files modified
openlp/core/common/settings.py (+1/-1) openlp/core/ui/advancedtab.py (+18/-9) openlp/core/ui/lib/listpreviewwidget.py (+18/-7) tests/functional/openlp_core_common/test_registryproperties.py (+0/-1) tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py (+73/-0) tests/functional/openlp_plugins/bibles/test_lib.py (+1/-0) tests/functional/openlp_plugins/songs/test_opsproimport.py (+0/-1) |
To merge this branch: | bzr merge lp:~knightrider0xd/openlp/non-text-item-height-default |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Approve | ||
Review via email: mp+296308@code.launchpad.net |
This proposal supersedes a proposal from 2016-06-02.
Commit message
Description of the change
Adds automatic functionality to the max-height for non-text items feature, and sets this as the default value.
Advanced tab spin box replaced with combo box.
Test coverage expanded on other functions in listpreviewwidget and pep8 errors fixed.
Fixed test naming.
Merged with trunk as of 2016-06-02_10:30.
lp:~knightrider0xd/openlp/non-text-item-height-default (revision 2674)
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
[SUCCESS] https:/
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal | # |
Ian Knight (knightrider0xd) wrote : Posted in a previous version of this proposal | # |
Hey superfly.
I can't replicate this bug, and looking at that trace, it appears to be related to something in media, not my changes.
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal | # |
This code is existing and connected to CD /dvd items in media.
Did you have some media items created and then take to cd / dvd out of the machine?
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal | # |
I figured this out, it's a bug in Ken's new formatting code. I've fixed it.
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal | # |
Please just merge trunk into your branch and resubmit? Thanks.
Raoul Snyman (raoul-snyman) wrote : Posted in a previous version of this proposal | # |
Sorry, just spotted this. Your tests are incorrectly named, and won't be picked up by the test runner (especially when we move to nose2).
Raoul Snyman (raoul-snyman) : | # |
Preview Diff
1 | === modified file 'openlp/core/common/settings.py' | |||
2 | --- openlp/core/common/settings.py 2016-05-15 17:32:04 +0000 | |||
3 | +++ openlp/core/common/settings.py 2016-06-02 10:36:58 +0000 | |||
4 | @@ -129,7 +129,7 @@ | |||
5 | 129 | 'advanced/recent file count': 4, | 129 | 'advanced/recent file count': 4, |
6 | 130 | 'advanced/save current plugin': False, | 130 | 'advanced/save current plugin': False, |
7 | 131 | 'advanced/slide limits': SlideLimits.End, | 131 | 'advanced/slide limits': SlideLimits.End, |
9 | 132 | 'advanced/slide max height': 0, | 132 | 'advanced/slide max height': -4, |
10 | 133 | 'advanced/single click preview': False, | 133 | 'advanced/single click preview': False, |
11 | 134 | 'advanced/single click service preview': False, | 134 | 'advanced/single click service preview': False, |
12 | 135 | 'advanced/x11 bypass wm': X11_BYPASS_DEFAULT, | 135 | 'advanced/x11 bypass wm': X11_BYPASS_DEFAULT, |
13 | 136 | 136 | ||
14 | === modified file 'openlp/core/ui/advancedtab.py' | |||
15 | --- openlp/core/ui/advancedtab.py 2016-05-20 16:22:06 +0000 | |||
16 | +++ openlp/core/ui/advancedtab.py 2016-06-02 10:36:58 +0000 | |||
17 | @@ -87,11 +87,14 @@ | |||
18 | 87 | self.ui_layout.addRow(self.expand_service_item_check_box) | 87 | self.ui_layout.addRow(self.expand_service_item_check_box) |
19 | 88 | self.slide_max_height_label = QtWidgets.QLabel(self.ui_group_box) | 88 | self.slide_max_height_label = QtWidgets.QLabel(self.ui_group_box) |
20 | 89 | self.slide_max_height_label.setObjectName('slide_max_height_label') | 89 | self.slide_max_height_label.setObjectName('slide_max_height_label') |
26 | 90 | self.slide_max_height_spin_box = QtWidgets.QSpinBox(self.ui_group_box) | 90 | self.slide_max_height_combo_box = QtWidgets.QComboBox(self.ui_group_box) |
27 | 91 | self.slide_max_height_spin_box.setObjectName('slide_max_height_spin_box') | 91 | self.slide_max_height_combo_box.addItem('', userData=0) |
28 | 92 | self.slide_max_height_spin_box.setRange(0, 1000) | 92 | self.slide_max_height_combo_box.addItem('', userData=-4) |
29 | 93 | self.slide_max_height_spin_box.setSingleStep(20) | 93 | # Generate numeric values for combo box dynamically |
30 | 94 | self.ui_layout.addRow(self.slide_max_height_label, self.slide_max_height_spin_box) | 94 | for px in range(60, 801, 5): |
31 | 95 | self.slide_max_height_combo_box.addItem(str(px) + 'px', userData=px) | ||
32 | 96 | self.slide_max_height_combo_box.setObjectName('slide_max_height_combo_box') | ||
33 | 97 | self.ui_layout.addRow(self.slide_max_height_label, self.slide_max_height_combo_box) | ||
34 | 95 | self.autoscroll_label = QtWidgets.QLabel(self.ui_group_box) | 98 | self.autoscroll_label = QtWidgets.QLabel(self.ui_group_box) |
35 | 96 | self.autoscroll_label.setObjectName('autoscroll_label') | 99 | self.autoscroll_label.setObjectName('autoscroll_label') |
36 | 97 | self.autoscroll_combo_box = QtWidgets.QComboBox(self.ui_group_box) | 100 | self.autoscroll_combo_box = QtWidgets.QComboBox(self.ui_group_box) |
37 | @@ -265,7 +268,8 @@ | |||
38 | 265 | 'Expand new service items on creation')) | 268 | 'Expand new service items on creation')) |
39 | 266 | self.slide_max_height_label.setText(translate('OpenLP.AdvancedTab', | 269 | self.slide_max_height_label.setText(translate('OpenLP.AdvancedTab', |
40 | 267 | 'Max height for non-text slides\nin slide controller:')) | 270 | 'Max height for non-text slides\nin slide controller:')) |
42 | 268 | self.slide_max_height_spin_box.setSpecialValueText(translate('OpenLP.AdvancedTab', 'Disabled')) | 271 | self.slide_max_height_combo_box.setItemText(0, translate('OpenLP.AdvancedTab', 'Disabled')) |
43 | 272 | self.slide_max_height_combo_box.setItemText(1, translate('OpenLP.AdvancedTab', 'Automatic')) | ||
44 | 269 | self.autoscroll_label.setText(translate('OpenLP.AdvancedTab', | 273 | self.autoscroll_label.setText(translate('OpenLP.AdvancedTab', |
45 | 270 | 'When changing slides:')) | 274 | 'When changing slides:')) |
46 | 271 | self.autoscroll_combo_box.setItemText(0, translate('OpenLP.AdvancedTab', 'Do not auto-scroll')) | 275 | self.autoscroll_combo_box.setItemText(0, translate('OpenLP.AdvancedTab', 'Do not auto-scroll')) |
47 | @@ -355,10 +359,13 @@ | |||
48 | 355 | self.single_click_preview_check_box.setChecked(settings.value('single click preview')) | 359 | self.single_click_preview_check_box.setChecked(settings.value('single click preview')) |
49 | 356 | self.single_click_service_preview_check_box.setChecked(settings.value('single click service preview')) | 360 | self.single_click_service_preview_check_box.setChecked(settings.value('single click service preview')) |
50 | 357 | self.expand_service_item_check_box.setChecked(settings.value('expand service item')) | 361 | self.expand_service_item_check_box.setChecked(settings.value('expand service item')) |
52 | 358 | self.slide_max_height_spin_box.setValue(settings.value('slide max height')) | 362 | slide_max_height_value = settings.value('slide max height') |
53 | 363 | for i in range(0, self.slide_max_height_combo_box.count()): | ||
54 | 364 | if self.slide_max_height_combo_box.itemData(i) == slide_max_height_value: | ||
55 | 365 | self.slide_max_height_combo_box.setCurrentIndex(i) | ||
56 | 359 | autoscroll_value = settings.value('autoscrolling') | 366 | autoscroll_value = settings.value('autoscrolling') |
57 | 360 | for i in range(0, len(self.autoscroll_map)): | 367 | for i in range(0, len(self.autoscroll_map)): |
59 | 361 | if self.autoscroll_map[i] == autoscroll_value: | 368 | if self.autoscroll_map[i] == autoscroll_value and i < self.autoscroll_combo_box.count(): |
60 | 362 | self.autoscroll_combo_box.setCurrentIndex(i) | 369 | self.autoscroll_combo_box.setCurrentIndex(i) |
61 | 363 | self.enable_auto_close_check_box.setChecked(settings.value('enable exit confirmation')) | 370 | self.enable_auto_close_check_box.setChecked(settings.value('enable exit confirmation')) |
62 | 364 | self.hide_mouse_check_box.setChecked(settings.value('hide mouse')) | 371 | self.hide_mouse_check_box.setChecked(settings.value('hide mouse')) |
63 | @@ -439,7 +446,9 @@ | |||
64 | 439 | settings.setValue('single click preview', self.single_click_preview_check_box.isChecked()) | 446 | settings.setValue('single click preview', self.single_click_preview_check_box.isChecked()) |
65 | 440 | settings.setValue('single click service preview', self.single_click_service_preview_check_box.isChecked()) | 447 | settings.setValue('single click service preview', self.single_click_service_preview_check_box.isChecked()) |
66 | 441 | settings.setValue('expand service item', self.expand_service_item_check_box.isChecked()) | 448 | settings.setValue('expand service item', self.expand_service_item_check_box.isChecked()) |
68 | 442 | settings.setValue('slide max height', self.slide_max_height_spin_box.value()) | 449 | slide_max_height_index = self.slide_max_height_combo_box.currentIndex() |
69 | 450 | slide_max_height_value = self.slide_max_height_combo_box.itemData(slide_max_height_index) | ||
70 | 451 | settings.setValue('slide max height', slide_max_height_value) | ||
71 | 443 | settings.setValue('autoscrolling', self.autoscroll_map[self.autoscroll_combo_box.currentIndex()]) | 452 | settings.setValue('autoscrolling', self.autoscroll_map[self.autoscroll_combo_box.currentIndex()]) |
72 | 444 | settings.setValue('enable exit confirmation', self.enable_auto_close_check_box.isChecked()) | 453 | settings.setValue('enable exit confirmation', self.enable_auto_close_check_box.isChecked()) |
73 | 445 | settings.setValue('hide mouse', self.hide_mouse_check_box.isChecked()) | 454 | settings.setValue('hide mouse', self.hide_mouse_check_box.isChecked()) |
74 | 446 | 455 | ||
75 | === modified file 'openlp/core/ui/lib/listpreviewwidget.py' | |||
76 | --- openlp/core/ui/lib/listpreviewwidget.py 2016-05-05 03:57:04 +0000 | |||
77 | +++ openlp/core/ui/lib/listpreviewwidget.py 2016-06-02 10:36:58 +0000 | |||
78 | @@ -63,6 +63,7 @@ | |||
79 | 63 | # Initialize variables. | 63 | # Initialize variables. |
80 | 64 | self.service_item = ServiceItem() | 64 | self.service_item = ServiceItem() |
81 | 65 | self.screen_ratio = screen_ratio | 65 | self.screen_ratio = screen_ratio |
82 | 66 | self.auto_row_height = 100 | ||
83 | 66 | # Connect signals | 67 | # Connect signals |
84 | 67 | self.verticalHeader().sectionResized.connect(self.row_resized) | 68 | self.verticalHeader().sectionResized.connect(self.row_resized) |
85 | 68 | 69 | ||
86 | @@ -87,8 +88,14 @@ | |||
87 | 87 | height = self.viewport().width() // self.screen_ratio | 88 | height = self.viewport().width() // self.screen_ratio |
88 | 88 | max_img_row_height = Settings().value('advanced/slide max height') | 89 | max_img_row_height = Settings().value('advanced/slide max height') |
89 | 89 | # Adjust for row height cap if in use. | 90 | # Adjust for row height cap if in use. |
92 | 90 | if isinstance(max_img_row_height, int) and max_img_row_height > 0 and height > max_img_row_height: | 91 | if isinstance(max_img_row_height, int): |
93 | 91 | height = max_img_row_height | 92 | if max_img_row_height > 0 and height > max_img_row_height: |
94 | 93 | height = max_img_row_height | ||
95 | 94 | elif max_img_row_height < 0: | ||
96 | 95 | # If auto setting, show that number of slides, or if the resulting slides too small, 100px. | ||
97 | 96 | # E.g. If setting is -4, 4 slides will be visible, unless those slides are < 100px high. | ||
98 | 97 | self.auto_row_height = max(self.viewport().height() / (-1 * max_img_row_height), 100) | ||
99 | 98 | height = min(height, self.auto_row_height) | ||
100 | 92 | # Apply new height to slides | 99 | # Apply new height to slides |
101 | 93 | for frame_number in range(len(self.service_item.get_frames())): | 100 | for frame_number in range(len(self.service_item.get_frames())): |
102 | 94 | self.setRowHeight(frame_number, height) | 101 | self.setRowHeight(frame_number, height) |
103 | @@ -99,7 +106,7 @@ | |||
104 | 99 | """ | 106 | """ |
105 | 100 | # Only for non-text slides when row height cap in use | 107 | # Only for non-text slides when row height cap in use |
106 | 101 | max_img_row_height = Settings().value('advanced/slide max height') | 108 | max_img_row_height = Settings().value('advanced/slide max height') |
108 | 102 | if self.service_item.is_text() or not isinstance(max_img_row_height, int) or max_img_row_height <= 0: | 109 | if self.service_item.is_text() or not isinstance(max_img_row_height, int) or max_img_row_height == 0: |
109 | 103 | return | 110 | return |
110 | 104 | # Get and validate label widget containing slide & adjust max width | 111 | # Get and validate label widget containing slide & adjust max width |
111 | 105 | try: | 112 | try: |
112 | @@ -165,11 +172,15 @@ | |||
113 | 165 | slide_height = width // self.screen_ratio | 172 | slide_height = width // self.screen_ratio |
114 | 166 | # Setup and validate row height cap if in use. | 173 | # Setup and validate row height cap if in use. |
115 | 167 | max_img_row_height = Settings().value('advanced/slide max height') | 174 | max_img_row_height = Settings().value('advanced/slide max height') |
118 | 168 | if isinstance(max_img_row_height, int) and max_img_row_height > 0: | 175 | if isinstance(max_img_row_height, int) and max_img_row_height != 0: |
119 | 169 | if slide_height > max_img_row_height: | 176 | if max_img_row_height > 0 and slide_height > max_img_row_height: |
120 | 177 | # Manual Setting | ||
121 | 170 | slide_height = max_img_row_height | 178 | slide_height = max_img_row_height |
124 | 171 | label.setMaximumWidth(max_img_row_height * self.screen_ratio) | 179 | elif max_img_row_height < 0 and slide_height > self.auto_row_height: |
125 | 172 | label.resize(max_img_row_height * self.screen_ratio, max_img_row_height) | 180 | # Auto Setting |
126 | 181 | slide_height = self.auto_row_height | ||
127 | 182 | label.setMaximumWidth(slide_height * self.screen_ratio) | ||
128 | 183 | label.resize(slide_height * self.screen_ratio, slide_height) | ||
129 | 173 | # Build widget with stretch padding | 184 | # Build widget with stretch padding |
130 | 174 | container = QtWidgets.QWidget() | 185 | container = QtWidgets.QWidget() |
131 | 175 | hbox = QtWidgets.QHBoxLayout() | 186 | hbox = QtWidgets.QHBoxLayout() |
132 | 176 | 187 | ||
133 | === modified file 'tests/functional/openlp_core_common/test_registryproperties.py' | |||
134 | --- tests/functional/openlp_core_common/test_registryproperties.py 2016-05-31 21:40:13 +0000 | |||
135 | +++ tests/functional/openlp_core_common/test_registryproperties.py 2016-06-02 10:36:58 +0000 | |||
136 | @@ -75,4 +75,3 @@ | |||
137 | 75 | 75 | ||
138 | 76 | # THEN the application should be none | 76 | # THEN the application should be none |
139 | 77 | self.assertEqual(self.application, application, 'The application value should match') | 77 | self.assertEqual(self.application, application, 'The application value should match') |
140 | 78 | |||
141 | 79 | 78 | ||
142 | === modified file 'tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py' | |||
143 | --- tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py 2016-06-01 21:42:54 +0000 | |||
144 | +++ tests/functional/openlp_core_ui_lib/test_listpreviewwidget.py 2016-06-02 10:36:58 +0000 | |||
145 | @@ -227,6 +227,44 @@ | |||
146 | 227 | 227 | ||
147 | 228 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') | 228 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') |
148 | 229 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') | 229 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') |
149 | 230 | def test_replace_recalculate_layout_img_auto(self, mocked_setRowHeight, mocked_resizeRowsToContents): | ||
150 | 231 | """ | ||
151 | 232 | Test if "Max height for non-text slides..." auto, img slides resized in replace_service_item & __recalc... | ||
152 | 233 | """ | ||
153 | 234 | # GIVEN: A setting to adjust "Max height for non-text slides in slide controller", | ||
154 | 235 | # an image ServiceItem and a ListPreviewWidget. | ||
155 | 236 | |||
156 | 237 | # Mock Settings().value('advanced/slide max height') | ||
157 | 238 | self.mocked_Settings_obj.value.return_value = -4 | ||
158 | 239 | # Mock self.viewport().width() | ||
159 | 240 | self.mocked_viewport_obj.width.return_value = 200 | ||
160 | 241 | self.mocked_viewport_obj.height.return_value = 600 | ||
161 | 242 | # Mock image service item | ||
162 | 243 | service_item = MagicMock() | ||
163 | 244 | service_item.is_text.return_value = False | ||
164 | 245 | service_item.is_capable.return_value = False | ||
165 | 246 | service_item.get_frames.return_value = [{'title': None, 'path': None, 'image': None}, | ||
166 | 247 | {'title': None, 'path': None, 'image': None}] | ||
167 | 248 | # init ListPreviewWidget and load service item | ||
168 | 249 | list_preview_widget = ListPreviewWidget(None, 1) | ||
169 | 250 | list_preview_widget.replace_service_item(service_item, 200, 0) | ||
170 | 251 | # Change viewport width before forcing a resize | ||
171 | 252 | self.mocked_viewport_obj.width.return_value = 400 | ||
172 | 253 | |||
173 | 254 | # WHEN: __recalculate_layout() is called (via screen_size_changed) | ||
174 | 255 | list_preview_widget.screen_size_changed(1) | ||
175 | 256 | self.mocked_viewport_obj.height.return_value = 200 | ||
176 | 257 | list_preview_widget.screen_size_changed(1) | ||
177 | 258 | |||
178 | 259 | # THEN: resizeRowsToContents() should not be called, while setRowHeight() should be called | ||
179 | 260 | # twice for each slide. | ||
180 | 261 | self.assertEquals(mocked_resizeRowsToContents.call_count, 0, 'Should not be called') | ||
181 | 262 | self.assertEquals(mocked_setRowHeight.call_count, 6, 'Should be called 3 times for each slide') | ||
182 | 263 | calls = [call(0, 100), call(1, 100), call(0, 150), call(1, 150), call(0, 100), call(1, 100)] | ||
183 | 264 | mocked_setRowHeight.assert_has_calls(calls) | ||
184 | 265 | |||
185 | 266 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') | ||
186 | 267 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') | ||
187 | 230 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') | 268 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') |
188 | 231 | def test_row_resized_text(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): | 269 | def test_row_resized_text(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): |
189 | 232 | """ | 270 | """ |
190 | @@ -331,6 +369,41 @@ | |||
191 | 331 | # THEN: self.cellWidget(row, 0).children()[1].setMaximumWidth() should be called | 369 | # THEN: self.cellWidget(row, 0).children()[1].setMaximumWidth() should be called |
192 | 332 | mocked_cellWidget_child.setMaximumWidth.assert_called_once_with(150) | 370 | mocked_cellWidget_child.setMaximumWidth.assert_called_once_with(150) |
193 | 333 | 371 | ||
194 | 372 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.resizeRowsToContents') | ||
195 | 373 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.setRowHeight') | ||
196 | 374 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.cellWidget') | ||
197 | 375 | def test_row_resized_setting_changed(self, mocked_cellWidget, mocked_setRowHeight, mocked_resizeRowsToContents): | ||
198 | 376 | """ | ||
199 | 377 | Test if "Max height for non-text slides..." enabled while item live, program doesn't crash on row_resized. | ||
200 | 378 | """ | ||
201 | 379 | # GIVEN: A setting to adjust "Max height for non-text slides in slide controller", | ||
202 | 380 | # an image ServiceItem and a ListPreviewWidget. | ||
203 | 381 | |||
204 | 382 | # Mock Settings().value('advanced/slide max height') | ||
205 | 383 | self.mocked_Settings_obj.value.return_value = 0 | ||
206 | 384 | # Mock self.viewport().width() | ||
207 | 385 | self.mocked_viewport_obj.width.return_value = 200 | ||
208 | 386 | # Mock image service item | ||
209 | 387 | service_item = MagicMock() | ||
210 | 388 | service_item.is_text.return_value = False | ||
211 | 389 | service_item.is_capable.return_value = False | ||
212 | 390 | service_item.get_frames.return_value = [{'title': None, 'path': None, 'image': None}, | ||
213 | 391 | {'title': None, 'path': None, 'image': None}] | ||
214 | 392 | # Mock self.cellWidget().children() | ||
215 | 393 | mocked_cellWidget_obj = MagicMock() | ||
216 | 394 | mocked_cellWidget_obj.children.return_value = None | ||
217 | 395 | mocked_cellWidget.return_value = mocked_cellWidget_obj | ||
218 | 396 | # init ListPreviewWidget and load service item | ||
219 | 397 | list_preview_widget = ListPreviewWidget(None, 1) | ||
220 | 398 | list_preview_widget.replace_service_item(service_item, 200, 0) | ||
221 | 399 | self.mocked_Settings_obj.value.return_value = 100 | ||
222 | 400 | |||
223 | 401 | # WHEN: row_resized() is called | ||
224 | 402 | list_preview_widget.row_resized(0, 100, 150) | ||
225 | 403 | |||
226 | 404 | # THEN: self.cellWidget(row, 0).children()[1].setMaximumWidth() should fail | ||
227 | 405 | self.assertRaises(Exception) | ||
228 | 406 | |||
229 | 334 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.selectRow') | 407 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.selectRow') |
230 | 335 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.scrollToItem') | 408 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.scrollToItem') |
231 | 336 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') | 409 | @patch(u'openlp.core.ui.lib.listpreviewwidget.ListPreviewWidget.item') |
232 | 337 | 410 | ||
233 | === modified file 'tests/functional/openlp_plugins/bibles/test_lib.py' | |||
234 | --- tests/functional/openlp_plugins/bibles/test_lib.py 2016-06-01 23:14:58 +0000 | |||
235 | +++ tests/functional/openlp_plugins/bibles/test_lib.py 2016-06-02 10:36:58 +0000 | |||
236 | @@ -43,6 +43,7 @@ | |||
237 | 43 | separators = {'sep_r': '\\s*(?:e)\\s*', 'sep_e_default': 'end', 'sep_v_display': 'w', 'sep_l_display': 'r', | 43 | separators = {'sep_r': '\\s*(?:e)\\s*', 'sep_e_default': 'end', 'sep_v_display': 'w', 'sep_l_display': 'r', |
238 | 44 | 'sep_v_default': ':|v|V|verse|verses', 'sep_l': '\\s*(?:r)\\s*', 'sep_l_default': ',|and', | 44 | 'sep_v_default': ':|v|V|verse|verses', 'sep_l': '\\s*(?:r)\\s*', 'sep_l_default': ',|and', |
239 | 45 | 'sep_e': '\\s*(?:t)\\s*', 'sep_v': '\\s*(?:w)\\s*', 'sep_r_display': 'e', 'sep_r_default': '-|to'} | 45 | 'sep_e': '\\s*(?:t)\\s*', 'sep_v': '\\s*(?:w)\\s*', 'sep_r_display': 'e', 'sep_r_default': '-|to'} |
240 | 46 | |||
241 | 46 | def _update_side_effect(): | 47 | def _update_side_effect(): |
242 | 47 | """ | 48 | """ |
243 | 48 | Update the references after mocking out the method | 49 | Update the references after mocking out the method |
244 | 49 | 50 | ||
245 | === modified file 'tests/functional/openlp_plugins/songs/test_opsproimport.py' | |||
246 | --- tests/functional/openlp_plugins/songs/test_opsproimport.py 2016-06-01 23:14:58 +0000 | |||
247 | +++ tests/functional/openlp_plugins/songs/test_opsproimport.py 2016-06-02 10:36:58 +0000 | |||
248 | @@ -171,4 +171,3 @@ | |||
249 | 171 | result_data = json.loads(result_file.read().decode()) | 171 | result_data = json.loads(result_file.read().decode()) |
250 | 172 | self.assertListEqual(importer.verses, _get_item(result_data, 'verses')) | 172 | self.assertListEqual(importer.verses, _get_item(result_data, 'verses')) |
251 | 173 | self.assertListEqual(importer.verse_order_list_generated, _get_item(result_data, 'verse_order_list')) | 173 | self.assertListEqual(importer.verse_order_list_generated, _get_item(result_data, 'verse_order_list')) |
252 | 174 |
Got this when I started OpenLP.
Traceback (most recent call last): raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ core/__ init__. py", line 392, in main exit(applicatio n.run(qt_ args)) raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ core/__ init__. py", line 142, in run ).execute( 'bootstrap_ initialise' ) raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ core/common/ registry. py", line 137, in execute raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ core/lib/ pluginmanager. py", line 68, in bootstrap_ initialise initialise_ plugins( ) raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ core/lib/ pluginmanager. py", line 183, in initialise_plugins initialise( ) raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ plugins/ media/mediaplug in.py", line 66, in initialise ).initialise( ) raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ core/lib/ plugin. py", line 277, in initialise media_item. initialise( ) raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ plugins/ media/lib/ mediaitem. py", line 303, in initialise load_list( Settings( ).value( self.settings_ section + '/media files')) raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ plugins/ media/lib/ mediaitem. py", line 368, in load_list name.setToolTip ('%s@%s- %s' % (file_name, format_ milliseconds( start), format_ milliseconds( end))) raoul/Projects/ OpenLP/ OpenLP/ non-text- item-height- default/ openlp/ core/ui/ media/_ _init__ .py", line 143, in format_milliseconds
File "./openlp.py", line 44, in <module>
main()
File "/home/
sys.
File "/home/
Registry(
File "/home/
result = function(*args, **kwargs)
File "/home/
self.
File "/home/
plugin.
File "/home/
super(
File "/home/
self.
File "/home/
self.
File "/home/
item_
File "/home/
millis=millis)
ValueError: Unknown format code 'd' for object of type 'float'