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

Proposed by Simon Hanna
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 Approve
Tim Bentley Approve
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.
Revision history for this message
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
Revision history for this message
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

Revision history for this message
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
Revision history for this message
Tim Bentley (trb143) : Posted in a previous version of this proposal
review: Needs Fixing
Revision history for this message
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

Revision history for this message
Tim Bentley (trb143) wrote :

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

review: Approve
Revision history for this message
Tomas Groth (tomasgroth) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2015-05-07 21:29:43 +0000
+++ .bzrignore 2016-01-05 21:38:21 +0000
@@ -43,3 +43,5 @@
43.coverage43.coverage
44cover44cover
45*.kdev445*.kdev4
46./.coveragerc
47./coverage
4648
=== modified file 'openlp/core/ui/aboutform.py'
--- openlp/core/ui/aboutform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/aboutform.py 2016-01-05 21:38:21 +0000
@@ -24,7 +24,7 @@
24"""24"""
25import webbrowser25import webbrowser
2626
27from PyQt5 import QtWidgets27from PyQt5 import QtCore, QtWidgets
2828
29from openlp.core.lib import translate29from openlp.core.lib import translate
30from openlp.core.utils import get_application_version30from openlp.core.utils import get_application_version
@@ -40,7 +40,8 @@
40 """40 """
41 Do some initialisation stuff41 Do some initialisation stuff
42 """42 """
43 super(AboutForm, self).__init__(parent)43 super(AboutForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
44 | QtCore.Qt.WindowTitleHint)
44 self._setup()45 self._setup()
4546
46 def _setup(self):47 def _setup(self):
4748
=== modified file 'openlp/core/ui/exceptionform.py'
--- openlp/core/ui/exceptionform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/exceptionform.py 2016-01-05 21:38:21 +0000
@@ -89,7 +89,8 @@
89 """89 """
90 Constructor.90 Constructor.
91 """91 """
92 super(ExceptionForm, self).__init__()92 super(ExceptionForm, self).__init__(None, QtCore.Qt.WindowSystemMenuHint
93 | QtCore.Qt.WindowTitleHint)
93 self.setupUi(self)94 self.setupUi(self)
94 self.settings_section = 'crashreport'95 self.settings_section = 'crashreport'
95 self.report_text = '**OpenLP Bug Report**\n' \96 self.report_text = '**OpenLP Bug Report**\n' \
9697
=== modified file 'openlp/core/ui/filerenameform.py'
--- openlp/core/ui/filerenameform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/filerenameform.py 2016-01-05 21:38:21 +0000
@@ -23,7 +23,7 @@
23The file rename dialog.23The file rename dialog.
24"""24"""
2525
26from PyQt5 import QtWidgets26from PyQt5 import QtCore, QtWidgets
2727
28from .filerenamedialog import Ui_FileRenameDialog28from .filerenamedialog import Ui_FileRenameDialog
2929
@@ -38,7 +38,8 @@
38 """38 """
39 Constructor39 Constructor
40 """40 """
41 super(FileRenameForm, self).__init__(Registry().get('main_window'))41 super(FileRenameForm, self).__init__(Registry().get('main_window'),
42 QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
42 self._setup()43 self._setup()
4344
44 def _setup(self):45 def _setup(self):
4546
=== modified file 'openlp/core/ui/firsttimelanguageform.py'
--- openlp/core/ui/firsttimelanguageform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/firsttimelanguageform.py 2016-01-05 21:38:21 +0000
@@ -22,7 +22,7 @@
22"""22"""
23The language selection dialog.23The language selection dialog.
24"""24"""
25from PyQt5 import QtWidgets25from PyQt5 import QtCore, QtWidgets
2626
27from openlp.core.lib.ui import create_action27from openlp.core.lib.ui import create_action
28from openlp.core.utils import LanguageManager28from openlp.core.utils import LanguageManager
@@ -37,7 +37,8 @@
37 """37 """
38 Constructor38 Constructor
39 """39 """
40 super(FirstTimeLanguageForm, self).__init__(parent)40 super(FirstTimeLanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
41 | QtCore.Qt.WindowTitleHint)
41 self.setupUi(self)42 self.setupUi(self)
42 self.qm_list = LanguageManager.get_qm_list()43 self.qm_list = LanguageManager.get_qm_list()
43 self.language_combo_box.addItem('Autodetect')44 self.language_combo_box.addItem('Autodetect')
4445
=== modified file 'openlp/core/ui/formattingtagform.py'
--- openlp/core/ui/formattingtagform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/formattingtagform.py 2016-01-05 21:38:21 +0000
@@ -25,7 +25,7 @@
25Base Tags cannot be changed.25Base Tags cannot be changed.
26"""26"""
2727
28from PyQt5 import QtWidgets28from PyQt5 import QtCore, QtWidgets
2929
30from openlp.core.common import translate30from openlp.core.common import translate
31from openlp.core.lib import FormattingTags31from openlp.core.lib import FormattingTags
@@ -51,7 +51,8 @@
51 """51 """
52 Constructor52 Constructor
53 """53 """
54 super(FormattingTagForm, self).__init__(parent)54 super(FormattingTagForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
55 | QtCore.Qt.WindowTitleHint)
55 self.setupUi(self)56 self.setupUi(self)
56 self._setup()57 self._setup()
5758
5859
=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/pluginform.py 2016-01-05 21:38:21 +0000
@@ -24,7 +24,7 @@
24"""24"""
25import logging25import logging
2626
27from PyQt5 import QtWidgets27from PyQt5 import QtCore, QtWidgets
2828
29from openlp.core.common import RegistryProperties, translate29from openlp.core.common import RegistryProperties, translate
30from openlp.core.lib import PluginStatus30from openlp.core.lib import PluginStatus
@@ -41,7 +41,8 @@
41 """41 """
42 Constructor42 Constructor
43 """43 """
44 super(PluginForm, self).__init__(parent)44 super(PluginForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
45 | QtCore.Qt.WindowTitleHint)
45 self.active_plugin = None46 self.active_plugin = None
46 self.programatic_change = False47 self.programatic_change = False
47 self.setupUi(self)48 self.setupUi(self)
4849
=== modified file 'openlp/core/ui/printserviceform.py'
--- openlp/core/ui/printserviceform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/printserviceform.py 2016-01-05 21:38:21 +0000
@@ -112,7 +112,8 @@
112 """112 """
113 Constructor113 Constructor
114 """114 """
115 super(PrintServiceForm, self).__init__(Registry().get('main_window'))115 super(PrintServiceForm, self).__init__(Registry().get('main_window'),
116 QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
116 self.printer = QtPrintSupport.QPrinter()117 self.printer = QtPrintSupport.QPrinter()
117 self.print_dialog = QtPrintSupport.QPrintDialog(self.printer, self)118 self.print_dialog = QtPrintSupport.QPrintDialog(self.printer, self)
118 self.document = QtGui.QTextDocument()119 self.document = QtGui.QTextDocument()
119120
=== modified file 'openlp/core/ui/projector/editform.py'
--- openlp/core/ui/projector/editform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/projector/editform.py 2016-01-05 21:38:21 +0000
@@ -144,7 +144,8 @@
144 editProjector = pyqtSignal(object)144 editProjector = pyqtSignal(object)
145145
146 def __init__(self, parent=None, projectordb=None):146 def __init__(self, parent=None, projectordb=None):
147 super(ProjectorEditForm, self).__init__(parent=parent)147 super(ProjectorEditForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
148 | QtCore.Qt.WindowTitleHint)
148 self.projectordb = projectordb149 self.projectordb = projectordb
149 self.setupUi(self)150 self.setupUi(self)
150 self.button_box.accepted.connect(self.accept_me)151 self.button_box.accepted.connect(self.accept_me)
151152
=== modified file 'openlp/core/ui/projector/sourceselectform.py'
--- openlp/core/ui/projector/sourceselectform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/projector/sourceselectform.py 2016-01-05 21:38:21 +0000
@@ -236,7 +236,8 @@
236 :param projectordb: ProjectorDB session to use236 :param projectordb: ProjectorDB session to use
237 """237 """
238 log.debug('Initializing SourceSelectTabs()')238 log.debug('Initializing SourceSelectTabs()')
239 super(SourceSelectTabs, self).__init__(parent)239 super(SourceSelectTabs, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
240 | QtCore.Qt.WindowTitleHint)
240 self.setMinimumWidth(350)241 self.setMinimumWidth(350)
241 self.projectordb = projectordb242 self.projectordb = projectordb
242 self.edit = edit243 self.edit = edit
@@ -385,7 +386,8 @@
385 """386 """
386 log.debug('Initializing SourceSelectSingle()')387 log.debug('Initializing SourceSelectSingle()')
387 self.projectordb = projectordb388 self.projectordb = projectordb
388 super(SourceSelectSingle, self).__init__(parent)389 super(SourceSelectSingle, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
390 | QtCore.Qt.WindowTitleHint)
389 self.edit = edit391 self.edit = edit
390 if self.edit:392 if self.edit:
391 title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text')393 title = translate('OpenLP.SourceSelectForm', 'Edit Projector Source Text')
392394
=== modified file 'openlp/core/ui/serviceitemeditform.py'
--- openlp/core/ui/serviceitemeditform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/serviceitemeditform.py 2016-01-05 21:38:21 +0000
@@ -22,7 +22,7 @@
22"""22"""
23The service item edit dialog23The service item edit dialog
24"""24"""
25from PyQt5 import QtWidgets25from PyQt5 import QtCore, QtWidgets
2626
27from openlp.core.common import Registry, RegistryProperties27from openlp.core.common import Registry, RegistryProperties
2828
@@ -37,7 +37,8 @@
37 """37 """
38 Constructor38 Constructor
39 """39 """
40 super(ServiceItemEditForm, self).__init__(Registry().get('main_window'))40 super(ServiceItemEditForm, self).__init__(Registry().get('main_window'),
41 QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
41 self.setupUi(self)42 self.setupUi(self)
42 self.item_list = []43 self.item_list = []
43 self.list_widget.currentRowChanged.connect(self.on_current_row_changed)44 self.list_widget.currentRowChanged.connect(self.on_current_row_changed)
4445
=== modified file 'openlp/core/ui/servicenoteform.py'
--- openlp/core/ui/servicenoteform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/servicenoteform.py 2016-01-05 21:38:21 +0000
@@ -22,7 +22,7 @@
22"""22"""
23The :mod:`~openlp.core.ui.servicenoteform` module contains the `ServiceNoteForm` class.23The :mod:`~openlp.core.ui.servicenoteform` module contains the `ServiceNoteForm` class.
24"""24"""
25from PyQt5 import QtWidgets25from PyQt5 import QtCore, QtWidgets
2626
27from openlp.core.common import Registry, RegistryProperties, translate27from openlp.core.common import Registry, RegistryProperties, translate
28from openlp.core.lib import SpellTextEdit28from openlp.core.lib import SpellTextEdit
@@ -37,7 +37,8 @@
37 """37 """
38 Constructor38 Constructor
39 """39 """
40 super(ServiceNoteForm, self).__init__(Registry().get('main_window'))40 super(ServiceNoteForm, self).__init__(Registry().get('main_window'),
41 QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
41 self.setupUi()42 self.setupUi()
42 self.retranslateUi()43 self.retranslateUi()
4344
4445
=== modified file 'openlp/core/ui/settingsform.py'
--- openlp/core/ui/settingsform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/settingsform.py 2016-01-05 21:38:21 +0000
@@ -46,7 +46,8 @@
46 """46 """
47 Registry().register('settings_form', self)47 Registry().register('settings_form', self)
48 Registry().register_function('bootstrap_post_set_up', self.bootstrap_post_set_up)48 Registry().register_function('bootstrap_post_set_up', self.bootstrap_post_set_up)
49 super(SettingsForm, self).__init__(parent)49 super(SettingsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
50 | QtCore.Qt.WindowTitleHint)
50 self.processes = []51 self.processes = []
51 self.setupUi(self)52 self.setupUi(self)
52 self.setting_list_widget.currentRowChanged.connect(self.list_item_changed)53 self.setting_list_widget.currentRowChanged.connect(self.list_item_changed)
5354
=== modified file 'openlp/core/ui/shortcutlistform.py'
--- openlp/core/ui/shortcutlistform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/shortcutlistform.py 2016-01-05 21:38:21 +0000
@@ -44,7 +44,8 @@
44 """44 """
45 Constructor45 Constructor
46 """46 """
47 super(ShortcutListForm, self).__init__(parent)47 super(ShortcutListForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
48 | QtCore.Qt.WindowTitleHint)
48 self.setupUi(self)49 self.setupUi(self)
49 self.changed_actions = {}50 self.changed_actions = {}
50 self.action_list = ActionList.get_instance()51 self.action_list = ActionList.get_instance()
5152
=== modified file 'openlp/core/ui/starttimeform.py'
--- openlp/core/ui/starttimeform.py 2015-12-31 22:46:06 +0000
+++ openlp/core/ui/starttimeform.py 2016-01-05 21:38:21 +0000
@@ -22,7 +22,7 @@
22"""22"""
23The actual start time form.23The actual start time form.
24"""24"""
25from PyQt5 import QtWidgets25from PyQt5 import QtCore, QtWidgets
2626
27from .starttimedialog import Ui_StartTimeDialog27from .starttimedialog import Ui_StartTimeDialog
2828
@@ -38,7 +38,8 @@
38 """38 """
39 Constructor39 Constructor
40 """40 """
41 super(StartTimeForm, self).__init__(Registry().get('main_window'))41 super(StartTimeForm, self).__init__(Registry().get('main_window'),
42 QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
42 self.setupUi(self)43 self.setupUi(self)
4344
44 def exec(self):45 def exec(self):
4546
=== modified file 'openlp/plugins/alerts/forms/alertform.py'
--- openlp/plugins/alerts/forms/alertform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/alerts/forms/alertform.py 2016-01-05 21:38:21 +0000
@@ -36,10 +36,11 @@
36 """36 """
37 Initialise the alert form37 Initialise the alert form
38 """38 """
39 super(AlertForm, self).__init__(Registry().get('main_window'),
40 QtCore.Qt.WindowSystemMenuHint | QtCore.Qt.WindowTitleHint)
39 self.manager = plugin.manager41 self.manager = plugin.manager
40 self.plugin = plugin42 self.plugin = plugin
41 self.item_id = None43 self.item_id = None
42 super(AlertForm, self).__init__(Registry().get('main_window'))
43 self.setupUi(self)44 self.setupUi(self)
44 self.display_button.clicked.connect(self.on_display_clicked)45 self.display_button.clicked.connect(self.on_display_clicked)
45 self.display_close_button.clicked.connect(self.on_display_close_clicked)46 self.display_close_button.clicked.connect(self.on_display_close_clicked)
4647
=== modified file 'openlp/plugins/bibles/forms/booknameform.py'
--- openlp/plugins/bibles/forms/booknameform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/bibles/forms/booknameform.py 2016-01-05 21:38:21 +0000
@@ -49,7 +49,8 @@
49 """49 """
50 Constructor50 Constructor
51 """51 """
52 super(BookNameForm, self).__init__(parent)52 super(BookNameForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
53 | QtCore.Qt.WindowTitleHint)
53 self.setupUi(self)54 self.setupUi(self)
54 self.custom_signals()55 self.custom_signals()
55 self.book_names = BibleStrings().BookNames56 self.book_names = BibleStrings().BookNames
5657
=== modified file 'openlp/plugins/bibles/forms/editbibleform.py'
--- openlp/plugins/bibles/forms/editbibleform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/bibles/forms/editbibleform.py 2016-01-05 21:38:21 +0000
@@ -24,7 +24,7 @@
24import os24import os
25import re25import re
2626
27from PyQt5 import QtWidgets27from PyQt5 import QtCore, QtWidgets
2828
29from openlp.core.common import RegistryProperties, UiStrings, translate29from openlp.core.common import RegistryProperties, UiStrings, translate
30from openlp.core.lib.ui import critical_error_message_box30from openlp.core.lib.ui import critical_error_message_box
@@ -45,7 +45,8 @@
45 """45 """
46 Constructor46 Constructor
47 """47 """
48 super(EditBibleForm, self).__init__(parent)48 super(EditBibleForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
49 | QtCore.Qt.WindowTitleHint)
49 self.media_item = media_item50 self.media_item = media_item
50 self.book_names = BibleStrings().BookNames51 self.book_names = BibleStrings().BookNames
51 self.setupUi(self)52 self.setupUi(self)
5253
=== modified file 'openlp/plugins/bibles/forms/languageform.py'
--- openlp/plugins/bibles/forms/languageform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/bibles/forms/languageform.py 2016-01-05 21:38:21 +0000
@@ -26,6 +26,7 @@
26import logging26import logging
2727
28from PyQt5.QtWidgets import QDialog28from PyQt5.QtWidgets import QDialog
29from PyQt5 import QtCore
2930
30from openlp.core.common import translate31from openlp.core.common import translate
31from openlp.core.lib.ui import critical_error_message_box32from openlp.core.lib.ui import critical_error_message_box
@@ -46,7 +47,8 @@
46 """47 """
47 Constructor48 Constructor
48 """49 """
49 super(LanguageForm, self).__init__(parent)50 super(LanguageForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
51 | QtCore.Qt.WindowTitleHint)
50 self.setupUi(self)52 self.setupUi(self)
5153
52 def exec(self, bible_name):54 def exec(self, bible_name):
5355
=== modified file 'openlp/plugins/custom/forms/editcustomform.py'
--- openlp/plugins/custom/forms/editcustomform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/custom/forms/editcustomform.py 2016-01-05 21:38:21 +0000
@@ -22,7 +22,7 @@
2222
23import logging23import logging
2424
25from PyQt5 import QtWidgets25from PyQt5 import QtCore, QtWidgets
2626
27from openlp.core.common import Registry, translate27from openlp.core.common import Registry, translate
28from openlp.core.lib.ui import critical_error_message_box, find_and_set_in_combo_box28from openlp.core.lib.ui import critical_error_message_box, find_and_set_in_combo_box
@@ -44,7 +44,8 @@
44 """44 """
45 Constructor45 Constructor
46 """46 """
47 super(EditCustomForm, self).__init__(parent)47 super(EditCustomForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
48 | QtCore.Qt.WindowTitleHint)
48 self.manager = manager49 self.manager = manager
49 self.media_item = media_item50 self.media_item = media_item
50 self.setupUi(self)51 self.setupUi(self)
5152
=== modified file 'openlp/plugins/custom/forms/editcustomslideform.py'
--- openlp/plugins/custom/forms/editcustomslideform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/custom/forms/editcustomslideform.py 2016-01-05 21:38:21 +0000
@@ -22,7 +22,7 @@
2222
23import logging23import logging
2424
25from PyQt5 import QtWidgets25from PyQt5 import QtCore, QtWidgets
2626
27from .editcustomslidedialog import Ui_CustomSlideEditDialog27from .editcustomslidedialog import Ui_CustomSlideEditDialog
2828
@@ -39,7 +39,8 @@
39 """39 """
40 Constructor40 Constructor
41 """41 """
42 super(EditCustomSlideForm, self).__init__(parent)42 super(EditCustomSlideForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
43 | QtCore.Qt.WindowTitleHint)
43 self.setupUi(self)44 self.setupUi(self)
44 # Connecting signals and slots45 # Connecting signals and slots
45 self.insert_button.clicked.connect(self.on_insert_button_clicked)46 self.insert_button.clicked.connect(self.on_insert_button_clicked)
4647
=== modified file 'openlp/plugins/images/forms/addgroupform.py'
--- openlp/plugins/images/forms/addgroupform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/images/forms/addgroupform.py 2016-01-05 21:38:21 +0000
@@ -20,7 +20,7 @@
20# Temple Place, Suite 330, Boston, MA 02111-1307 USA #20# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
21###############################################################################21###############################################################################
2222
23from PyQt5 import QtWidgets23from PyQt5 import QtCore, QtWidgets
2424
25from openlp.core.common import translate25from openlp.core.common import translate
26from openlp.core.lib.ui import critical_error_message_box26from openlp.core.lib.ui import critical_error_message_box
@@ -35,7 +35,8 @@
35 """35 """
36 Constructor36 Constructor
37 """37 """
38 super(AddGroupForm, self).__init__(parent)38 super(AddGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
39 | QtCore.Qt.WindowTitleHint)
39 self.setupUi(self)40 self.setupUi(self)
4041
41 def exec(self, clear=True, show_top_level_group=False, selected_group=None):42 def exec(self, clear=True, show_top_level_group=False, selected_group=None):
4243
=== modified file 'openlp/plugins/images/forms/choosegroupform.py'
--- openlp/plugins/images/forms/choosegroupform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/images/forms/choosegroupform.py 2016-01-05 21:38:21 +0000
@@ -20,7 +20,7 @@
20# Temple Place, Suite 330, Boston, MA 02111-1307 USA #20# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
21###############################################################################21###############################################################################
2222
23from PyQt5 import QtWidgets23from PyQt5 import QtCore, QtWidgets
2424
25from openlp.plugins.images.forms.choosegroupdialog import Ui_ChooseGroupDialog25from openlp.plugins.images.forms.choosegroupdialog import Ui_ChooseGroupDialog
2626
@@ -33,7 +33,8 @@
33 """33 """
34 Constructor34 Constructor
35 """35 """
36 super(ChooseGroupForm, self).__init__(parent)36 super(ChooseGroupForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
37 | QtCore.Qt.WindowTitleHint)
37 self.setupUi(self)38 self.setupUi(self)
3839
39 def exec(self, selected_group=None):40 def exec(self, selected_group=None):
4041
=== modified file 'openlp/plugins/media/forms/mediaclipselectorform.py'
--- openlp/plugins/media/forms/mediaclipselectorform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/media/forms/mediaclipselectorform.py 2016-01-05 21:38:21 +0000
@@ -52,7 +52,8 @@
52 """52 """
53 Constructor53 Constructor
54 """54 """
55 super(MediaClipSelectorForm, self).__init__(parent)55 super(MediaClipSelectorForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
56 | QtCore.Qt.WindowTitleHint)
56 self.vlc_instance = None57 self.vlc_instance = None
57 self.vlc_media_player = None58 self.vlc_media_player = None
58 self.vlc_media = None59 self.vlc_media = None
5960
=== modified file 'openlp/plugins/songs/forms/authorsform.py'
--- openlp/plugins/songs/forms/authorsform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/forms/authorsform.py 2016-01-05 21:38:21 +0000
@@ -20,7 +20,7 @@
20# Temple Place, Suite 330, Boston, MA 02111-1307 USA #20# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
21###############################################################################21###############################################################################
2222
23from PyQt5 import QtWidgets23from PyQt5 import QtCore, QtWidgets
2424
25from openlp.core.lib import translate25from openlp.core.lib import translate
26from openlp.core.lib.ui import critical_error_message_box26from openlp.core.lib.ui import critical_error_message_box
@@ -35,7 +35,8 @@
35 """35 """
36 Set up the screen and common data36 Set up the screen and common data
37 """37 """
38 super(AuthorsForm, self).__init__(parent)38 super(AuthorsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
39 | QtCore.Qt.WindowTitleHint)
39 self.setupUi(self)40 self.setupUi(self)
40 self.auto_display_name = False41 self.auto_display_name = False
41 self.first_name_edit.textEdited.connect(self.on_first_name_edited)42 self.first_name_edit.textEdited.connect(self.on_first_name_edited)
4243
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2016-01-05 21:38:21 +0000
@@ -55,7 +55,8 @@
55 """55 """
56 Constructor56 Constructor
57 """57 """
58 super(EditSongForm, self).__init__(parent)58 super(EditSongForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
59 | QtCore.Qt.WindowTitleHint)
59 self.media_item = media_item60 self.media_item = media_item
60 self.song = None61 self.song = None
61 # can this be automated?62 # can this be automated?
6263
=== modified file 'openlp/plugins/songs/forms/editverseform.py'
--- openlp/plugins/songs/forms/editverseform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/forms/editverseform.py 2016-01-05 21:38:21 +0000
@@ -23,7 +23,7 @@
23import re23import re
24import logging24import logging
2525
26from PyQt5 import QtGui, QtWidgets26from PyQt5 import QtCore, QtGui, QtWidgets
2727
28from openlp.plugins.songs.lib import VerseType28from openlp.plugins.songs.lib import VerseType
29from .editversedialog import Ui_EditVerseDialog29from .editversedialog import Ui_EditVerseDialog
@@ -41,7 +41,8 @@
41 """41 """
42 Constructor42 Constructor
43 """43 """
44 super(EditVerseForm, self).__init__(parent)44 super(EditVerseForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
45 | QtCore.Qt.WindowTitleHint)
45 self.setupUi(self)46 self.setupUi(self)
46 self.has_single_verse = False47 self.has_single_verse = False
47 self.insert_button.clicked.connect(self.on_insert_button_clicked)48 self.insert_button.clicked.connect(self.on_insert_button_clicked)
4849
=== modified file 'openlp/plugins/songs/forms/mediafilesform.py'
--- openlp/plugins/songs/forms/mediafilesform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/forms/mediafilesform.py 2016-01-05 21:38:21 +0000
@@ -37,7 +37,8 @@
37 log.info('%s MediaFilesForm loaded', __name__)37 log.info('%s MediaFilesForm loaded', __name__)
3838
39 def __init__(self, parent):39 def __init__(self, parent):
40 super(MediaFilesForm, self).__init__()40 super(MediaFilesForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
41 | QtCore.Qt.WindowTitleHint)
41 self.setupUi(self)42 self.setupUi(self)
4243
43 def populate_files(self, files):44 def populate_files(self, files):
4445
=== modified file 'openlp/plugins/songs/forms/songbookform.py'
--- openlp/plugins/songs/forms/songbookform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/forms/songbookform.py 2016-01-05 21:38:21 +0000
@@ -23,7 +23,7 @@
23This module contains the song book form23This module contains the song book form
24"""24"""
2525
26from PyQt5 import QtWidgets26from PyQt5 import QtCore, QtWidgets
2727
28from openlp.core.lib import translate28from openlp.core.lib import translate
29from openlp.core.lib.ui import critical_error_message_box29from openlp.core.lib.ui import critical_error_message_box
@@ -38,7 +38,8 @@
38 """38 """
39 Constructor39 Constructor
40 """40 """
41 super(SongBookForm, self).__init__(parent)41 super(SongBookForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
42 | QtCore.Qt.WindowTitleHint)
42 self.setupUi(self)43 self.setupUi(self)
4344
44 def exec(self, clear=True):45 def exec(self, clear=True):
4546
=== modified file 'openlp/plugins/songs/forms/songmaintenanceform.py'
--- openlp/plugins/songs/forms/songmaintenanceform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/forms/songmaintenanceform.py 2016-01-05 21:38:21 +0000
@@ -44,7 +44,8 @@
44 """44 """
45 Constructor45 Constructor
46 """46 """
47 super(SongMaintenanceForm, self).__init__(parent)47 super(SongMaintenanceForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
48 | QtCore.Qt.WindowTitleHint)
48 self.setupUi(self)49 self.setupUi(self)
49 self.manager = manager50 self.manager = manager
50 self.author_form = AuthorsForm(self)51 self.author_form = AuthorsForm(self)
5152
=== modified file 'openlp/plugins/songs/forms/songselectform.py'
--- openlp/plugins/songs/forms/songselectform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/forms/songselectform.py 2016-01-05 21:38:21 +0000
@@ -81,7 +81,8 @@
81 """81 """
8282
83 def __init__(self, parent=None, plugin=None, db_manager=None):83 def __init__(self, parent=None, plugin=None, db_manager=None):
84 QtWidgets.QDialog.__init__(self, parent)84 QtWidgets.QDialog.__init__(self, parent, QtCore.Qt.WindowSystemMenuHint
85 | QtCore.Qt.WindowTitleHint)
85 self.plugin = plugin86 self.plugin = plugin
86 self.db_manager = db_manager87 self.db_manager = db_manager
87 self.setup_ui(self)88 self.setup_ui(self)
8889
=== modified file 'openlp/plugins/songs/forms/topicsform.py'
--- openlp/plugins/songs/forms/topicsform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/forms/topicsform.py 2016-01-05 21:38:21 +0000
@@ -23,7 +23,7 @@
23This module contains the topic edit form.23This module contains the topic edit form.
24"""24"""
2525
26from PyQt5 import QtWidgets26from PyQt5 import QtCore, QtWidgets
2727
28from openlp.core.lib import translate28from openlp.core.lib import translate
29from openlp.core.lib.ui import critical_error_message_box29from openlp.core.lib.ui import critical_error_message_box
@@ -38,7 +38,8 @@
38 """38 """
39 Constructor39 Constructor
40 """40 """
41 super(TopicsForm, self).__init__(parent)41 super(TopicsForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
42 | QtCore.Qt.WindowTitleHint)
42 self.setupUi(self)43 self.setupUi(self)
4344
44 def exec(self, clear=True):45 def exec(self, clear=True):
4546
=== modified file 'openlp/plugins/songusage/forms/songusagedeleteform.py'
--- openlp/plugins/songusage/forms/songusagedeleteform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songusage/forms/songusagedeleteform.py 2016-01-05 21:38:21 +0000
@@ -20,7 +20,7 @@
20# Temple Place, Suite 330, Boston, MA 02111-1307 USA #20# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
21###############################################################################21###############################################################################
2222
23from PyQt5 import QtWidgets23from PyQt5 import QtCore, QtWidgets
2424
25from openlp.core.common import RegistryProperties, translate25from openlp.core.common import RegistryProperties, translate
26from openlp.plugins.songusage.lib.db import SongUsageItem26from openlp.plugins.songusage.lib.db import SongUsageItem
@@ -36,7 +36,8 @@
36 Constructor36 Constructor
37 """37 """
38 self.manager = manager38 self.manager = manager
39 super(SongUsageDeleteForm, self).__init__(parent)39 super(SongUsageDeleteForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
40 | QtCore.Qt.WindowTitleHint)
40 self.setupUi(self)41 self.setupUi(self)
41 self.button_box.clicked.connect(self.on_button_box_clicked)42 self.button_box.clicked.connect(self.on_button_box_clicked)
4243
4344
=== modified file 'openlp/plugins/songusage/forms/songusagedetailform.py'
--- openlp/plugins/songusage/forms/songusagedetailform.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songusage/forms/songusagedetailform.py 2016-01-05 21:38:21 +0000
@@ -23,7 +23,7 @@
23import logging23import logging
24import os24import os
2525
26from PyQt5 import QtWidgets26from PyQt5 import QtCore, QtWidgets
27from sqlalchemy.sql import and_27from sqlalchemy.sql import and_
2828
29from openlp.core.common import RegistryProperties, Settings, check_directory_exists, translate29from openlp.core.common import RegistryProperties, Settings, check_directory_exists, translate
@@ -44,7 +44,8 @@
44 """44 """
45 Initialise the form45 Initialise the form
46 """46 """
47 super(SongUsageDetailForm, self).__init__(parent)47 super(SongUsageDetailForm, self).__init__(parent, QtCore.Qt.WindowSystemMenuHint
48 | QtCore.Qt.WindowTitleHint)
48 self.plugin = plugin49 self.plugin = plugin
49 self.setupUi(self)50 self.setupUi(self)
5051
5152
=== added file 'tests/functional/openlp_plugins/songs/test_songformat.py'
--- tests/functional/openlp_plugins/songs/test_songformat.py 1970-01-01 00:00:00 +0000
+++ tests/functional/openlp_plugins/songs/test_songformat.py 2016-01-05 21:38:21 +0000
@@ -0,0 +1,84 @@
1# -*- coding: utf-8 -*-
2# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
3
4###############################################################################
5# OpenLP - Open Source Lyrics Projection #
6# --------------------------------------------------------------------------- #
7# Copyright (c) 2008-2015 OpenLP Developers #
8# --------------------------------------------------------------------------- #
9# This program is free software; you can redistribute it and/or modify it #
10# under the terms of the GNU General Public License as published by the Free #
11# Software Foundation; version 2 of the License. #
12# #
13# This program is distributed in the hope that it will be useful, but WITHOUT #
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
15# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
16# more details. #
17# #
18# You should have received a copy of the GNU General Public License along #
19# with this program; if not, write to the Free Software Foundation, Inc., 59 #
20# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
21###############################################################################
22"""
23This module contains tests for the SongFormat class
24"""
25from unittest import TestCase
26
27from openlp.plugins.songs.lib.importer import SongFormat
28
29
30class TestSongFormat(TestCase):
31 """
32 Test the functions in the :class:`SongFormat` class.
33 """
34
35 def test_get_format_list(self):
36 """
37 Test that get_format_list() returns all available formats
38 """
39 # GIVEN: The SongFormat class
40 # WHEN: Retrieving the format list
41 # THEN: All SongFormats should be returned
42 self.assertEquals(len(SongFormat.get_format_list()), len(SongFormat.__attributes__),
43 "The returned SongFormats don't match the stored ones")
44
45 def test_get_attributed_no_attributes(self):
46 """
47 Test that SongFormat.get(song_format) returns all attributes associated with the given song_format
48 """
49 # GIVEN: A SongFormat
50 # WHEN: Retrieving all attributes of a SongFormat
51 for song_format in SongFormat.get_format_list():
52 # THEN: All attributes associated with the SongFormat should be returned
53 self.assertEquals(SongFormat.get(song_format), SongFormat.__attributes__[song_format],
54 "The returned attributes don't match the stored ones")
55
56 def test_get_attributed_single_attribute(self):
57 """
58 Test that SongFormat.get(song_format, attribute) returns only one -and the correct- attribute
59 """
60 # GIVEN: A SongFormat
61 for song_format in SongFormat.get_format_list():
62 # WHEN: Retrieving an attribute that overrides the default values
63 for attribute in SongFormat.get(song_format).keys():
64 # THEN: Return the attribute
65 self.assertEquals(SongFormat.get(song_format, attribute), SongFormat.get(song_format)[attribute],
66 "The returned attribute doesn't match the stored one")
67 # WHEN: Retrieving an attribute that was not overridden
68 for attribute in SongFormat.__defaults__.keys():
69 if attribute not in SongFormat.get(song_format).keys():
70 # THEN: Return the default value
71 self.assertEquals(SongFormat.get(song_format, attribute), SongFormat.__defaults__[attribute],
72 "The returned attribute does not match the default values stored")
73
74 def test_get_attributed_multiple_attributes(self):
75 """
76 Test that multiple attributes can be retrieved for a song_format
77 """
78 # GIVEN: A SongFormat
79 # WHEN: Retrieving multiple attributes at the same time
80 for song_format in SongFormat.get_format_list():
81 # THEN: Return all attributes that were specified
82 self.assertEquals(len(SongFormat.get(song_format, 'canDisable', 'availability')), 2,
83 "Did not return the correct number of attributes when retrieving multiple attributes at once")
84