← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~sam92/openlp/title-slide into lp:openlp

 

Samuel Mehrbrodt has proposed merging lp:~sam92/openlp/title-slide into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~sam92/openlp/title-slide/+merge/215137

Add an option for a title slide.

Test will come, but I would appreciate some feedback before.
-- 
https://code.launchpad.net/~sam92/openlp/title-slide/+merge/215137
Your team OpenLP Core is requested to review the proposed merge of lp:~sam92/openlp/title-slide into lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py	2014-03-18 20:36:02 +0000
+++ openlp/core/lib/serviceitem.py	2014-04-10 10:24:49 +0000
@@ -108,6 +108,9 @@
     ``CanAutoStartForLive``
             The capability to ignore the do not play if display blank flag.
 
+    ``HasTitleSlide``
+            The capability to show a title slide
+
     """
     CanPreview = 1
     CanEdit = 2
@@ -125,6 +128,7 @@
     CanWordSplit = 14
     HasBackgroundAudio = 15
     CanAutoStartForLive = 16
+    HasTitleSlide = 17
 
 
 class ServiceItem(RegistryProperties):
@@ -228,9 +232,16 @@
         log.debug('Render called')
         self._display_frames = []
         self.bg_image_bytes = None
+        self.title = clean_tags(self.title)
         if not provides_own_theme_data:
             self.renderer.set_item_theme(self.theme)
             self.theme_data, self.main, self.footer = self.renderer.pre_render()
+        if self.is_capable(ItemCapabilities.HasTitleSlide):
+            self._display_frames.append({'title': 'Title',
+                                         'text': self.title,
+                                         'html': self.title,
+                                         'verseTag': 'T'
+                                         })
         if self.service_item_type == ServiceItemType.Text:
             log.debug('Formatting slides: %s' % self.title)
             # Save rendered pages to this dict. In the case that a slide is used twice we can use the pages saved to
@@ -256,7 +267,6 @@
             pass
         else:
             log.error('Invalid value renderer: %s' % self.service_item_type)
-        self.title = clean_tags(self.title)
         # The footer should never be None, but to be compatible with a few
         # nightly builds between 1.9.4 and 1.9.5, we have to correct this to
         # avoid tracebacks.

=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py	2014-03-20 19:10:31 +0000
+++ openlp/core/ui/maindisplay.py	2014-04-10 10:24:49 +0000
@@ -44,7 +44,7 @@
 from PyQt4.phonon import Phonon
 
 from openlp.core.common import Registry, RegistryProperties, OpenLPMixin, Settings, translate
-from openlp.core.lib import ServiceItem, ImageSource, build_html, expand_tags, image_to_byte
+from openlp.core.lib import ServiceItem, ItemCapabilities, ImageSource, build_html, expand_tags, image_to_byte
 from openlp.core.lib.theme import BackgroundType
 
 from openlp.core.lib import ScreenList

=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py	2014-03-21 21:38:08 +0000
+++ openlp/plugins/songs/lib/mediaitem.py	2014-04-10 10:24:49 +0000
@@ -125,6 +125,7 @@
         self.search_as_you_type = Settings().value(self.settings_section + '/search as type')
         self.update_service_on_edit = Settings().value(self.settings_section + '/update service on edit')
         self.add_song_from_service = Settings().value(self.settings_section + '/add song from service',)
+        self.display_title_slide = Settings().value(self.settings_section + '/display title slide',)
 
     def retranslateUi(self):
         self.search_text_label.setText('%s:' % UiStrings().Search)
@@ -413,6 +414,8 @@
         service_item.add_capability(ItemCapabilities.OnLoadUpdate)
         service_item.add_capability(ItemCapabilities.AddIfNewItem)
         service_item.add_capability(ItemCapabilities.CanSoftBreak)
+        if self.display_title_slide:
+            service_item.add_capability(ItemCapabilities.HasTitleSlide)
         song = self.plugin.manager.get_object(Song, item_id)
         service_item.theme = song.theme_name
         service_item.edit_id = item_id

=== modified file 'openlp/plugins/songs/lib/songstab.py'
--- openlp/plugins/songs/lib/songstab.py	2014-03-08 19:58:58 +0000
+++ openlp/plugins/songs/lib/songstab.py	2014-04-10 10:24:49 +0000
@@ -59,6 +59,9 @@
         self.add_from_service_check_box = QtGui.QCheckBox(self.mode_group_box)
         self.add_from_service_check_box.setObjectName('add_from_service_check_box')
         self.mode_layout.addWidget(self.add_from_service_check_box)
+        self.title_slide_check_box = QtGui.QCheckBox(self.mode_group_box)
+        self.title_slide_check_box.setObjectName('title_slide_check_box')
+        self.mode_layout.addWidget(self.title_slide_check_box)
         self.left_layout.addWidget(self.mode_group_box)
         self.left_layout.addStretch()
         self.right_layout.addStretch()
@@ -66,6 +69,7 @@
         self.tool_bar_active_check_box.stateChanged.connect(self.on_tool_bar_active_check_box_changed)
         self.update_on_edit_check_box.stateChanged.connect(self.on_update_on_edit_check_box_changed)
         self.add_from_service_check_box.stateChanged.connect(self.on_add_from_service_check_box_changed)
+        self.title_slide_check_box.stateChanged.connect(self.on_title_slide_check_box_changed)
 
     def retranslateUi(self):
         self.mode_group_box.setTitle(translate('SongsPlugin.SongsTab', 'Songs Mode'))
@@ -75,6 +79,7 @@
         self.update_on_edit_check_box.setText(translate('SongsPlugin.SongsTab', 'Update service from song edit'))
         self.add_from_service_check_box.setText(translate('SongsPlugin.SongsTab',
                                                           'Import missing songs from service files'))
+        self.title_slide_check_box.setText(translate('SongsPlugin.SongsTab', 'Add a title slide'))
 
     def on_search_as_type_check_box_changed(self, check_state):
         self.song_search = (check_state == QtCore.Qt.Checked)
@@ -88,6 +93,9 @@
     def on_add_from_service_check_box_changed(self, check_state):
         self.update_load = (check_state == QtCore.Qt.Checked)
 
+    def on_title_slide_check_box_changed(self, check_state):
+        self.title_slide = (check_state == QtCore.Qt.Checked)
+
     def load(self):
         settings = Settings()
         settings.beginGroup(self.settings_section)
@@ -95,6 +103,7 @@
         self.tool_bar = settings.value('display songbar')
         self.update_edit = settings.value('update service on edit')
         self.update_load = settings.value('add song from service')
+        self.title_slide = settings.value('display title slide')
         self.search_as_type_check_box.setChecked(self.song_search)
         self.tool_bar_active_check_box.setChecked(self.tool_bar)
         self.update_on_edit_check_box.setChecked(self.update_edit)
@@ -108,6 +117,7 @@
         settings.setValue('display songbar', self.tool_bar)
         settings.setValue('update service on edit', self.update_edit)
         settings.setValue('add song from service', self.update_load)
+        settings.setValue('display title slide', self.title_slide)
         settings.endGroup()
         if self.tab_visited:
             self.settings_form.register_post_process('songs_config_updated')

=== modified file 'openlp/plugins/songs/songsplugin.py'
--- openlp/plugins/songs/songsplugin.py	2014-03-21 21:38:08 +0000
+++ openlp/plugins/songs/songsplugin.py	2014-04-10 10:24:49 +0000
@@ -62,6 +62,7 @@
     'songs/update service on edit': False,
     'songs/search as type': False,
     'songs/add song from service': True,
+    'songs/display title slide': False,
     'songs/display songbar': True,
     'songs/last directory import': '',
     'songs/last directory export': '',