Merge lp:~sam92/openlp/2.0-backports into lp:openlp
- 2.0-backports
- Merge into trunk
Proposed by
Samuel Mehrbrodt
Status: | Merged |
---|---|
Approved by: | Raoul Snyman |
Approved revision: | 2388 |
Merged at revision: | 2376 |
Proposed branch: | lp:~sam92/openlp/2.0-backports |
Merge into: | lp:openlp |
Diff against target: |
856 lines (+187/-63) 39 files modified
.bzrignore (+1/-0) README.txt (+5/-6) openlp/core/ui/aboutdialog.py (+1/-1) openlp/core/ui/exceptiondialog.py (+2/-1) openlp/core/ui/filerenamedialog.py (+2/-1) openlp/core/ui/firsttimelanguagedialog.py (+2/-0) openlp/core/ui/firsttimewizard.py (+2/-0) openlp/core/ui/formattingtagdialog.py (+1/-0) openlp/core/ui/mainwindow.py (+1/-1) openlp/core/ui/plugindialog.py (+2/-0) openlp/core/ui/printservicedialog.py (+1/-0) openlp/core/ui/serviceitemeditdialog.py (+2/-0) openlp/core/ui/settingsdialog.py (+1/-1) openlp/core/ui/shortcutlistdialog.py (+1/-0) openlp/core/ui/starttimedialog.py (+2/-0) openlp/core/ui/themelayoutdialog.py (+2/-0) openlp/core/ui/themewizard.py (+1/-0) openlp/core/ui/wizard.py (+1/-0) openlp/plugins/alerts/forms/alertdialog.py (+1/-1) openlp/plugins/bibles/forms/booknamedialog.py (+2/-0) openlp/plugins/bibles/forms/editbibledialog.py (+1/-1) openlp/plugins/bibles/forms/languagedialog.py (+2/-0) openlp/plugins/bibles/lib/mediaitem.py (+16/-1) openlp/plugins/custom/forms/editcustomdialog.py (+1/-1) openlp/plugins/custom/forms/editcustomslidedialog.py (+2/-1) openlp/plugins/songs/forms/authorsdialog.py (+1/-1) openlp/plugins/songs/forms/editsongdialog.py (+1/-1) openlp/plugins/songs/forms/editsongform.py (+50/-0) openlp/plugins/songs/forms/editversedialog.py (+1/-0) openlp/plugins/songs/forms/mediafilesdialog.py (+1/-1) openlp/plugins/songs/forms/songbookdialog.py (+2/-1) openlp/plugins/songs/forms/songmaintenancedialog.py (+1/-0) openlp/plugins/songs/forms/topicsdialog.py (+2/-1) openlp/plugins/songs/lib/sundayplusimport.py (+8/-8) openlp/plugins/songs/lib/xml.py (+2/-2) openlp/plugins/songusage/forms/songusagedeletedialog.py (+2/-0) openlp/plugins/songusage/forms/songusagedetaildialog.py (+1/-0) tests/functional/openlp_core_lib/test_ui.py (+59/-32) tests/utils/test_bzr_tags.py (+1/-0) |
To merge this branch: | bzr merge lp:~sam92/openlp/2.0-backports |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raoul Snyman | Approve | ||
Tim Bentley | Approve | ||
Review via email: mp+218308@code.launchpad.net |
This proposal supersedes a proposal from 2014-05-03.
Commit message
Description of the change
Merge some fixes from the 2.0 branch
lp:~sam92/openlp/2.0-backports (revision 2387)
[SUCCESS] http://
[SUCCESS] http://
[SUCCESS] http://
[SUCCESS] http://
[SUCCESS] http://
[SUCCESS] http://
To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.bzrignore' |
2 | --- .bzrignore 2014-04-21 09:49:17 +0000 |
3 | +++ .bzrignore 2014-05-05 16:24:21 +0000 |
4 | @@ -32,3 +32,4 @@ |
5 | *.orig |
6 | __pycache__ |
7 | *.dll |
8 | +.directory |
9 | |
10 | === modified file 'README.txt' |
11 | --- README.txt 2011-05-24 20:47:05 +0000 |
12 | +++ README.txt 2014-05-05 16:24:21 +0000 |
13 | @@ -1,16 +1,15 @@ |
14 | -OpenLP 2.0 |
15 | -========== |
16 | +OpenLP |
17 | +====== |
18 | |
19 | You're probably reading this because you've just downloaded the source code for |
20 | -OpenLP 2.0. If you are looking for the installer file, please go to the download |
21 | +OpenLP. If you are looking for the installer file, please go to the download |
22 | page on the web site:: |
23 | |
24 | - http://openlp.org/en/download.html |
25 | + http://openlp.org/download |
26 | |
27 | If you're looking for how to contribute to OpenLP, then please look at the |
28 | OpenLP wiki:: |
29 | |
30 | http://wiki.openlp.org/ |
31 | |
32 | -Thanks for downloading OpenLP 2.0! |
33 | - |
34 | +Thanks for downloading OpenLP! |
35 | |
36 | === modified file 'openlp/core/ui/aboutdialog.py' |
37 | --- openlp/core/ui/aboutdialog.py 2014-03-20 19:10:31 +0000 |
38 | +++ openlp/core/ui/aboutdialog.py 2014-05-05 16:24:21 +0000 |
39 | @@ -44,7 +44,7 @@ |
40 | Set up the UI for the dialog. |
41 | """ |
42 | about_dialog.setObjectName('about_dialog') |
43 | - about_dialog.setWindowIcon(build_icon(':/icon/openlp-logo-16x16.png')) |
44 | + about_dialog.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) |
45 | self.about_dialog_layout = QtGui.QVBoxLayout(about_dialog) |
46 | self.about_dialog_layout.setObjectName('about_dialog_layout') |
47 | self.logo_label = QtGui.QLabel(about_dialog) |
48 | |
49 | === modified file 'openlp/core/ui/exceptiondialog.py' |
50 | --- openlp/core/ui/exceptiondialog.py 2014-05-01 17:49:43 +0000 |
51 | +++ openlp/core/ui/exceptiondialog.py 2014-05-05 16:24:21 +0000 |
52 | @@ -32,7 +32,7 @@ |
53 | |
54 | from PyQt4 import QtGui |
55 | |
56 | -from openlp.core.lib import translate |
57 | +from openlp.core.lib import translate, build_icon |
58 | from openlp.core.lib.ui import create_button, create_button_box |
59 | |
60 | |
61 | @@ -45,6 +45,7 @@ |
62 | Set up the UI. |
63 | """ |
64 | exception_dialog.setObjectName('exception_dialog') |
65 | + exception_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
66 | self.exception_layout = QtGui.QVBoxLayout(exception_dialog) |
67 | self.exception_layout.setObjectName('exception_layout') |
68 | self.message_layout = QtGui.QHBoxLayout() |
69 | |
70 | === modified file 'openlp/core/ui/filerenamedialog.py' |
71 | --- openlp/core/ui/filerenamedialog.py 2013-12-24 08:56:50 +0000 |
72 | +++ openlp/core/ui/filerenamedialog.py 2014-05-05 16:24:21 +0000 |
73 | @@ -31,7 +31,7 @@ |
74 | """ |
75 | from PyQt4 import QtCore, QtGui |
76 | |
77 | -from openlp.core.lib import translate |
78 | +from openlp.core.lib import translate, build_icon |
79 | from openlp.core.lib.ui import create_button_box |
80 | |
81 | |
82 | @@ -44,6 +44,7 @@ |
83 | Set up the UI |
84 | """ |
85 | file_rename_dialog.setObjectName('file_rename_dialog') |
86 | + file_rename_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
87 | file_rename_dialog.resize(300, 10) |
88 | self.dialog_layout = QtGui.QGridLayout(file_rename_dialog) |
89 | self.dialog_layout.setObjectName('dialog_layout') |
90 | |
91 | === modified file 'openlp/core/ui/firsttimelanguagedialog.py' |
92 | --- openlp/core/ui/firsttimelanguagedialog.py 2013-12-24 08:56:50 +0000 |
93 | +++ openlp/core/ui/firsttimelanguagedialog.py 2014-05-05 16:24:21 +0000 |
94 | @@ -32,6 +32,7 @@ |
95 | from PyQt4 import QtGui |
96 | |
97 | from openlp.core.common import translate |
98 | +from openlp.core.lib import build_icon |
99 | from openlp.core.lib.ui import create_button_box |
100 | |
101 | |
102 | @@ -44,6 +45,7 @@ |
103 | Set up the UI. |
104 | """ |
105 | language_dialog.setObjectName('language_dialog') |
106 | + language_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
107 | language_dialog.resize(300, 50) |
108 | self.dialog_layout = QtGui.QVBoxLayout(language_dialog) |
109 | self.dialog_layout.setContentsMargins(8, 8, 8, 8) |
110 | |
111 | === modified file 'openlp/core/ui/firsttimewizard.py' |
112 | --- openlp/core/ui/firsttimewizard.py 2014-04-12 20:19:22 +0000 |
113 | +++ openlp/core/ui/firsttimewizard.py 2014-05-05 16:24:21 +0000 |
114 | @@ -34,6 +34,7 @@ |
115 | import sys |
116 | |
117 | from openlp.core.common import translate |
118 | +from openlp.core.lib import build_icon |
119 | from openlp.core.lib.ui import add_welcome_page |
120 | |
121 | |
122 | @@ -60,6 +61,7 @@ |
123 | Set up the UI. |
124 | """ |
125 | first_time_wizard.setObjectName('first_time_wizard') |
126 | + first_time_wizard.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
127 | first_time_wizard.resize(550, 386) |
128 | first_time_wizard.setModal(True) |
129 | first_time_wizard.setWizardStyle(QtGui.QWizard.ModernStyle) |
130 | |
131 | === modified file 'openlp/core/ui/formattingtagdialog.py' |
132 | --- openlp/core/ui/formattingtagdialog.py 2014-03-20 19:10:31 +0000 |
133 | +++ openlp/core/ui/formattingtagdialog.py 2014-05-05 16:24:21 +0000 |
134 | @@ -45,6 +45,7 @@ |
135 | Set up the UI |
136 | """ |
137 | formatting_tag_dialog.setObjectName('formatting_tag_dialog') |
138 | + formatting_tag_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
139 | formatting_tag_dialog.resize(725, 548) |
140 | self.list_data_grid_layout = QtGui.QVBoxLayout(formatting_tag_dialog) |
141 | self.list_data_grid_layout.setMargin(8) |
142 | |
143 | === modified file 'openlp/core/ui/mainwindow.py' |
144 | --- openlp/core/ui/mainwindow.py 2014-04-20 16:02:50 +0000 |
145 | +++ openlp/core/ui/mainwindow.py 2014-05-05 16:24:21 +0000 |
146 | @@ -89,7 +89,7 @@ |
147 | Set up the user interface |
148 | """ |
149 | main_window.setObjectName('MainWindow') |
150 | - main_window.setWindowIcon(build_icon(':/icon/openlp-logo-64x64.png')) |
151 | + main_window.setWindowIcon(build_icon(':/icon/openlp-logo.svg')) |
152 | main_window.setDockNestingEnabled(True) |
153 | # Set up the main container, which contains all the other form widgets. |
154 | self.main_content = QtGui.QWidget(main_window) |
155 | |
156 | === modified file 'openlp/core/ui/plugindialog.py' |
157 | --- openlp/core/ui/plugindialog.py 2013-12-24 15:55:01 +0000 |
158 | +++ openlp/core/ui/plugindialog.py 2014-05-05 16:24:21 +0000 |
159 | @@ -32,6 +32,7 @@ |
160 | from PyQt4 import QtCore, QtGui |
161 | |
162 | from openlp.core.common import UiStrings, translate |
163 | +from openlp.core.lib import build_icon |
164 | from openlp.core.lib.ui import create_button_box |
165 | |
166 | |
167 | @@ -44,6 +45,7 @@ |
168 | Set up the UI |
169 | """ |
170 | pluginViewDialog.setObjectName('pluginViewDialog') |
171 | + pluginViewDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
172 | pluginViewDialog.setWindowModality(QtCore.Qt.ApplicationModal) |
173 | self.plugin_layout = QtGui.QVBoxLayout(pluginViewDialog) |
174 | self.plugin_layout.setObjectName('plugin_layout') |
175 | |
176 | === modified file 'openlp/core/ui/printservicedialog.py' |
177 | --- openlp/core/ui/printservicedialog.py 2013-12-24 15:55:01 +0000 |
178 | +++ openlp/core/ui/printservicedialog.py 2014-05-05 16:24:21 +0000 |
179 | @@ -56,6 +56,7 @@ |
180 | Set up the UI |
181 | """ |
182 | print_service_dialog.setObjectName('print_service_dialog') |
183 | + print_service_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
184 | print_service_dialog.resize(664, 594) |
185 | self.main_layout = QtGui.QVBoxLayout(print_service_dialog) |
186 | self.main_layout.setSpacing(0) |
187 | |
188 | === modified file 'openlp/core/ui/serviceitemeditdialog.py' |
189 | --- openlp/core/ui/serviceitemeditdialog.py 2013-12-24 15:55:01 +0000 |
190 | +++ openlp/core/ui/serviceitemeditdialog.py 2014-05-05 16:24:21 +0000 |
191 | @@ -32,6 +32,7 @@ |
192 | from PyQt4 import QtGui |
193 | |
194 | from openlp.core.common import translate |
195 | +from openlp.core.lib import build_icon |
196 | from openlp.core.lib.ui import create_button_box, create_button |
197 | |
198 | |
199 | @@ -44,6 +45,7 @@ |
200 | Set up the UI |
201 | """ |
202 | serviceItemEditDialog.setObjectName('serviceItemEditDialog') |
203 | + serviceItemEditDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
204 | self.dialog_layout = QtGui.QGridLayout(serviceItemEditDialog) |
205 | self.dialog_layout.setContentsMargins(8, 8, 8, 8) |
206 | self.dialog_layout.setSpacing(8) |
207 | |
208 | === modified file 'openlp/core/ui/settingsdialog.py' |
209 | --- openlp/core/ui/settingsdialog.py 2013-12-24 08:56:50 +0000 |
210 | +++ openlp/core/ui/settingsdialog.py 2014-05-05 16:24:21 +0000 |
211 | @@ -45,8 +45,8 @@ |
212 | Set up the UI |
213 | """ |
214 | settings_dialog.setObjectName('settings_dialog') |
215 | + settings_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
216 | settings_dialog.resize(800, 500) |
217 | - settings_dialog.setWindowIcon(build_icon(':/system/system_settings.png')) |
218 | self.dialog_layout = QtGui.QGridLayout(settings_dialog) |
219 | self.dialog_layout.setObjectName('dialog_layout') |
220 | self.dialog_layout.setMargin(8) |
221 | |
222 | === modified file 'openlp/core/ui/shortcutlistdialog.py' |
223 | --- openlp/core/ui/shortcutlistdialog.py 2013-12-24 20:45:29 +0000 |
224 | +++ openlp/core/ui/shortcutlistdialog.py 2014-05-05 16:24:21 +0000 |
225 | @@ -66,6 +66,7 @@ |
226 | Set up the UI |
227 | """ |
228 | shortcutListDialog.setObjectName('shortcutListDialog') |
229 | + shortcutListDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
230 | shortcutListDialog.resize(500, 438) |
231 | self.shortcut_list_layout = QtGui.QVBoxLayout(shortcutListDialog) |
232 | self.shortcut_list_layout.setObjectName('shortcut_list_layout') |
233 | |
234 | === modified file 'openlp/core/ui/starttimedialog.py' |
235 | --- openlp/core/ui/starttimedialog.py 2013-12-24 20:45:29 +0000 |
236 | +++ openlp/core/ui/starttimedialog.py 2014-05-05 16:24:21 +0000 |
237 | @@ -32,6 +32,7 @@ |
238 | from PyQt4 import QtCore, QtGui |
239 | |
240 | from openlp.core.common import UiStrings, translate |
241 | +from openlp.core.lib import build_icon |
242 | from openlp.core.lib.ui import create_button_box |
243 | |
244 | |
245 | @@ -44,6 +45,7 @@ |
246 | Set up the UI |
247 | """ |
248 | StartTimeDialog.setObjectName('StartTimeDialog') |
249 | + StartTimeDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
250 | StartTimeDialog.resize(350, 10) |
251 | self.dialog_layout = QtGui.QGridLayout(StartTimeDialog) |
252 | self.dialog_layout.setObjectName('dialog_layout') |
253 | |
254 | === modified file 'openlp/core/ui/themelayoutdialog.py' |
255 | --- openlp/core/ui/themelayoutdialog.py 2014-04-12 20:19:22 +0000 |
256 | +++ openlp/core/ui/themelayoutdialog.py 2014-05-05 16:24:21 +0000 |
257 | @@ -32,6 +32,7 @@ |
258 | from PyQt4 import QtGui |
259 | |
260 | from openlp.core.common import translate |
261 | +from openlp.core.lib import build_icon |
262 | from openlp.core.lib.ui import create_button_box |
263 | |
264 | |
265 | @@ -44,6 +45,7 @@ |
266 | Set up the UI |
267 | """ |
268 | themeLayoutDialog.setObjectName('themeLayoutDialogDialog') |
269 | + themeLayoutDialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
270 | self.preview_layout = QtGui.QVBoxLayout(themeLayoutDialog) |
271 | self.preview_layout.setObjectName('preview_layout') |
272 | self.preview_area = QtGui.QWidget(themeLayoutDialog) |
273 | |
274 | === modified file 'openlp/core/ui/themewizard.py' |
275 | --- openlp/core/ui/themewizard.py 2014-03-20 19:10:31 +0000 |
276 | +++ openlp/core/ui/themewizard.py 2014-05-05 16:24:21 +0000 |
277 | @@ -46,6 +46,7 @@ |
278 | Set up the UI |
279 | """ |
280 | themeWizard.setObjectName('OpenLP.ThemeWizard') |
281 | + themeWizard.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
282 | themeWizard.setModal(True) |
283 | themeWizard.setWizardStyle(QtGui.QWizard.ModernStyle) |
284 | themeWizard.setOptions(QtGui.QWizard.IndependentPages | |
285 | |
286 | === modified file 'openlp/core/ui/wizard.py' |
287 | --- openlp/core/ui/wizard.py 2014-05-02 06:42:17 +0000 |
288 | +++ openlp/core/ui/wizard.py 2014-05-05 16:24:21 +0000 |
289 | @@ -118,6 +118,7 @@ |
290 | """ |
291 | Set up the wizard UI. |
292 | """ |
293 | + self.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
294 | self.setModal(True) |
295 | self.setWizardStyle(QtGui.QWizard.ModernStyle) |
296 | self.setOptions(QtGui.QWizard.IndependentPages | |
297 | |
298 | === modified file 'openlp/plugins/alerts/forms/alertdialog.py' |
299 | --- openlp/plugins/alerts/forms/alertdialog.py 2014-01-11 21:46:20 +0000 |
300 | +++ openlp/plugins/alerts/forms/alertdialog.py 2014-05-05 16:24:21 +0000 |
301 | @@ -46,7 +46,7 @@ |
302 | """ |
303 | alert_dialog.setObjectName('alert_dialog') |
304 | alert_dialog.resize(400, 300) |
305 | - alert_dialog.setWindowIcon(build_icon(':/icon/openlp-logo-16x16.png')) |
306 | + alert_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
307 | self.alert_dialog_layout = QtGui.QGridLayout(alert_dialog) |
308 | self.alert_dialog_layout.setObjectName('alert_dialog_layout') |
309 | self.alert_text_layout = QtGui.QFormLayout() |
310 | |
311 | === modified file 'openlp/plugins/bibles/forms/booknamedialog.py' |
312 | --- openlp/plugins/bibles/forms/booknamedialog.py 2014-03-21 18:23:35 +0000 |
313 | +++ openlp/plugins/bibles/forms/booknamedialog.py 2014-05-05 16:24:21 +0000 |
314 | @@ -30,12 +30,14 @@ |
315 | from PyQt4 import QtCore, QtGui |
316 | |
317 | from openlp.core.common import translate |
318 | +from openlp.core.lib import build_icon |
319 | from openlp.core.lib.ui import create_button_box |
320 | |
321 | |
322 | class Ui_BookNameDialog(object): |
323 | def setupUi(self, book_name_dialog): |
324 | book_name_dialog.setObjectName('book_name_dialog') |
325 | + book_name_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
326 | book_name_dialog.resize(400, 271) |
327 | self.book_name_layout = QtGui.QVBoxLayout(book_name_dialog) |
328 | self.book_name_layout.setSpacing(8) |
329 | |
330 | === modified file 'openlp/plugins/bibles/forms/editbibledialog.py' |
331 | --- openlp/plugins/bibles/forms/editbibledialog.py 2014-03-21 18:23:35 +0000 |
332 | +++ openlp/plugins/bibles/forms/editbibledialog.py 2014-05-05 16:24:21 +0000 |
333 | @@ -39,8 +39,8 @@ |
334 | class Ui_EditBibleDialog(object): |
335 | def setupUi(self, edit_bible_dialog): |
336 | edit_bible_dialog.setObjectName('edit_bible_dialog') |
337 | + edit_bible_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
338 | edit_bible_dialog.resize(520, 400) |
339 | - edit_bible_dialog.setWindowIcon(build_icon(':/icon/openlp-logo-16x16.png')) |
340 | edit_bible_dialog.setModal(True) |
341 | self.dialog_layout = QtGui.QVBoxLayout(edit_bible_dialog) |
342 | self.dialog_layout.setSpacing(8) |
343 | |
344 | === modified file 'openlp/plugins/bibles/forms/languagedialog.py' |
345 | --- openlp/plugins/bibles/forms/languagedialog.py 2014-03-21 18:23:35 +0000 |
346 | +++ openlp/plugins/bibles/forms/languagedialog.py 2014-05-05 16:24:21 +0000 |
347 | @@ -30,12 +30,14 @@ |
348 | from PyQt4 import QtGui |
349 | |
350 | from openlp.core.common import translate |
351 | +from openlp.core.lib import build_icon |
352 | from openlp.core.lib.ui import create_button_box |
353 | |
354 | |
355 | class Ui_LanguageDialog(object): |
356 | def setupUi(self, language_dialog): |
357 | language_dialog.setObjectName('language_dialog') |
358 | + language_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
359 | language_dialog.resize(400, 165) |
360 | self.language_layout = QtGui.QVBoxLayout(language_dialog) |
361 | self.language_layout.setSpacing(8) |
362 | |
363 | === modified file 'openlp/plugins/bibles/lib/mediaitem.py' |
364 | --- openlp/plugins/bibles/lib/mediaitem.py 2014-05-02 06:50:54 +0000 |
365 | +++ openlp/plugins/bibles/lib/mediaitem.py 2014-05-05 16:24:21 +0000 |
366 | @@ -60,7 +60,6 @@ |
367 | log.info('Bible Media Item loaded') |
368 | |
369 | def __init__(self, parent, plugin): |
370 | - self.icon_path = 'songs/song' |
371 | self.lock_icon = build_icon(':/bibles/bibles_search_lock.png') |
372 | self.unlock_icon = build_icon(':/bibles/bibles_search_unlock.png') |
373 | MediaManagerItem.__init__(self, parent, plugin) |
374 | @@ -172,6 +171,7 @@ |
375 | self.page_layout.addWidget(tab) |
376 | tab.setVisible(False) |
377 | lock_button.toggled.connect(self.on_lock_button_toggled) |
378 | + second_combo_box.currentIndexChanged.connect(self.on_second_bible_combobox_index_changed) |
379 | setattr(self, prefix + 'VersionLabel', version_label) |
380 | setattr(self, prefix + 'VersionComboBox', version_combo_box) |
381 | setattr(self, prefix + 'SecondLabel', second_label) |
382 | @@ -263,11 +263,15 @@ |
383 | def config_update(self): |
384 | log.debug('config_update') |
385 | if Settings().value(self.settings_section + '/second bibles'): |
386 | + self.quickSecondLabel.setVisible(True) |
387 | + self.quickSecondComboBox.setVisible(True) |
388 | self.advancedSecondLabel.setVisible(True) |
389 | self.advancedSecondComboBox.setVisible(True) |
390 | self.quickSecondLabel.setVisible(True) |
391 | self.quickSecondComboBox.setVisible(True) |
392 | else: |
393 | + self.quickSecondLabel.setVisible(False) |
394 | + self.quickSecondComboBox.setVisible(False) |
395 | self.advancedSecondLabel.setVisible(False) |
396 | self.advancedSecondComboBox.setVisible(False) |
397 | self.quickSecondLabel.setVisible(False) |
398 | @@ -459,6 +463,17 @@ |
399 | books.sort(key=get_locale_key) |
400 | set_case_insensitive_completer(books, self.quick_search_edit) |
401 | |
402 | + def on_second_bible_combobox_index_changed(self, selection): |
403 | + """ |
404 | + Activate the style combobox only when no second bible is selected |
405 | + """ |
406 | + if selection == 0: |
407 | + self.quickStyleComboBox.setEnabled(True) |
408 | + self.advancedStyleComboBox.setEnabled(True) |
409 | + else: |
410 | + self.quickStyleComboBox.setEnabled(False) |
411 | + self.advancedStyleComboBox.setEnabled(False) |
412 | + |
413 | def on_import_click(self): |
414 | if not hasattr(self, 'import_wizard'): |
415 | self.import_wizard = BibleImportForm(self, self.plugin.manager, self.plugin) |
416 | |
417 | === modified file 'openlp/plugins/custom/forms/editcustomdialog.py' |
418 | --- openlp/plugins/custom/forms/editcustomdialog.py 2014-01-01 10:56:23 +0000 |
419 | +++ openlp/plugins/custom/forms/editcustomdialog.py 2014-05-05 16:24:21 +0000 |
420 | @@ -41,8 +41,8 @@ |
421 | :param custom_edit_dialog: The Dialog |
422 | """ |
423 | custom_edit_dialog.setObjectName('custom_edit_dialog') |
424 | + custom_edit_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
425 | custom_edit_dialog.resize(450, 350) |
426 | - custom_edit_dialog.setWindowIcon(build_icon(':/icon/openlp-logo-16x16.png')) |
427 | self.dialog_layout = QtGui.QVBoxLayout(custom_edit_dialog) |
428 | self.dialog_layout.setObjectName('dialog_layout') |
429 | self.title_layout = QtGui.QHBoxLayout() |
430 | |
431 | === modified file 'openlp/plugins/custom/forms/editcustomslidedialog.py' |
432 | --- openlp/plugins/custom/forms/editcustomslidedialog.py 2014-03-21 21:38:08 +0000 |
433 | +++ openlp/plugins/custom/forms/editcustomslidedialog.py 2014-05-05 16:24:21 +0000 |
434 | @@ -30,13 +30,14 @@ |
435 | from PyQt4 import QtGui |
436 | |
437 | from openlp.core.common import UiStrings, translate |
438 | -from openlp.core.lib import SpellTextEdit |
439 | +from openlp.core.lib import SpellTextEdit, build_icon |
440 | from openlp.core.lib.ui import create_button, create_button_box |
441 | |
442 | |
443 | class Ui_CustomSlideEditDialog(object): |
444 | def setupUi(self, custom_slide_edit_dialog): |
445 | custom_slide_edit_dialog.setObjectName('custom_slide_edit_dialog') |
446 | + custom_slide_edit_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
447 | custom_slide_edit_dialog.resize(350, 300) |
448 | self.dialog_layout = QtGui.QVBoxLayout(custom_slide_edit_dialog) |
449 | self.slide_text_edit = SpellTextEdit(self) |
450 | |
451 | === modified file 'openlp/plugins/songs/forms/authorsdialog.py' |
452 | --- openlp/plugins/songs/forms/authorsdialog.py 2013-12-24 08:56:50 +0000 |
453 | +++ openlp/plugins/songs/forms/authorsdialog.py 2014-05-05 16:24:21 +0000 |
454 | @@ -43,8 +43,8 @@ |
455 | Set up the UI for the dialog. |
456 | """ |
457 | authors_dialog.setObjectName('authors_dialog') |
458 | + authors_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
459 | authors_dialog.resize(300, 10) |
460 | - authors_dialog.setWindowIcon(build_icon(':/icon/openlp-logo-16x16.png')) |
461 | authors_dialog.setModal(True) |
462 | self.dialog_layout = QtGui.QVBoxLayout(authors_dialog) |
463 | self.dialog_layout.setObjectName('dialog_layout') |
464 | |
465 | === modified file 'openlp/plugins/songs/forms/editsongdialog.py' |
466 | --- openlp/plugins/songs/forms/editsongdialog.py 2014-04-21 09:58:53 +0000 |
467 | +++ openlp/plugins/songs/forms/editsongdialog.py 2014-05-05 16:24:21 +0000 |
468 | @@ -43,8 +43,8 @@ |
469 | """ |
470 | def setupUi(self, edit_song_dialog): |
471 | edit_song_dialog.setObjectName('edit_song_dialog') |
472 | + edit_song_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
473 | edit_song_dialog.resize(650, 400) |
474 | - edit_song_dialog.setWindowIcon(build_icon(':/icon/openlp-logo-16x16.png')) |
475 | edit_song_dialog.setModal(True) |
476 | self.dialog_layout = QtGui.QVBoxLayout(edit_song_dialog) |
477 | self.dialog_layout.setSpacing(8) |
478 | |
479 | === modified file 'openlp/plugins/songs/forms/editsongform.py' |
480 | --- openlp/plugins/songs/forms/editsongform.py 2014-04-15 08:30:04 +0000 |
481 | +++ openlp/plugins/songs/forms/editsongform.py 2014-05-05 16:24:21 +0000 |
482 | @@ -107,6 +107,7 @@ |
483 | self.audio_list_widget.setAlternatingRowColors(True) |
484 | self.find_verse_split = re.compile('---\[\]---\n', re.UNICODE) |
485 | self.whitespace = re.compile(r'\W+', re.UNICODE) |
486 | + self.find_tags = re.compile(u'\{/?\w+\}', re.UNICODE) |
487 | |
488 | def _load_objects(self, cls, combo, cache): |
489 | """ |
490 | @@ -234,8 +235,57 @@ |
491 | self.manager.save_object(book) |
492 | else: |
493 | return False |
494 | + # Validate tags (lp#1199639) |
495 | + misplaced_tags = [] |
496 | + verse_tags = [] |
497 | + for i in range(self.verse_list_widget.rowCount()): |
498 | + item = self.verse_list_widget.item(i, 0) |
499 | + tags = self.find_tags.findall(item.text()) |
500 | + field = item.data(QtCore.Qt.UserRole) |
501 | + verse_tags.append(field) |
502 | + if not self._validate_tags(tags): |
503 | + misplaced_tags.append('%s %s' % (VerseType.translated_name(field[0]), field[1:])) |
504 | + if misplaced_tags: |
505 | + critical_error_message_box( |
506 | + message=translate('SongsPlugin.EditSongForm', |
507 | + 'There are misplaced formatting tags in the following verses:\n\n%s\n\n' |
508 | + 'Please correct these tags before continuing.' % ', '.join(misplaced_tags))) |
509 | + return False |
510 | + for tag in verse_tags: |
511 | + if verse_tags.count(tag) > 26: |
512 | + # lp#1310523: OpenLyrics allows only a-z variants of one verse: |
513 | + # http://openlyrics.info/dataformat.html#verse-name |
514 | + critical_error_message_box(message=translate( |
515 | + 'SongsPlugin.EditSongForm', 'You have %(count)s verses named %(name)s %(number)s. ' |
516 | + 'You can have at most 26 verses with the same name' % |
517 | + {'count': verse_tags.count(tag), |
518 | + 'name': VerseType.translated_name(tag[0]), |
519 | + 'number': tag[1:]})) |
520 | + return False |
521 | return True |
522 | |
523 | + def _validate_tags(self, tags): |
524 | + """ |
525 | + Validates a list of tags |
526 | + Deletes the first affiliated tag pair which is located side by side in the list |
527 | + and call itself recursively with the shortened tag list. |
528 | + If there is any misplaced tag in the list, either the length of the tag list is not even, |
529 | + or the function won't find any tag pairs side by side. |
530 | + If there is no misplaced tag, the length of the list will be zero on any recursive run. |
531 | + |
532 | + :param tags: A list of tags |
533 | + :return: True if the function can't find any mismatched tags. Else False. |
534 | + """ |
535 | + if len(tags) == 0: |
536 | + return True |
537 | + if len(tags) % 2 != 0: |
538 | + return False |
539 | + for i in range(len(tags)-1): |
540 | + if tags[i+1] == "{/" + tags[i][1:]: |
541 | + del tags[i:i+2] |
542 | + return self._validate_tags(tags) |
543 | + return False |
544 | + |
545 | def _process_lyrics(self): |
546 | """ |
547 | Process the lyric data entered by the user into the OpenLP XML format. |
548 | |
549 | === modified file 'openlp/plugins/songs/forms/editversedialog.py' |
550 | --- openlp/plugins/songs/forms/editversedialog.py 2014-03-04 18:49:30 +0000 |
551 | +++ openlp/plugins/songs/forms/editversedialog.py 2014-05-05 16:24:21 +0000 |
552 | @@ -37,6 +37,7 @@ |
553 | class Ui_EditVerseDialog(object): |
554 | def setupUi(self, edit_verse_dialog): |
555 | edit_verse_dialog.setObjectName('edit_verse_dialog') |
556 | + edit_verse_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
557 | edit_verse_dialog.resize(400, 400) |
558 | edit_verse_dialog.setModal(True) |
559 | self.dialog_layout = QtGui.QVBoxLayout(edit_verse_dialog) |
560 | |
561 | === modified file 'openlp/plugins/songs/forms/mediafilesdialog.py' |
562 | --- openlp/plugins/songs/forms/mediafilesdialog.py 2014-04-12 20:19:22 +0000 |
563 | +++ openlp/plugins/songs/forms/mediafilesdialog.py 2014-05-05 16:24:21 +0000 |
564 | @@ -42,10 +42,10 @@ |
565 | Set up the user interface. |
566 | """ |
567 | media_files_dialog.setObjectName('media_files_dialog') |
568 | + media_files_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
569 | media_files_dialog.setWindowModality(QtCore.Qt.ApplicationModal) |
570 | media_files_dialog.resize(400, 300) |
571 | media_files_dialog.setModal(True) |
572 | - media_files_dialog.setWindowIcon(build_icon(':/icon/openlp-logo-16x16.png')) |
573 | self.files_vertical_layout = QtGui.QVBoxLayout(media_files_dialog) |
574 | self.files_vertical_layout.setSpacing(8) |
575 | self.files_vertical_layout.setMargin(8) |
576 | |
577 | === modified file 'openlp/plugins/songs/forms/songbookdialog.py' |
578 | --- openlp/plugins/songs/forms/songbookdialog.py 2013-12-24 08:56:50 +0000 |
579 | +++ openlp/plugins/songs/forms/songbookdialog.py 2014-05-05 16:24:21 +0000 |
580 | @@ -29,7 +29,7 @@ |
581 | |
582 | from PyQt4 import QtGui |
583 | |
584 | -from openlp.core.lib import translate |
585 | +from openlp.core.lib import translate, build_icon |
586 | from openlp.core.lib.ui import create_button_box |
587 | |
588 | |
589 | @@ -42,6 +42,7 @@ |
590 | Set up the user interface. |
591 | """ |
592 | song_book_dialog.setObjectName('song_book_dialog') |
593 | + song_book_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
594 | song_book_dialog.resize(300, 10) |
595 | self.dialog_layout = QtGui.QVBoxLayout(song_book_dialog) |
596 | self.dialog_layout.setObjectName('dialog_layout') |
597 | |
598 | === modified file 'openlp/plugins/songs/forms/songmaintenancedialog.py' |
599 | --- openlp/plugins/songs/forms/songmaintenancedialog.py 2014-03-21 21:38:08 +0000 |
600 | +++ openlp/plugins/songs/forms/songmaintenancedialog.py 2014-05-05 16:24:21 +0000 |
601 | @@ -44,6 +44,7 @@ |
602 | Set up the user interface for the song maintenance dialog |
603 | """ |
604 | song_maintenance_dialog.setObjectName('song_maintenance_dialog') |
605 | + song_maintenance_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
606 | song_maintenance_dialog.setWindowModality(QtCore.Qt.ApplicationModal) |
607 | song_maintenance_dialog.resize(10, 350) |
608 | self.dialog_layout = QtGui.QGridLayout(song_maintenance_dialog) |
609 | |
610 | === modified file 'openlp/plugins/songs/forms/topicsdialog.py' |
611 | --- openlp/plugins/songs/forms/topicsdialog.py 2013-12-24 08:56:50 +0000 |
612 | +++ openlp/plugins/songs/forms/topicsdialog.py 2014-05-05 16:24:21 +0000 |
613 | @@ -29,7 +29,7 @@ |
614 | |
615 | from PyQt4 import QtGui |
616 | |
617 | -from openlp.core.lib import translate |
618 | +from openlp.core.lib import translate, build_icon |
619 | from openlp.core.lib.ui import create_button_box |
620 | |
621 | |
622 | @@ -42,6 +42,7 @@ |
623 | Set up the user interface for the topics dialog. |
624 | """ |
625 | topics_dialog.setObjectName('topics_dialog') |
626 | + topics_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
627 | topics_dialog.resize(300, 10) |
628 | self.dialog_layout = QtGui.QVBoxLayout(topics_dialog) |
629 | self.dialog_layout.setObjectName('dialog_layout') |
630 | |
631 | === modified file 'openlp/plugins/songs/lib/sundayplusimport.py' |
632 | --- openlp/plugins/songs/lib/sundayplusimport.py 2014-03-21 21:38:08 +0000 |
633 | +++ openlp/plugins/songs/lib/sundayplusimport.py 2014-05-05 16:24:21 +0000 |
634 | @@ -68,7 +68,7 @@ |
635 | for filename in self.import_source: |
636 | if self.stop_import_flag: |
637 | return |
638 | - song_file = open(filename) |
639 | + song_file = open(filename, 'rb') |
640 | self.do_import_file(song_file) |
641 | song_file.close() |
642 | |
643 | @@ -103,7 +103,7 @@ |
644 | # Now we are looking for the name. |
645 | if data[i:i + 1] == '#': |
646 | name_end = data.find(':', i + 1) |
647 | - name = data[i + 1:name_end] |
648 | + name = data[i + 1:name_end].upper() |
649 | i = name_end + 1 |
650 | while data[i:i + 1] == ' ': |
651 | i += 1 |
652 | @@ -129,13 +129,13 @@ |
653 | value = data[i:end] |
654 | # If we are in the main group. |
655 | if not cell: |
656 | - if name == 'title': |
657 | + if name == 'TITLE': |
658 | self.title = self.decode(self.unescape(value)) |
659 | - elif name == 'Author': |
660 | + elif name == 'AUTHOR': |
661 | author = self.decode(self.unescape(value)) |
662 | if len(author): |
663 | self.add_author(author) |
664 | - elif name == 'Copyright': |
665 | + elif name == 'COPYRIGHT': |
666 | self.copyright = self.decode(self.unescape(value)) |
667 | elif name[0:4] == 'CELL': |
668 | self.parse(value, cell=name[4:]) |
669 | @@ -147,12 +147,12 @@ |
670 | verse_type = VerseType.tags[VerseType.from_loose_input(value[0])] |
671 | if len(value) >= 2 and value[-1] in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']: |
672 | verse_type = "%s%s" % (verse_type, value[-1]) |
673 | - elif name == 'Hotkey': |
674 | - # Hotkey always appears after MARKER_NAME, so it |
675 | + elif name == 'HOTKEY': |
676 | + # HOTKEY always appears after MARKER_NAME, so it |
677 | # effectively overrides MARKER_NAME, if present. |
678 | if len(value) and value in list(HOTKEY_TO_VERSE_TYPE.keys()): |
679 | verse_type = HOTKEY_TO_VERSE_TYPE[value] |
680 | - if name == 'rtf': |
681 | + if name == 'RTF': |
682 | value = self.unescape(value) |
683 | result = strip_rtf(value, self.encoding) |
684 | if result is None: |
685 | |
686 | === modified file 'openlp/plugins/songs/lib/xml.py' |
687 | --- openlp/plugins/songs/lib/xml.py 2014-05-02 06:42:17 +0000 |
688 | +++ openlp/plugins/songs/lib/xml.py 2014-05-05 16:24:21 +0000 |
689 | @@ -310,9 +310,9 @@ |
690 | verse_tag = verse[0]['type'][0].lower() |
691 | verse_number = verse[0]['label'] |
692 | verse_def = verse_tag + verse_number |
693 | + # Create the letter from the number of duplicates |
694 | + verse[0][u'suffix'] = chr(97 + (verse_tags.count(verse_def) % 26)) |
695 | verse_tags.append(verse_def) |
696 | - # Create the letter from the number of duplicates |
697 | - verse[0]['suffix'] = chr(96 + verse_tags.count(verse_def)) |
698 | # If the verse tag is a duplicate use the suffix letter |
699 | for verse in verse_list: |
700 | verse_tag = verse[0]['type'][0].lower() |
701 | |
702 | === modified file 'openlp/plugins/songusage/forms/songusagedeletedialog.py' |
703 | --- openlp/plugins/songusage/forms/songusagedeletedialog.py 2014-01-11 22:01:41 +0000 |
704 | +++ openlp/plugins/songusage/forms/songusagedeletedialog.py 2014-05-05 16:24:21 +0000 |
705 | @@ -30,6 +30,7 @@ |
706 | from PyQt4 import QtCore, QtGui |
707 | |
708 | from openlp.core.common import translate |
709 | +from openlp.core.lib import build_icon |
710 | from openlp.core.lib.ui import create_button_box |
711 | |
712 | |
713 | @@ -44,6 +45,7 @@ |
714 | :param song_usage_delete_dialog: |
715 | """ |
716 | song_usage_delete_dialog.setObjectName('song_usage_delete_dialog') |
717 | + song_usage_delete_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
718 | song_usage_delete_dialog.resize(291, 243) |
719 | self.vertical_layout = QtGui.QVBoxLayout(song_usage_delete_dialog) |
720 | self.vertical_layout.setSpacing(8) |
721 | |
722 | === modified file 'openlp/plugins/songusage/forms/songusagedetaildialog.py' |
723 | --- openlp/plugins/songusage/forms/songusagedetaildialog.py 2014-01-11 22:01:41 +0000 |
724 | +++ openlp/plugins/songusage/forms/songusagedetaildialog.py 2014-05-05 16:24:21 +0000 |
725 | @@ -45,6 +45,7 @@ |
726 | :param song_usage_detail_dialog: |
727 | """ |
728 | song_usage_detail_dialog.setObjectName('song_usage_detail_dialog') |
729 | + song_usage_detail_dialog.setWindowIcon(build_icon(u':/icon/openlp-logo.svg')) |
730 | song_usage_detail_dialog.resize(609, 413) |
731 | self.vertical_layout = QtGui.QVBoxLayout(song_usage_detail_dialog) |
732 | self.vertical_layout.setSpacing(8) |
733 | |
734 | === modified file 'tests/functional/openlp_core_lib/test_ui.py' |
735 | --- tests/functional/openlp_core_lib/test_ui.py 2014-04-20 20:19:21 +0000 |
736 | +++ tests/functional/openlp_core_lib/test_ui.py 2014-05-05 16:24:21 +0000 |
737 | @@ -82,6 +82,21 @@ |
738 | self.assertEqual(1, len(btnbox.buttons())) |
739 | self.assertEqual(QtGui.QDialogButtonBox.HelpRole, btnbox.buttonRole(btnbox.buttons()[0])) |
740 | |
741 | + def test_create_horizontal_adjusting_combo_box(self): |
742 | + """ |
743 | + Test creating a horizontal adjusting combo box |
744 | + """ |
745 | + # GIVEN: A dialog |
746 | + dialog = QtGui.QDialog() |
747 | + |
748 | + # WHEN: We create the combobox |
749 | + combo = create_horizontal_adjusting_combo_box(dialog, 'combo1') |
750 | + |
751 | + # THEN: We should get a ComboBox |
752 | + self.assertIsInstance(combo, QtGui.QComboBox) |
753 | + self.assertEqual('combo1', combo.objectName()) |
754 | + self.assertEqual(QtGui.QComboBox.AdjustToMinimumContentsLength, combo.sizeAdjustPolicy()) |
755 | + |
756 | def test_create_button(self): |
757 | """ |
758 | Test creating a button |
759 | @@ -114,38 +129,6 @@ |
760 | self.assertEqual('my_btn', btn.objectName()) |
761 | self.assertTrue(btn.isEnabled()) |
762 | |
763 | - def test_create_valign_selection_widgets(self): |
764 | - """ |
765 | - Test creating a combo box for valign selection |
766 | - """ |
767 | - # GIVEN: A dialog |
768 | - dialog = QtGui.QDialog() |
769 | - |
770 | - # WHEN: We create the widgets |
771 | - label, combo = create_valign_selection_widgets(dialog) |
772 | - |
773 | - # THEN: We should get a label and a combobox. |
774 | - self.assertEqual(translate('OpenLP.Ui', '&Vertical Align:'), label.text()) |
775 | - self.assertIsInstance(combo, QtGui.QComboBox) |
776 | - self.assertEqual(combo, label.buddy()) |
777 | - for text in [UiStrings().Top, UiStrings().Middle, UiStrings().Bottom]: |
778 | - self.assertTrue(combo.findText(text) >= 0) |
779 | - |
780 | - def test_create_horizontal_adjusting_combo_box(self): |
781 | - """ |
782 | - Test creating a horizontal adjusting combo box |
783 | - """ |
784 | - # GIVEN: A dialog |
785 | - dialog = QtGui.QDialog() |
786 | - |
787 | - # WHEN: We create the combobox |
788 | - combo = create_horizontal_adjusting_combo_box(dialog, 'combo1') |
789 | - |
790 | - # THEN: We should get a ComboBox |
791 | - self.assertIsInstance(combo, QtGui.QComboBox) |
792 | - self.assertEqual('combo1', combo.objectName()) |
793 | - self.assertEqual(QtGui.QComboBox.AdjustToMinimumContentsLength, combo.sizeAdjustPolicy()) |
794 | - |
795 | def test_create_action(self): |
796 | """ |
797 | Test creating an action |
798 | @@ -170,3 +153,47 @@ |
799 | self.assertIsInstance(action.icon(), QtGui.QIcon) |
800 | self.assertEqual('my tooltip', action.toolTip()) |
801 | self.assertEqual('my statustip', action.statusTip()) |
802 | + |
803 | + def test_create_valign_selection_widgets(self): |
804 | + """ |
805 | + Test creating a combo box for valign selection |
806 | + """ |
807 | + # GIVEN: A dialog |
808 | + dialog = QtGui.QDialog() |
809 | + |
810 | + # WHEN: We create the widgets |
811 | + label, combo = create_valign_selection_widgets(dialog) |
812 | + |
813 | + # THEN: We should get a label and a combobox. |
814 | + self.assertEqual(translate('OpenLP.Ui', '&Vertical Align:'), label.text()) |
815 | + self.assertIsInstance(combo, QtGui.QComboBox) |
816 | + self.assertEqual(combo, label.buddy()) |
817 | + for text in [UiStrings().Top, UiStrings().Middle, UiStrings().Bottom]: |
818 | + self.assertTrue(combo.findText(text) >= 0) |
819 | + |
820 | + def test_find_and_set_in_combo_box(self): |
821 | + """ |
822 | + Test finding a string in a combo box and setting it as the selected item if present |
823 | + """ |
824 | + # GIVEN: A ComboBox |
825 | + combo = QtGui.QComboBox() |
826 | + combo.addItems(['One', 'Two', 'Three']) |
827 | + combo.setCurrentIndex(1) |
828 | + |
829 | + # WHEN: We call the method with a non-existing value and set_missing=False |
830 | + find_and_set_in_combo_box(combo, 'Four', set_missing=False) |
831 | + |
832 | + # THEN: The index should not have changed |
833 | + self.assertEqual(1, combo.currentIndex()) |
834 | + |
835 | + # WHEN: We call the method with a non-existing value |
836 | + find_and_set_in_combo_box(combo, 'Four') |
837 | + |
838 | + # THEN: The index should have been reset |
839 | + self.assertEqual(0, combo.currentIndex()) |
840 | + |
841 | + # WHEN: We call the method with the default behavior |
842 | + find_and_set_in_combo_box(combo, 'Three') |
843 | + |
844 | + # THEN: The index should have changed |
845 | + self.assertEqual(2, combo.currentIndex()) |
846 | |
847 | === modified file 'tests/utils/test_bzr_tags.py' |
848 | --- tests/utils/test_bzr_tags.py 2014-04-14 20:01:13 +0000 |
849 | +++ tests/utils/test_bzr_tags.py 2014-05-05 16:24:21 +0000 |
850 | @@ -53,6 +53,7 @@ |
851 | ['2.0.1', '?'], |
852 | ['2.0.2', '?'], |
853 | ['2.0.3', '?'], |
854 | + ['2.0.4', '?'], |
855 | ['2.1.0', '2119'] |
856 | ] |
857 |
Looks ok