openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #23929
[Merge] lp:~sam92/openlp/footer-copyright into lp:openlp
Samuel Mehrbrodt has proposed merging lp:~sam92/openlp/footer-copyright into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~sam92/openlp/footer-copyright/+merge/225641
Always add the copyright symbol in the footer
The user should not have to insert it in every song.
lp:~sam92/openlp/footer-copyright (revision 2397)
[SUCCESS] http://ci.openlp.org/job/Branch-01-Pull/510/
[SUCCESS] http://ci.openlp.org/job/Branch-02-Functional-Tests/468/
[SUCCESS] http://ci.openlp.org/job/Branch-03-Interface-Tests/413/
[FAILURE] http://ci.openlp.org/job/Branch-04-Windows_Tests/372/
[SUCCESS] http://ci.openlp.org/job/Branch-05a-Code_Analysis/245/
[SUCCESS] http://ci.openlp.org/job/Branch-05b-Test_Coverage/119/
--
https://code.launchpad.net/~sam92/openlp/footer-copyright/+merge/225641
Your team OpenLP Core is requested to review the proposed merge of lp:~sam92/openlp/footer-copyright into lp:openlp.
=== modified file 'openlp/plugins/songs/forms/editsongdialog.py'
--- openlp/plugins/songs/forms/editsongdialog.py 2014-05-03 15:01:43 +0000
+++ openlp/plugins/songs/forms/editsongdialog.py 2014-07-04 11:33:21 +0000
@@ -218,12 +218,12 @@
self.rights_layout.setObjectName('rights_layout')
self.copyright_layout = QtGui.QHBoxLayout()
self.copyright_layout.setObjectName('copyright_layout')
+ self.copyright_label = QtGui.QLabel(self.rights_group_box)
+ self.copyright_label.setObjectName('copyright_label')
+ self.copyright_layout.addWidget(self.copyright_label)
self.copyright_edit = QtGui.QLineEdit(self.rights_group_box)
self.copyright_edit.setObjectName('copyright_edit')
self.copyright_layout.addWidget(self.copyright_edit)
- self.copyright_insert_button = QtGui.QToolButton(self.rights_group_box)
- self.copyright_insert_button.setObjectName('copyright_insert_button')
- self.copyright_layout.addWidget(self.copyright_insert_button)
self.rights_layout.addLayout(self.copyright_layout)
self.ccli_layout = QtGui.QHBoxLayout()
self.ccli_layout.setObjectName('ccli_layout')
@@ -318,7 +318,7 @@
self.theme_group_box.setTitle(UiStrings().Theme)
self.theme_add_button.setText(translate('SongsPlugin.EditSongForm', 'New &Theme'))
self.rights_group_box.setTitle(translate('SongsPlugin.EditSongForm', 'Copyright Information'))
- self.copyright_insert_button.setText(SongStrings.CopyrightSymbol)
+ self.copyright_label.setText(translate('SongsPlugin.EditSongForm', 'Copyright:'))
self.ccli_label.setText(UiStrings().CCLINumberLabel)
self.comments_group_box.setTitle(translate('SongsPlugin.EditSongForm', 'Comments'))
self.song_tab_widget.setTabText(self.song_tab_widget.indexOf(self.theme_tab),
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2014-05-07 20:30:52 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2014-07-04 11:33:21 +0000
@@ -75,7 +75,6 @@
self.topic_add_button.clicked.connect(self.on_topic_add_button_clicked)
self.topic_remove_button.clicked.connect(self.on_topic_remove_button_clicked)
self.topics_list_view.itemClicked.connect(self.on_topic_list_view_clicked)
- self.copyright_insert_button.clicked.connect(self.on_copyright_insert_button_triggered)
self.verse_add_button.clicked.connect(self.on_verse_add_button_clicked)
self.verse_list_widget.doubleClicked.connect(self.on_verse_edit_button_clicked)
self.verse_edit_button.clicked.connect(self.on_verse_edit_button_clicked)
@@ -796,18 +795,6 @@
label_text = self.not_all_verses_used_warning
self.warning_label.setText(label_text)
- def on_copyright_insert_button_triggered(self):
- """
- Copyright insert button pressed
- """
- text = self.copyright_edit.text()
- pos = self.copyright_edit.cursorPosition()
- sign = SongStrings.CopyrightSymbol
- text = text[:pos] + sign + text[pos:]
- self.copyright_edit.setText(text)
- self.copyright_edit.setFocus()
- self.copyright_edit.setCursorPosition(pos + len(sign))
-
def on_maintenance_button_clicked(self):
"""
Maintenance button pressed
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2014-05-13 09:53:02 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2014-07-04 11:33:21 +0000
@@ -506,7 +506,8 @@
if authors_translation:
item.raw_footer.append("%s: %s" % (AuthorType.Types[AuthorType.Translation],
create_separated_list(authors_translation)))
- item.raw_footer.append(song.copyright)
+ if song.copyright:
+ item.raw_footer.append('%s %s' % (SongStrings.CopyrightSymbol, song.copyright))
if self.display_songbook and song.book:
item.raw_footer.append("%s #%s" % (song.book.name, song.song_number))
if Settings().value('core/ccli number'):
=== modified file 'openlp/plugins/songs/lib/upgrade.py'
--- openlp/plugins/songs/lib/upgrade.py 2014-04-27 16:03:24 +0000
+++ openlp/plugins/songs/lib/upgrade.py 2014-07-04 11:33:21 +0000
@@ -27,8 +27,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
"""
-The :mod:`upgrade` module provides a way for the database and schema that is the
-backend for the Songs plugin
+The :mod:`upgrade` module provides a way for the database and schema that is the backend for the Songs plugin
"""
import logging
@@ -39,7 +38,7 @@
from openlp.core.lib.db import get_upgrade_op
log = logging.getLogger(__name__)
-__version__ = 4
+__version__ = 5
def upgrade_1(session, metadata):
@@ -119,3 +118,17 @@
op.rename_table('authors_songs_tmp', 'authors_songs')
except OperationalError:
log.info('Upgrade 4 has already been run')
+
+
+def upgrade_5(session, metadata):
+ """
+ Version 5 upgrade
+
+ This upgrade removes all hard-coded copyright symbols from the copyright field in the songs.
+ The copyright symbol is now being added directly in the footer.
+ """
+ try:
+ op = get_upgrade_op(session)
+ op.execute('UPDATE songs SET copyright=TRIM(REPLACE(copyright, "©", ""))')
+ except OperationalError:
+ log.info('Upgrade 5 has already been run')
=== modified file 'tests/functional/openlp_plugins/songs/test_mediaitem.py'
--- tests/functional/openlp_plugins/songs/test_mediaitem.py 2014-05-21 19:55:16 +0000
+++ tests/functional/openlp_plugins/songs/test_mediaitem.py 2014-07-04 11:33:21 +0000
@@ -58,7 +58,7 @@
author_list = self.media_item.generate_footer(service_item, mock_song)
# THEN: I get the following Array returned
- self.assertEqual(service_item.raw_footer, ['My Song', 'Written by: my author', 'My copyright'],
+ self.assertEqual(service_item.raw_footer, ['My Song', 'Written by: my author', '© My copyright'],
'The array should be returned correctly with a song, one author and copyright')
self.assertEqual(author_list, ['my author'],
'The author list should be returned correctly with one author')
@@ -97,7 +97,7 @@
# THEN: I get the following Array returned
self.assertEqual(service_item.raw_footer, ['My Song', 'Words: another author', 'Music: my author',
- 'Translation: translator', 'My copyright'],
+ 'Translation: translator', '© My copyright'],
'The array should be returned correctly with a song, two authors and copyright')
self.assertEqual(author_list, ['another author', 'my author', 'translator'],
'The author list should be returned correctly with two authors')
@@ -117,7 +117,7 @@
self.media_item.generate_footer(service_item, mock_song)
# THEN: I get the following Array returned
- self.assertEqual(service_item.raw_footer, ['My Song', 'My copyright', 'CCLI License: 1234'],
+ self.assertEqual(service_item.raw_footer, ['My Song', '© My copyright', 'CCLI License: 1234'],
'The array should be returned correctly with a song, an author, copyright and ccli')
# WHEN: I amend the CCLI value
@@ -125,7 +125,7 @@
self.media_item.generate_footer(service_item, mock_song)
# THEN: I would get an amended footer string
- self.assertEqual(service_item.raw_footer, ['My Song', 'My copyright', 'CCLI License: 4321'],
+ self.assertEqual(service_item.raw_footer, ['My Song', '© My copyright', 'CCLI License: 4321'],
'The array should be returned correctly with a song, an author, copyright and amended ccli')
def build_song_footer_base_songbook_test(self):
@@ -145,14 +145,14 @@
self.media_item.generate_footer(service_item, mock_song)
# THEN: The songbook should not be in the footer
- self.assertEqual(service_item.raw_footer, ['My Song', 'My copyright'])
+ self.assertEqual(service_item.raw_footer, ['My Song', '© My copyright'])
# WHEN: I activate the "display songbook" option
self.media_item.display_songbook = True
self.media_item.generate_footer(service_item, mock_song)
# THEN: The songbook should be in the footer
- self.assertEqual(service_item.raw_footer, ['My Song', 'My copyright', 'My songbook #12'])
+ self.assertEqual(service_item.raw_footer, ['My Song', '© My copyright', 'My songbook #12'])
def authors_match_test(self):
"""
Follow ups