Merge lp:~thelinuxguy/openlp/fix-1490184 into lp:openlp

Proposed by Simon Hanna on 2016-01-05
Status: Merged
Merged at revision: 2591
Proposed branch: lp:~thelinuxguy/openlp/fix-1490184
Merge into: lp:openlp
Diff against target: 752 lines (+174/-53)
35 files modified
.bzrignore (+2/-0)
openlp/core/ui/aboutform.py (+3/-2)
openlp/core/ui/exceptionform.py (+2/-1)
openlp/core/ui/filerenameform.py (+3/-2)
openlp/core/ui/firsttimelanguageform.py (+3/-2)
openlp/core/ui/formattingtagform.py (+3/-2)
openlp/core/ui/pluginform.py (+3/-2)
openlp/core/ui/printserviceform.py (+2/-1)
openlp/core/ui/projector/editform.py (+2/-1)
openlp/core/ui/projector/sourceselectform.py (+4/-2)
openlp/core/ui/serviceitemeditform.py (+3/-2)
openlp/core/ui/servicenoteform.py (+3/-2)
openlp/core/ui/settingsform.py (+2/-1)
openlp/core/ui/shortcutlistform.py (+2/-1)
openlp/core/ui/starttimeform.py (+3/-2)
openlp/plugins/alerts/forms/alertform.py (+2/-1)
openlp/plugins/bibles/forms/booknameform.py (+2/-1)
openlp/plugins/bibles/forms/editbibleform.py (+3/-2)
openlp/plugins/bibles/forms/languageform.py (+3/-1)
openlp/plugins/custom/forms/editcustomform.py (+3/-2)
openlp/plugins/custom/forms/editcustomslideform.py (+3/-2)
openlp/plugins/images/forms/addgroupform.py (+3/-2)
openlp/plugins/images/forms/choosegroupform.py (+3/-2)
openlp/plugins/media/forms/mediaclipselectorform.py (+2/-1)
openlp/plugins/songs/forms/authorsform.py (+3/-2)
openlp/plugins/songs/forms/editsongform.py (+2/-1)
openlp/plugins/songs/forms/editverseform.py (+3/-2)
openlp/plugins/songs/forms/mediafilesform.py (+2/-1)
openlp/plugins/songs/forms/songbookform.py (+3/-2)
openlp/plugins/songs/forms/songmaintenanceform.py (+2/-1)
openlp/plugins/songs/forms/songselectform.py (+2/-1)
openlp/plugins/songs/forms/topicsform.py (+3/-2)
openlp/plugins/songusage/forms/songusagedeleteform.py (+3/-2)
openlp/plugins/songusage/forms/songusagedetailform.py (+3/-2)
tests/functional/openlp_plugins/songs/test_songformat.py (+84/-0)
To merge this branch: bzr merge lp:~thelinuxguy/openlp/fix-1490184
Reviewer Review Type Date Requested Status
Tomas Groth 2016-01-05 Approve on 2016-01-06
Tim Bentley 2016-01-05 Approve on 2016-01-05
Review via email: mp+281696@code.launchpad.net

This proposal supersedes a proposal from 2015-12-30.

Description of the change

Modify all forms to remove the help button from their status bar.

I don't think I missed a form. The Wizards remain untouched as the help button works there

To post a comment you must log in.
Tomas Groth (tomasgroth) wrote : Posted in a previous version of this proposal

Looks good, but we'll need a test. This fix might be hard to make a test for, so feel free to make test for something else.

review: Needs Fixing
Simon Hanna (thelinuxguy) wrote : Posted in a previous version of this proposal

It's not the greatest test, it's the first I found, that I knew I would be able to write a test for

Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

Four new tests is great but we do have a style about our tests.
All the tests are based around the simple structure. Note the comments are very important as they are the only part of the test visible when it fails so it give a clue where to look

# GIVEN:

# WHEN:

# THEN:

so

def test_get_format_list(self):
   self.assertEquals(len(SongFormat.get_format_list()), len(SongFormat.__attributes__))

becomes something like.

def test_get_format_list(self):
   """
   Test for default format list
   """
   # GIVEN: a SongFormat

   # WHEN: I have a basic object

   # THEN: the following data should be constructed
   self.assertEquals(len(SongFormat.get_format_list()), len(SongFormat.__attributes__), 'The correct number of attributes have not been created')

review: Needs Fixing
Tim Bentley (trb143) : Posted in a previous version of this proposal
review: Needs Fixing
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

See below each test needs a proper comment line - unique as that says what test is failing

