openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #25340
[Merge] lp:~trb143/openlp/bug-1404638 into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/bug-1404638 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
Bug #1404638 in OpenLP: "Default formatting tag "break" does not work anymore"
https://bugs.launchpad.net/openlp/+bug/1404638
For more details, see:
https://code.launchpad.net/~trb143/openlp/bug-1404638/+merge/245314
Update code to 2.2 from 2.1 so translators can get working!
Fix spelling error in field name
Fix enlargement of icons in media plugin.
Fix bug for {br} only tag.
lp:~trb143/openlp/bug-1404638 (revision 2459)
[SUCCESS] http://ci.openlp.org/job/Branch-01-Pull/831/
[SUCCESS] http://ci.openlp.org/job/Branch-02-Functional-Tests/763/
[SUCCESS] http://ci.openlp.org/job/Branch-03-Interface-Tests/709/
Traceback (most recent call last):
--
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/bug-1404638 into lp:openlp.
=== modified file 'openlp/core/common/uistrings.py'
--- openlp/core/common/uistrings.py 2014-10-09 20:30:07 +0000
+++ openlp/core/common/uistrings.py 2014-12-22 17:46:12 +0000
@@ -115,7 +115,7 @@
self.NISs = translate('OpenLP.Ui', 'No Item Selected', 'Singular')
self.NISp = translate('OpenLP.Ui', 'No Items Selected', 'Plural')
self.OLPV2 = translate('OpenLP.Ui', 'OpenLP 2')
- self.OLPV2x = translate('OpenLP.Ui', 'OpenLP 2.1')
+ self.OLPV2x = translate('OpenLP.Ui', 'OpenLP 2.2')
self.OpenLPStart = translate('OpenLP.Ui', 'OpenLP is already running. Do you wish to continue?')
self.OpenService = translate('OpenLP.Ui', 'Open service.')
self.PlaySlidesInLoop = translate('OpenLP.Ui', 'Play Slides in Loop')
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2014-03-21 21:38:08 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2014-12-22 17:46:12 +0000
@@ -96,7 +96,6 @@
def retranslateUi(self):
"""
-
"""
self.search_text_label.setText('%s:' % UiStrings().Search)
self.search_text_button.setText(UiStrings().Search)
@@ -134,6 +133,7 @@
# Called to redisplay the custom list screen edith from a search
# or from the exit of the Custom edit dialog. If remote editing is
# active trigger it and clean up so it will not update again.
+ self.check_search_result()
def on_new_click(self):
"""
=== modified file 'openlp/plugins/media/lib/mediaitem.py'
--- openlp/plugins/media/lib/mediaitem.py 2014-09-08 21:08:49 +0000
+++ openlp/plugins/media/lib/mediaitem.py 2014-12-22 17:46:12 +0000
@@ -29,7 +29,6 @@
import logging
import os
-from datetime import time
from PyQt4 import QtCore, QtGui
@@ -126,18 +125,18 @@
Adds buttons to the start of the header bar.
"""
if 'vlc' in get_media_players()[0]:
- diable_optical_button_text = False
+ disable_optical_button_text = False
optical_button_text = translate('MediaPlugin.MediaItem', 'Load CD/DVD')
optical_button_tooltip = translate('MediaPlugin.MediaItem', 'Load CD/DVD')
else:
- diable_optical_button_text = True
+ disable_optical_button_text = True
optical_button_text = translate('MediaPlugin.MediaItem', 'Load CD/DVD')
optical_button_tooltip = translate('MediaPlugin.MediaItem',
'Load CD/DVD - only supported when VLC is installed and enabled')
self.load_optical = self.toolbar.add_toolbar_action('load_optical', icon=OPTICAL_ICON, text=optical_button_text,
tooltip=optical_button_tooltip,
triggers=self.on_load_optical)
- if diable_optical_button_text:
+ if disable_optical_button_text:
self.load_optical.setDisabled(True)
def add_end_header_bar(self):
@@ -282,7 +281,6 @@
Initialize media item.
"""
self.list_view.clear()
- self.list_view.setIconSize(QtCore.QSize(88, 50))
self.service_path = os.path.join(AppLocation.get_section_data_path(self.settings_section), 'thumbnails')
check_directory_exists(self.service_path)
self.load_list(Settings().value(self.settings_section + '/media files'))
=== modified file 'openlp/plugins/remotes/lib/httprouter.py'
--- openlp/plugins/remotes/lib/httprouter.py 2014-11-25 15:00:27 +0000
+++ openlp/plugins/remotes/lib/httprouter.py 2014-12-22 17:46:12 +0000
@@ -306,9 +306,9 @@
Translate various strings in the mobile app.
"""
self.template_vars = {
- 'app_title': translate('RemotePlugin.Mobile', 'OpenLP 2.1 Remote'),
- 'stage_title': translate('RemotePlugin.Mobile', 'OpenLP 2.1 Stage View'),
- 'live_title': translate('RemotePlugin.Mobile', 'OpenLP 2.1 Live View'),
+ 'app_title': translate('RemotePlugin.Mobile', 'OpenLP 2.2 Remote'),
+ 'stage_title': translate('RemotePlugin.Mobile', 'OpenLP 2.2 Stage View'),
+ 'live_title': translate('RemotePlugin.Mobile', 'OpenLP 2.2 Live View'),
'service_manager': translate('RemotePlugin.Mobile', 'Service Manager'),
'slide_controller': translate('RemotePlugin.Mobile', 'Slide Controller'),
'alerts': translate('RemotePlugin.Mobile', 'Alerts'),
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2014-10-27 12:58:59 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2014-12-22 17:46:12 +0000
@@ -265,7 +265,7 @@
return False
return True
- def _validate_tags(self, tags):
+ def _validate_tags(self, tags, first_time=True):
"""
Validates a list of tags
Deletes the first affiliated tag pair which is located side by side in the list
@@ -277,6 +277,12 @@
:param tags: A list of tags
:return: True if the function can't find any mismatched tags. Else False.
"""
+ if first_time:
+ fixed_tags = []
+ for i in range(len(tags)):
+ if tags[i] != '{br}':
+ fixed_tags.append(tags[i])
+ tags = fixed_tags
if len(tags) == 0:
return True
if len(tags) % 2 != 0:
@@ -284,7 +290,7 @@
for i in range(len(tags)-1):
if tags[i+1] == "{/" + tags[i][1:]:
del tags[i:i+2]
- return self._validate_tags(tags)
+ return self._validate_tags(tags, False)
return False
def _process_lyrics(self):
=== modified file 'tests/functional/openlp_core_utils/test_utils.py'
--- tests/functional/openlp_core_utils/test_utils.py 2014-11-07 09:41:37 +0000
+++ tests/functional/openlp_core_utils/test_utils.py 2014-12-22 17:46:12 +0000
@@ -382,7 +382,7 @@
mocked_page_object = MagicMock()
mock_urlopen.return_value = mocked_page_object
fake_url = 'this://is.a.fake/url'
- user_agent_header = ('User-Agent', 'OpenLP/2.1.0')
+ user_agent_header = ('User-Agent', 'OpenLP/2.2.0')
# WHEN: The get_web_page() method is called
returned_page = get_web_page(fake_url, header=user_agent_header)
=== added file 'tests/functional/openlp_plugins/songs/test_editsongform.py'
--- tests/functional/openlp_plugins/songs/test_editsongform.py 1970-01-01 00:00:00 +0000
+++ tests/functional/openlp_plugins/songs/test_editsongform.py 2014-12-22 17:46:12 +0000
@@ -0,0 +1,57 @@
+"""
+This module contains tests for the lib submodule of the Songs plugin.
+"""
+from unittest import TestCase
+
+from PyQt4 import QtCore, QtGui
+
+from openlp.core.common import Registry, Settings
+from openlp.core.lib import ServiceItem
+from openlp.plugins.songs.forms.editsongform import EditSongForm
+from openlp.plugins.songs.lib.db import AuthorType
+from tests.functional import patch, MagicMock
+from tests.helpers.testmixin import TestMixin
+
+
+class TestEditSongForm(TestCase, TestMixin):
+ """
+ Test the functions in the :mod:`lib` module.
+ """
+ def setUp(self):
+ """
+ Set up the components need for all tests.
+ """
+ Registry.create()
+ Registry().register('service_list', MagicMock())
+ Registry().register('main_window', MagicMock())
+ with patch('openlp.plugins.songs.forms.editsongform.EditSongForm.__init__', return_value=None):
+ self.edit_song_form = EditSongForm(None, MagicMock(), MagicMock())
+ self.setup_application()
+ self.build_settings()
+ QtCore.QLocale.setDefault(QtCore.QLocale('en_GB'))
+
+ def tearDown(self):
+ """
+ Delete all the C++ objects at the end so that we don't have a segfault
+ """
+ self.destroy_settings()
+
+ def validate_matching_tags_test(self):
+ # Given a set of tags
+ tags = ['{r}', '{/r}', '{bl}', '{/bl}', '{su}', '{/su}']
+
+ # WHEN we validate them
+ valid = self.edit_song_form._validate_tags(tags)
+
+ # THEN they should be valid
+ self.assertTrue(valid, "The tags list should be valid")
+
+ def validate_nonmatching_tags_test(self):
+ # Given a set of tags
+ tags = ['{r}', '{/r}', '{bl}', '{/bl}', '{br}', '{su}', '{/su}']
+
+ # WHEN we validate them
+ valid = self.edit_song_form._validate_tags(tags)
+
+ # THEN they should be valid
+ self.assertTrue(valid, "The tags list should be valid")
Follow ups