Tim Bentley (trb143) wrote :

Tests look better constructed.
No windows machine to confirm validity of fix.

review: Approve
Tomas Groth (tomasgroth) :
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 2015-05-07 21:29:43 +0000
3+++ .bzrignore 2016-01-05 21:38:21 +0000
4@@ -43,3 +43,5 @@
5 .coverage
6 cover
7 *.kdev4
8+./.coveragerc
9+./coverage
10
11=== modified file 'openlp/core/ui/aboutform.py'
12--- openlp/core/ui/aboutform.py 2015-12-31 22:46:06 +0000
13+++ openlp/core/ui/aboutform.py 2016-01-05 21:38:21 +0000
14@@ -24,7 +24,7 @@
15 """
16 import webbrowser
17
18-from PyQt5 import QtWidgets
19+from PyQt5 import QtCore, QtWidgets
20
21 from openlp.core.lib import translate
22 from openlp.core.utils import get_application_version
23@@ -40,7 +40,8 @@
24 """
25 Do some initialisation stuff
26 """
27- super(AboutForm, self).__init__(parent)
28+ super(AboutForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
29+ | QtCore.Qt.WindowTitleHint)
30 self._setup()
31
32 def _setup(self):
33
34=== modified file 'openlp/core/ui/exceptionform.py'
35--- openlp/core/ui/exceptionform.py 2015-12-31 22:46:06 +0000
36+++ openlp/core/ui/exceptionform.py 2016-01-05 21:38:21 +0000
37@@ -89,7 +89,8 @@
38 """
39 Constructor.
40 """
41- super(ExceptionForm, self).__init__()
42+ super(ExceptionForm, self).__init__(None, QtCore.Qt.WindowSystemMenuHint
43+ | QtCore.Qt.WindowTitleHint)
44 self.setupUi(self)
45 self.settings_section = 'crashreport'
46 self.report_text = '**OpenLP Bug Report**\n' \
47
48=== modified file 'openlp/core/ui/filerenameform.py'
49--- openlp/core/ui/filerenameform.py 2015-12-31 22:46:06 +0000
50+++ openlp/core/ui/filerenameform.py 2016-01-05 21:38:21 +0000
51@@ -23,7 +23,7 @@
52 The file rename dialog.
53 """
54
55-from PyQt5 import QtWidgets
56+from PyQt5 import QtCore, QtWidgets
57
58 from .filerenamedialog import Ui_FileRenameDialog
59
60@@ -38,7 +38,8 @@
61 """
62 Constructor
63 """
64- super(FileRenameForm, self).__init__(Registry().get('main_window'))
65+ super(FileRenameForm, self).__init__(Registry().get('main_window'),
66+ QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
67 self._setup()
68
69 def _setup(self):
70
71=== modified file 'openlp/core/ui/firsttimelanguageform.py'
72--- openlp/core/ui/firsttimelanguageform.py 2015-12-31 22:46:06 +0000
73+++ openlp/core/ui/firsttimelanguageform.py 2016-01-05 21:38:21 +0000
74@@ -22,7 +22,7 @@
75 """
76 The language selection dialog.
77 """
78-from PyQt5 import QtWidgets
79+from PyQt5 import QtCore, QtWidgets
80
81 from openlp.core.lib.ui import create_action
82 from openlp.core.utils import LanguageManager
83@@ -37,7 +37,8 @@
84 """
85 Constructor
86 """
87- super(FirstTimeLanguageForm, self).__init__(parent)
88+ super(FirstTimeLanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
89+ | QtCore.Qt.WindowTitleHint)
90 self.setupUi(self)
91 self.qm_list = LanguageManager.get_qm_list()
92 self.language_combo_box.addItem('Autodetect')
93
94=== modified file 'openlp/core/ui/formattingtagform.py'
95--- openlp/core/ui/formattingtagform.py 2015-12-31 22:46:06 +0000
96+++ openlp/core/ui/formattingtagform.py 2016-01-05 21:38:21 +0000
97@@ -25,7 +25,7 @@
98 Base Tags cannot be changed.
99 """
100
101-from PyQt5 import QtWidgets
102+from PyQt5 import QtCore, QtWidgets
103
104 from openlp.core.common import translate
105 from openlp.core.lib import FormattingTags
106@@ -51,7 +51,8 @@
107 """
108 Constructor
109 """
110- super(FormattingTagForm, self).__init__(parent)
111+ super(FormattingTagForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
112+ | QtCore.Qt.WindowTitleHint)
113 self.setupUi(self)
114 self._setup()
115
116
117=== modified file 'openlp/core/ui/pluginform.py'
118--- openlp/core/ui/pluginform.py 2015-12-31 22:46:06 +0000
119+++ openlp/core/ui/pluginform.py 2016-01-05 21:38:21 +0000
120@@ -24,7 +24,7 @@
121 """
122 import logging
123
124-from PyQt5 import QtWidgets
125+from PyQt5 import QtCore, QtWidgets
126
127 from openlp.core.common import RegistryProperties, translate
128 from openlp.core.lib import PluginStatus
129@@ -41,7 +41,8 @@
130 """
131 Constructor
132 """
133- super(PluginForm, self).__init__(parent)
134+ super(PluginForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
135+ | QtCore.Qt.WindowTitleHint)
136 self.active_plugin = None
137 self.programatic_change = False
138 self.setupUi(self)
139
140=== modified file 'openlp/core/ui/printserviceform.py'
141--- openlp/core/ui/printserviceform.py 2015-12-31 22:46:06 +0000
142+++ openlp/core/ui/printserviceform.py 2016-01-05 21:38:21 +0000
143@@ -112,7 +112,8 @@
144 """
145 Constructor
146 """
147- super(PrintServiceForm, self).__init__(Registry().get('main_window'))
148+ super(PrintServiceForm, self).__init__(Registry().get('main_window'),
149+ QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
150 self.printer = QtPrintSupport.QPrinter()
151 self.print_dialog = QtPrintSupport.QPrintDialog(self.printer, self)
152 self.document = QtGui.QTextDocument()
153
154=== modified file 'openlp/core/ui/projector/editform.py'
155--- openlp/core/ui/projector/editform.py 2015-12-31 22:46:06 +0000
156+++ openlp/core/ui/projector/editform.py 2016-01-05 21:38:21 +0000
157@@ -144,7 +144,8 @@
158 editProjector = pyqtSignal(object)
159
160 def __init__(self, parent=None, projectordb=None):
161- super(ProjectorEditForm, self).__init__(parent=parent)
162+ super(ProjectorEditForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
163+ | QtCore.Qt.WindowTitleHint)
164 self.projectordb = projectordb
165 self.setupUi(self)
166 self.button_box.accepted.connect(self.accept_me)
167
168=== modified file 'openlp/core/ui/projector/sourceselectform.py'
169--- openlp/core/ui/projector/sourceselectform.py 2015-12-31 22:46:06 +0000
170+++ openlp/core/ui/projector/sourceselectform.py 2016-01-05 21:38:21 +0000
171@@ -236,7 +236,8 @@
172 :param projectordb: ProjectorDB session to use
173 """
174 log.debug('Initializing SourceSelectTabs()')
175- super(SourceSelectTabs, self).__init__(parent)
176+ super(SourceSelectTabs, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
177+ | QtCore.Qt.WindowTitleHint)
178 self.setMinimumWidth(350)
179 self.projectordb = projectordb
180 self.edit = edit
181@@ -385,7 +386,8 @@
182 """
183 log.debug('Initializing SourceSelectSingle()')
184 self.projectordb = projectordb
185- super(SourceSelectSingle, self).__init__(parent)
186+ super(SourceSelectSingle, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
187+ | QtCore.Qt.WindowTitleHint)
188 self.edit = edit
189 if self.edit:
190 title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text')
191
192=== modified file 'openlp/core/ui/serviceitemeditform.py'
193--- openlp/core/ui/serviceitemeditform.py 2015-12-31 22:46:06 +0000
194+++ openlp/core/ui/serviceitemeditform.py 2016-01-05 21:38:21 +0000
195@@ -22,7 +22,7 @@
196 """
197 The service item edit dialog
198 """
199-from PyQt5 import QtWidgets
200+from PyQt5 import QtCore, QtWidgets
201
202 from openlp.core.common import Registry, RegistryProperties
203
204@@ -37,7 +37,8 @@
205 """
206 Constructor
207 """
208- super(ServiceItemEditForm, self).__init__(Registry().get('main_window'))
209+ super(ServiceItemEditForm, self).__init__(Registry().get('main_window'),
210+ QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
211 self.setupUi(self)
212 self.item_list = []
213 self.list_widget.currentRowChanged.connect(self.on_current_row_changed)
214
215=== modified file 'openlp/core/ui/servicenoteform.py'
216--- openlp/core/ui/servicenoteform.py 2015-12-31 22:46:06 +0000
217+++ openlp/core/ui/servicenoteform.py 2016-01-05 21:38:21 +0000
218@@ -22,7 +22,7 @@
219 """
220 The :mod:`~openlp.core.ui.servicenoteform` module contains the `ServiceNoteForm` class.
221 """
222-from PyQt5 import QtWidgets
223+from PyQt5 import QtCore, QtWidgets
224
225 from openlp.core.common import Registry, RegistryProperties, translate
226 from openlp.core.lib import SpellTextEdit
227@@ -37,7 +37,8 @@
228 """
229 Constructor
230 """
231- super(ServiceNoteForm, self).__init__(Registry().get('main_window'))
232+ super(ServiceNoteForm, self).__init__(Registry().get('main_window'),
233+ QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
234 self.setupUi()
235 self.retranslateUi()
236
237
238=== modified file 'openlp/core/ui/settingsform.py'
239--- openlp/core/ui/settingsform.py 2015-12-31 22:46:06 +0000
240+++ openlp/core/ui/settingsform.py 2016-01-05 21:38:21 +0000
241@@ -46,7 +46,8 @@
242 """
243 Registry().register('settings_form', self)
244 Registry().register_function('bootstrap_post_set_up', self.bootstrap_post_set_up)
245- super(SettingsForm, self).__init__(parent)
246+ super(SettingsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
247+ | QtCore.Qt.WindowTitleHint)
248 self.processes = []
249 self.setupUi(self)
250 self.setting_list_widget.currentRowChanged.connect(self.list_item_changed)
251
252=== modified file 'openlp/core/ui/shortcutlistform.py'
253--- openlp/core/ui/shortcutlistform.py 2015-12-31 22:46:06 +0000
254+++ openlp/core/ui/shortcutlistform.py 2016-01-05 21:38:21 +0000
255@@ -44,7 +44,8 @@
256 """
257 Constructor
258 """
259- super(ShortcutListForm, self).__init__(parent)
260+ super(ShortcutListForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
261+ | QtCore.Qt.WindowTitleHint)
262 self.setupUi(self)
263 self.changed_actions = {}
264 self.action_list = ActionList.get_instance()
265
266=== modified file 'openlp/core/ui/starttimeform.py'
267--- openlp/core/ui/starttimeform.py 2015-12-31 22:46:06 +0000
268+++ openlp/core/ui/starttimeform.py 2016-01-05 21:38:21 +0000
269@@ -22,7 +22,7 @@
270 """
271 The actual start time form.
272 """
273-from PyQt5 import QtWidgets
274+from PyQt5 import QtCore, QtWidgets
275
276 from .starttimedialog import Ui_StartTimeDialog
277
278@@ -38,7 +38,8 @@
279 """
280 Constructor
281 """
282- super(StartTimeForm, self).__init__(Registry().get('main_window'))
283+ super(StartTimeForm, self).__init__(Registry().get('main_window'),
284+ QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
285 self.setupUi(self)
286
287 def exec(self):
288
289=== modified file 'openlp/plugins/alerts/forms/alertform.py'
290--- openlp/plugins/alerts/forms/alertform.py 2015-12-31 22:46:06 +0000
291+++ openlp/plugins/alerts/forms/alertform.py 2016-01-05 21:38:21 +0000
292@@ -36,10 +36,11 @@
293 """
294 Initialise the alert form
295 """
296+ super(AlertForm, self).__init__(Registry().get('main_window'),
297+ QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
298 self.manager = plugin.manager
299 self.plugin = plugin
300 self.item_id = None
301- super(AlertForm, self).__init__(Registry().get('main_window'))
302 self.setupUi(self)
303 self.display_button.clicked.connect(self.on_display_clicked)
304 self.display_close_button.clicked.connect(self.on_display_close_clicked)
305
306=== modified file 'openlp/plugins/bibles/forms/booknameform.py'
307--- openlp/plugins/bibles/forms/booknameform.py 2015-12-31 22:46:06 +0000
308+++ openlp/plugins/bibles/forms/booknameform.py 2016-01-05 21:38:21 +0000
309@@ -49,7 +49,8 @@
310 """
311 Constructor
312 """
313- super(BookNameForm, self).__init__(parent)
314+ super(BookNameForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
315+ | QtCore.Qt.WindowTitleHint)
316 self.setupUi(self)
317 self.custom_signals()
318 self.book_names = BibleStrings().BookNames
319
320=== modified file 'openlp/plugins/bibles/forms/editbibleform.py'
321--- openlp/plugins/bibles/forms/editbibleform.py 2015-12-31 22:46:06 +0000
322+++ openlp/plugins/bibles/forms/editbibleform.py 2016-01-05 21:38:21 +0000
323@@ -24,7 +24,7 @@
324 import os
325 import re
326
327-from PyQt5 import QtWidgets
328+from PyQt5 import QtCore, QtWidgets
329
330 from openlp.core.common import RegistryProperties, UiStrings, translate
331 from openlp.core.lib.ui import critical_error_message_box
332@@ -45,7 +45,8 @@
333 """
334 Constructor
335 """
336- super(EditBibleForm, self).__init__(parent)
337+ super(EditBibleForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
338+ | QtCore.Qt.WindowTitleHint)
339 self.media_item = media_item
340 self.book_names = BibleStrings().BookNames
341 self.setupUi(self)
342
343=== modified file 'openlp/plugins/bibles/forms/languageform.py'
344--- openlp/plugins/bibles/forms/languageform.py 2015-12-31 22:46:06 +0000
345+++ openlp/plugins/bibles/forms/languageform.py 2016-01-05 21:38:21 +0000
346@@ -26,6 +26,7 @@
347 import logging
348
349 from PyQt5.QtWidgets import QDialog
350+from PyQt5 import QtCore
351
352 from openlp.core.common import translate
353 from openlp.core.lib.ui import critical_error_message_box
354@@ -46,7 +47,8 @@
355 """
356 Constructor
357 """
358- super(LanguageForm, self).__init__(parent)
359+ super(LanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
360+ | QtCore.Qt.WindowTitleHint)
361 self.setupUi(self)
362
363 def exec(self, bible_name):
364
365=== modified file 'openlp/plugins/custom/forms/editcustomform.py'
366--- openlp/plugins/custom/forms/editcustomform.py 2015-12-31 22:46:06 +0000
367+++ openlp/plugins/custom/forms/editcustomform.py 2016-01-05 21:38:21 +0000
368@@ -22,7 +22,7 @@
369
370 import logging
371
372-from PyQt5 import QtWidgets
373+from PyQt5 import QtCore, QtWidgets
374
375 from openlp.core.common import Registry, translate
376 from openlp.core.lib.ui import critical_error_message_box, find_and_set_in_combo_box
377@@ -44,7 +44,8 @@
378 """
379 Constructor
380 """
381- super(EditCustomForm, self).__init__(parent)
382+ super(EditCustomForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
383+ | QtCore.Qt.WindowTitleHint)
384 self.manager = manager
385 self.media_item = media_item
386 self.setupUi(self)
387
388=== modified file 'openlp/plugins/custom/forms/editcustomslideform.py'
389--- openlp/plugins/custom/forms/editcustomslideform.py 2015-12-31 22:46:06 +0000
390+++ openlp/plugins/custom/forms/editcustomslideform.py 2016-01-05 21:38:21 +0000
391@@ -22,7 +22,7 @@
392
393 import logging
394
395-from PyQt5 import QtWidgets
396+from PyQt5 import QtCore, QtWidgets
397
398 from .editcustomslidedialog import Ui_CustomSlideEditDialog
399
400@@ -39,7 +39,8 @@
401 """
402 Constructor
403 """
404- super(EditCustomSlideForm, self).__init__(parent)
405+ super(EditCustomSlideForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
406+ | QtCore.Qt.WindowTitleHint)
407 self.setupUi(self)
408 # Connecting signals and slots
409 self.insert_button.clicked.connect(self.on_insert_button_clicked)
410
411=== modified file 'openlp/plugins/images/forms/addgroupform.py'
412--- openlp/plugins/images/forms/addgroupform.py 2015-12-31 22:46:06 +0000
413+++ openlp/plugins/images/forms/addgroupform.py 2016-01-05 21:38:21 +0000
414@@ -20,7 +20,7 @@
415 # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
416 ###############################################################################
417
418-from PyQt5 import QtWidgets
419+from PyQt5 import QtCore, QtWidgets
420
421 from openlp.core.common import translate
422 from openlp.core.lib.ui import critical_error_message_box
423@@ -35,7 +35,8 @@
424 """
425 Constructor
426 """
427- super(AddGroupForm, self).__init__(parent)
428+ super(AddGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
429+ | QtCore.Qt.WindowTitleHint)
430 self.setupUi(self)
431
432 def exec(self, clear=True, show_top_level_group=False, selected_group=None):
433
434=== modified file 'openlp/plugins/images/forms/choosegroupform.py'
435--- openlp/plugins/images/forms/choosegroupform.py 2015-12-31 22:46:06 +0000
436+++ openlp/plugins/images/forms/choosegroupform.py 2016-01-05 21:38:21 +0000
437@@ -20,7 +20,7 @@
438 # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
439 ###############################################################################
440
441-from PyQt5 import QtWidgets
442+from PyQt5 import QtCore, QtWidgets
443
444 from openlp.plugins.images.forms.choosegroupdialog import Ui_ChooseGroupDialog
445
446@@ -33,7 +33,8 @@
447 """
448 Constructor
449 """
450- super(ChooseGroupForm, self).__init__(parent)
451+ super(ChooseGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
452+ | QtCore.Qt.WindowTitleHint)
453 self.setupUi(self)
454
455 def exec(self, selected_group=None):
456
457=== modified file 'openlp/plugins/media/forms/mediaclipselectorform.py'
458--- openlp/plugins/media/forms/mediaclipselectorform.py 2015-12-31 22:46:06 +0000
459+++ openlp/plugins/media/forms/mediaclipselectorform.py 2016-01-05 21:38:21 +0000
460@@ -52,7 +52,8 @@
461 """
462 Constructor
463 """
464- super(MediaClipSelectorForm, self).__init__(parent)
465+ super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
466+ | QtCore.Qt.WindowTitleHint)
467 self.vlc_instance = None
468 self.vlc_media_player = None
469 self.vlc_media = None
470
471=== modified file 'openlp/plugins/songs/forms/authorsform.py'
472--- openlp/plugins/songs/forms/authorsform.py 2015-12-31 22:46:06 +0000
473+++ openlp/plugins/songs/forms/authorsform.py 2016-01-05 21:38:21 +0000
474@@ -20,7 +20,7 @@
475 # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
476 ###############################################################################
477
478-from PyQt5 import QtWidgets
479+from PyQt5 import QtCore, QtWidgets
480
481 from openlp.core.lib import translate
482 from openlp.core.lib.ui import critical_error_message_box
483@@ -35,7 +35,8 @@
484 """
485 Set up the screen and common data
486 """
487- super(AuthorsForm, self).__init__(parent)
488+ super(AuthorsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
489+ | QtCore.Qt.WindowTitleHint)
490 self.setupUi(self)
491 self.auto_display_name = False
492 self.first_name_edit.textEdited.connect(self.on_first_name_edited)
493
494=== modified file 'openlp/plugins/songs/forms/editsongform.py'
495--- openlp/plugins/songs/forms/editsongform.py 2015-12-31 22:46:06 +0000
496+++ openlp/plugins/songs/forms/editsongform.py 2016-01-05 21:38:21 +0000
497@@ -55,7 +55,8 @@
498 """
499 Constructor
500 """
501- super(EditSongForm, self).__init__(parent)
502+ super(EditSongForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
503+ | QtCore.Qt.WindowTitleHint)
504 self.media_item = media_item
505 self.song = None
506 # can this be automated?
507
508=== modified file 'openlp/plugins/songs/forms/editverseform.py'
509--- openlp/plugins/songs/forms/editverseform.py 2015-12-31 22:46:06 +0000
510+++ openlp/plugins/songs/forms/editverseform.py 2016-01-05 21:38:21 +0000
511@@ -23,7 +23,7 @@
512 import re
513 import logging
514
515-from PyQt5 import QtGui, QtWidgets
516+from PyQt5 import QtCore, QtGui, QtWidgets
517
518 from openlp.plugins.songs.lib import VerseType
519 from .editversedialog import Ui_EditVerseDialog
520@@ -41,7 +41,8 @@
521 """
522 Constructor
523 """
524- super(EditVerseForm, self).__init__(parent)
525+ super(EditVerseForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
526+ | QtCore.Qt.WindowTitleHint)
527 self.setupUi(self)
528 self.has_single_verse = False
529 self.insert_button.clicked.connect(self.on_insert_button_clicked)
530
531=== modified file 'openlp/plugins/songs/forms/mediafilesform.py'
532--- openlp/plugins/songs/forms/mediafilesform.py 2015-12-31 22:46:06 +0000
533+++ openlp/plugins/songs/forms/mediafilesform.py 2016-01-05 21:38:21 +0000
534@@ -37,7 +37,8 @@
535 log.info('%s MediaFilesForm loaded', __name__)
536
537 def __init__(self, parent):
538- super(MediaFilesForm, self).__init__()
539+ super(MediaFilesForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
540+ | QtCore.Qt.WindowTitleHint)
541 self.setupUi(self)
542
543 def populate_files(self, files):
544
545=== modified file 'openlp/plugins/songs/forms/songbookform.py'
546--- openlp/plugins/songs/forms/songbookform.py 2015-12-31 22:46:06 +0000
547+++ openlp/plugins/songs/forms/songbookform.py 2016-01-05 21:38:21 +0000
548@@ -23,7 +23,7 @@
549 This module contains the song book form
550 """
551
552-from PyQt5 import QtWidgets
553+from PyQt5 import QtCore, QtWidgets
554
555 from openlp.core.lib import translate
556 from openlp.core.lib.ui import critical_error_message_box
557@@ -38,7 +38,8 @@
558 """
559 Constructor
560 """
561- super(SongBookForm, self).__init__(parent)
562+ super(SongBookForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
563+ | QtCore.Qt.WindowTitleHint)
564 self.setupUi(self)
565
566 def exec(self, clear=True):
567
568=== modified file 'openlp/plugins/songs/forms/songmaintenanceform.py'
569--- openlp/plugins/songs/forms/songmaintenanceform.py 2015-12-31 22:46:06 +0000
570+++ openlp/plugins/songs/forms/songmaintenanceform.py 2016-01-05 21:38:21 +0000
571@@ -44,7 +44,8 @@
572 """
573 Constructor
574 """
575- super(SongMaintenanceForm, self).__init__(parent)
576+ super(SongMaintenanceForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
577+ | QtCore.Qt.WindowTitleHint)
578 self.setupUi(self)
579 self.manager = manager
580 self.author_form = AuthorsForm(self)
581
582=== modified file 'openlp/plugins/songs/forms/songselectform.py'
583--- openlp/plugins/songs/forms/songselectform.py 2015-12-31 22:46:06 +0000
584+++ openlp/plugins/songs/forms/songselectform.py 2016-01-05 21:38:21 +0000
585@@ -81,7 +81,8 @@
586 """
587
588 def __init__(self, parent=None, plugin=None, db_manager=None):
589- QtWidgets.QDialog.__init__(self, parent)
590+ QtWidgets.QDialog.__init__(self, parent, QtCore.Qt.WindowSystemMenuHint
591+ | QtCore.Qt.WindowTitleHint)
592 self.plugin = plugin
593 self.db_manager = db_manager
594 self.setup_ui(self)
595
596=== modified file 'openlp/plugins/songs/forms/topicsform.py'
597--- openlp/plugins/songs/forms/topicsform.py 2015-12-31 22:46:06 +0000
598+++ openlp/plugins/songs/forms/topicsform.py 2016-01-05 21:38:21 +0000
599@@ -23,7 +23,7 @@
600 This module contains the topic edit form.
601 """
602
603-from PyQt5 import QtWidgets
604+from PyQt5 import QtCore, QtWidgets
605
606 from openlp.core.lib import translate
607 from openlp.core.lib.ui import critical_error_message_box
608@@ -38,7 +38,8 @@
609 """
610 Constructor
611 """
612- super(TopicsForm, self).__init__(parent)
613+ super(TopicsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
614+ | QtCore.Qt.WindowTitleHint)
615 self.setupUi(self)
616
617 def exec(self, clear=True):
618
619=== modified file 'openlp/plugins/songusage/forms/songusagedeleteform.py'
620--- openlp/plugins/songusage/forms/songusagedeleteform.py 2015-12-31 22:46:06 +0000
621+++ openlp/plugins/songusage/forms/songusagedeleteform.py 2016-01-05 21:38:21 +0000
622@@ -20,7 +20,7 @@
623 # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
624 ###############################################################################
625
626-from PyQt5 import QtWidgets
627+from PyQt5 import QtCore, QtWidgets
628
629 from openlp.core.common import RegistryProperties, translate
630 from openlp.plugins.songusage.lib.db import SongUsageItem
631@@ -36,7 +36,8 @@
632 Constructor
633 """
634 self.manager = manager
635- super(SongUsageDeleteForm, self).__init__(parent)
636+ super(SongUsageDeleteForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
637+ | QtCore.Qt.WindowTitleHint)
638 self.setupUi(self)
639 self.button_box.clicked.connect(self.on_button_box_clicked)
640
641
642=== modified file 'openlp/plugins/songusage/forms/songusagedetailform.py'
643--- openlp/plugins/songusage/forms/songusagedetailform.py 2015-12-31 22:46:06 +0000
644+++ openlp/plugins/songusage/forms/songusagedetailform.py 2016-01-05 21:38:21 +0000
645@@ -23,7 +23,7 @@
646 import logging
647 import os
648
649-from PyQt5 import QtWidgets
650+from PyQt5 import QtCore, QtWidgets
651 from sqlalchemy.sql import and_
652
653 from openlp.core.common import RegistryProperties, Settings, check_directory_exists, translate
654@@ -44,7 +44,8 @@
655 """
656 Initialise the form
657 """
658- super(SongUsageDetailForm, self).__init__(parent)
659+ super(SongUsageDetailForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
660+ | QtCore.Qt.WindowTitleHint)
661 self.plugin = plugin
662 self.setupUi(self)
663
664
665=== added file 'tests/functional/openlp_plugins/songs/test_songformat.py'
666--- tests/functional/openlp_plugins/songs/test_songformat.py 1970-01-01 00:00:00 +0000
667+++ tests/functional/openlp_plugins/songs/test_songformat.py 2016-01-05 21:38:21 +0000
668@@ -0,0 +1,84 @@
669+# -*- coding: utf-8 -*-
670+# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
671+
672+###############################################################################
673+# OpenLP - Open Source Lyrics Projection #
674+# --------------------------------------------------------------------------- #
675+# Copyright (c) 2008-2015 OpenLP Developers #
676+# --------------------------------------------------------------------------- #
677+# This program is free software; you can redistribute it and/or modify it #
678+# under the terms of the GNU General Public License as published by the Free #
679+# Software Foundation; version 2 of the License. #
680+# #
681+# This program is distributed in the hope that it will be useful, but WITHOUT #
682+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
683+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
684+# more details. #
685+# #
686+# You should have received a copy of the GNU General Public License along #
687+# with this program; if not, write to the Free Software Foundation, Inc., 59 #
688+# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
689+###############################################################################
690+"""
691+This module contains tests for the SongFormat class
692+"""
693+from unittest import TestCase
694+
695+from openlp.plugins.songs.lib.importer import SongFormat
696+
697+
698+class TestSongFormat(TestCase):
699+ """
700+ Test the functions in the :class:`SongFormat` class.
701+ """
702+
703+ def test_get_format_list(self):
704+ """
705+ Test that get_format_list() returns all available formats
706+ """
707+ # GIVEN: The SongFormat class
708+ # WHEN: Retrieving the format list
709+ # THEN: All SongFormats should be returned
710+ self.assertEquals(len(SongFormat.get_format_list()), len(SongFormat.__attributes__),
711+ "The returned SongFormats don't match the stored ones")
712+
713+ def test_get_attributed_no_attributes(self):
714+ """
715+ Test that SongFormat.get(song_format) returns all attributes associated with the given song_format
716+ """
717+ # GIVEN: A SongFormat
718+ # WHEN: Retrieving all attributes of a SongFormat
719+ for song_format in SongFormat.get_format_list():
720+ # THEN: All attributes associated with the SongFormat should be returned
721+ self.assertEquals(SongFormat.get(song_format), SongFormat.__attributes__[song_format],
722+ "The returned attributes don't match the stored ones")
723+
724+ def test_get_attributed_single_attribute(self):
725+ """
726+ Test that SongFormat.get(song_format, attribute) returns only one -and the correct- attribute
727+ """
728+ # GIVEN: A SongFormat
729+ for song_format in SongFormat.get_format_list():
730+ # WHEN: Retrieving an attribute that overrides the default values
731+ for attribute in SongFormat.get(song_format).keys():
732+ # THEN: Return the attribute
733+ self.assertEquals(SongFormat.get(song_format, attribute), SongFormat.get(song_format)[attribute],
734+ "The returned attribute doesn't match the stored one")
735+ # WHEN: Retrieving an attribute that was not overridden
736+ for attribute in SongFormat.__defaults__.keys():
737+ if attribute not in SongFormat.get(song_format).keys():
738+ # THEN: Return the default value
739+ self.assertEquals(SongFormat.get(song_format, attribute), SongFormat.__defaults__[attribute],
740+ "The returned attribute does not match the default values stored")
741+
742+ def test_get_attributed_multiple_attributes(self):
743+ """
744+ Test that multiple attributes can be retrieved for a song_format
745+ """
746+ # GIVEN: A SongFormat
747+ # WHEN: Retrieving multiple attributes at the same time
748+ for song_format in SongFormat.get_format_list():
749+ # THEN: Return all attributes that were specified
750+ self.assertEquals(len(SongFormat.get(song_format, 'canDisable', 'availability')), 2,
751+ "Did not return the correct number of attributes when retrieving multiple attributes at once")
752+