openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #29691
[Merge] lp:~richie-the-g/openlp/sec-global-option into lp:openlp
Richard Graham has proposed merging lp:~richie-the-g/openlp/sec-global-option into lp:openlp.
Requested reviews:
Tim Bentley (trb143)
For more details, see:
https://code.launchpad.net/~richie-the-g/openlp/sec-global-option/+merge/294977
Added option to put an end character at the end of a song or Bible passage. Added option to show the copyright footer of a song or Bible passage on all slides, the first shown slide, or the final slide of an item. All options are in the specific plugin configuration tabs in 'Configure OpenLP'; end character as a text box and footer as a dropdown box. Not included is the 'Custom Slides' plugin; this is due to the fact that the user can already specify whether or not to show the footer, and if a user wants to put a 'tag' onto the end of an item, they can easily type it in themselves!
--
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2016-05-05 03:57:04 +0000
+++ openlp/core/lib/serviceitem.py 2016-05-17 21:10:14 +0000
@@ -267,6 +267,9 @@
'html': html_data.replace(' ', ' '),
'verseTag': verse_tag
})
+ if hasattr(self, 'name') and ((self.name == 'songs') or (self.name == 'bibles')):
+ display_at_end = "<br>" + (Settings().value(self.name + '/end character'))
+ self._display_frames[(len(self._display_frames)) - 1]['html'] += display_at_end
elif self.service_item_type == ServiceItemType.Image or self.service_item_type == ServiceItemType.Command:
pass
else:
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2016-05-02 08:05:47 +0000
+++ openlp/core/ui/maindisplay.py 2016-05-17 21:10:14 +0000
@@ -471,8 +471,6 @@
html = build_html(self.service_item, self.screen, self.is_live, background, image_bytes,
plugins=self.plugin_manager.plugins)
self.web_view.setHtml(html)
- if service_item.foot_text:
- self.footer(service_item.foot_text)
# if was hidden keep it hidden
if self.hide_mode and self.is_live and not service_item.is_media():
if Settings().value('core/auto unblank'):
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2016-05-05 03:57:04 +0000
+++ openlp/core/ui/slidecontroller.py 2016-05-17 21:10:14 +0000
@@ -167,6 +167,7 @@
self.panel = QtWidgets.QWidget(self.main_window.control_splitter)
self.slide_list = {}
self.slide_count = 0
+ self.item_slide_count = 0
self.slide_image = None
self.controller_width = -1
# Layout for holding panel
@@ -889,6 +890,7 @@
else:
row += 1
self.slide_list[str(row)] = row - 1
+ self.item_slide_count = 0 # How many slides of the current item have been shown
else:
row += 1
self.slide_list[str(row)] = row - 1
@@ -896,6 +898,7 @@
if not self.service_item.is_command() and frame_number == slide_no:
self.service_item.bg_image_bytes = \
self.image_manager.get_image_bytes(frame['path'], ImageSource.ImagePlugin)
+
self.preview_widget.replace_service_item(self.service_item, width, slide_no)
self.enable_tool_bar(self.service_item)
# Pass to display for viewing.
@@ -1105,6 +1108,23 @@
to_display = self.service_item.get_rendered_frame(row)
if self.service_item.is_text():
self.display.text(to_display, row != old_selected_row)
+ if (self.service_item.name == 'songs') or (self.service_item.name == 'bibles'):
+ if Settings().value(self.service_item.name + '/info on end') == 1:
+ if self.item_slide_count == 0:
+ self.display.footer(self.service_item.foot_text)
+ else:
+ self.display.footer('')
+ elif Settings().value(self.service_item.name + '/info on end') == 2:
+ if row == (len(self.service_item._display_frames)-1):
+ self.display.footer(self.service_item.foot_text)
+ else:
+ self.display.footer('')
+ else:
+ self.display.footer(self.service_item.foot_text)
+ elif self.service_item.foot_text:
+ self.display.footer(self.service_item.foot_text)
+ else:
+ self.display.footer('')
else:
if start:
self.display.build_html(self.service_item, to_display)
@@ -1155,6 +1175,7 @@
self.slide_image.setDevicePixelRatio(self.main_window.devicePixelRatio())
self.slide_preview.setPixmap(self.slide_image)
self.slide_count += 1
+ self.item_slide_count += 1
def grab_maindisplay(self):
"""
=== modified file 'openlp/plugins/bibles/bibleplugin.py'
--- openlp/plugins/bibles/bibleplugin.py 2016-03-31 16:34:22 +0000
+++ openlp/plugins/bibles/bibleplugin.py 2016-05-17 21:10:14 +0000
@@ -59,7 +59,9 @@
'bibles/range separator': '',
'bibles/list separator': '',
'bibles/end separator': '',
- 'bibles/last directory import': ''
+ 'bibles/last directory import': '',
+ 'bibles/end character': '',
+ 'bibles/info on end': 0 # 0: Show on all slides; 1: show on first shown; 2: show on last slide
}
=== modified file 'openlp/plugins/bibles/lib/biblestab.py'
--- openlp/plugins/bibles/lib/biblestab.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/bibles/lib/biblestab.py 2016-05-17 21:10:14 +0000
@@ -127,6 +127,25 @@
self.language_selection_combo_box.addItems(['', '', ''])
self.language_selection_layout.addWidget(self.language_selection_label)
self.language_selection_layout.addWidget(self.language_selection_combo_box)
+
+ self.end_settings_group_box = QtWidgets.QGroupBox(self.left_column)
+ self.end_settings_group_box.setObjectName('end_settings_group_box')
+ self.end_settings_layout = QtWidgets.QFormLayout(self.end_settings_group_box)
+ self.end_settings_layout.setObjectName('end_settings_layout')
+ self.end_character_label = QtWidgets.QLabel(self.end_settings_group_box)
+ self.end_character_label.setObjectName('end_character_label')
+ self.end_character_line_edit = QtWidgets.QLineEdit(self.end_settings_group_box)
+ self.end_character_line_edit.setObjectName('end_character_line_edit')
+ self.end_character_line_edit.setMaxLength(1)
+ self.end_settings_layout.addRow(self.end_character_label, self.end_character_line_edit)
+ self.info_on_end_label = QtWidgets.QLabel(self.end_settings_group_box)
+ self.info_on_end_label.setObjectName('info_on_end_label')
+ self.info_on_end_combo_box = QtWidgets.QComboBox(self.end_settings_group_box)
+ self.info_on_end_combo_box.setObjectName('info_on_end_combo_box')
+ self.info_on_end_combo_box.addItems(['', '', ''])
+ self.end_settings_layout.addRow(self.info_on_end_label, self.info_on_end_combo_box)
+
+ self.right_layout.addWidget(self.end_settings_group_box)
self.right_layout.addWidget(self.language_selection_group_box)
self.left_layout.addStretch()
self.right_layout.addStretch()
@@ -151,6 +170,7 @@
self.end_separator_line_edit.editingFinished.connect(self.on_end_separator_line_edit_finished)
Registry().register_function('theme_update_list', self.update_theme_list)
self.language_selection_combo_box.activated.connect(self.on_language_selection_combo_box_changed)
+ self.info_on_end_combo_box.activated.connect(self.on_info_on_end_combo_box_changed)
def retranslateUi(self):
self.verse_display_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'Verse Display'))
@@ -194,6 +214,12 @@
LanguageSelection.Application, translate('BiblesPlugin.BiblesTab', 'Application Language'))
self.language_selection_combo_box.setItemText(
LanguageSelection.English, translate('BiblesPlugin.BiblesTab', 'English'))
+ self.end_settings_group_box.setTitle(translate('BiblesPlugin.BiblesTab', 'End slide behaviour'))
+ self.end_character_label.setText(translate('BiblesPlugin.BiblesTab', 'Bible passage end character:'))
+ self.info_on_end_label.setText(translate('BiblesPlugin.BiblesTab', 'Show copyright info on:'))
+ self.info_on_end_combo_box.setItemText(0, translate('BiblesPlugin.BiblesTab', 'All slides (Recommended)'))
+ self.info_on_end_combo_box.setItemText(1, translate('BiblesPlugin.BiblesTab', 'First shown slide only'))
+ self.info_on_end_combo_box.setItemText(2, translate('BiblesPlugin.BiblesTab', 'Final slide of Bible passage only'))
def on_bible_theme_combo_box_changed(self):
self.bible_theme = self.bible_theme_combo_box.currentText()
@@ -302,6 +328,9 @@
self.end_separator_line_edit.setText(get_reference_separator('sep_e_default'))
self.end_separator_line_edit.setPalette(self.get_grey_text_palette(True))
+ def on_info_on_end_combo_box_changed(self):
+ self.info_on_end = self.info_on_end_combo_box.currentIndex()
+
def load(self):
settings = Settings()
settings.beginGroup(self.settings_section)
@@ -355,6 +384,9 @@
self.end_separator_check_box.setChecked(True)
self.language_selection = settings.value('book name language')
self.language_selection_combo_box.setCurrentIndex(self.language_selection)
+ self.end_character_line_edit.setText(settings.value('end character'))
+ self.info_on_end = settings.value('info on end')
+ self.info_on_end_combo_box.setCurrentIndex(self.info_on_end)
settings.endGroup()
def save(self):
@@ -386,6 +418,8 @@
if self.language_selection != settings.value('book name language'):
settings.setValue('book name language', self.language_selection)
self.settings_form.register_post_process('bibles_load_list')
+ settings.setValue('end character', self.end_character_line_edit.text())
+ settings.setValue('info on end', self.info_on_end)
settings.endGroup()
if self.tab_visited:
self.settings_form.register_post_process('bibles_config_updated')
=== modified file 'openlp/plugins/songs/lib/songstab.py'
--- openlp/plugins/songs/lib/songstab.py 2015-12-31 22:46:06 +0000
+++ openlp/plugins/songs/lib/songstab.py 2016-05-17 21:10:14 +0000
@@ -57,6 +57,23 @@
self.display_copyright_check_box.setObjectName('copyright_check_box')
self.mode_layout.addWidget(self.display_copyright_check_box)
self.left_layout.addWidget(self.mode_group_box)
+ self.end_settings_group_box = QtWidgets.QGroupBox(self.left_column)
+ self.end_settings_group_box.setObjectName('end_settings_group_box')
+ self.end_settings_layout = QtWidgets.QFormLayout(self.end_settings_group_box)
+ self.end_settings_layout.setObjectName('end_settings_layout')
+ self.end_character_label = QtWidgets.QLabel(self.end_settings_group_box)
+ self.end_character_label.setObjectName('end_character_label')
+ self.end_character_line_edit = QtWidgets.QLineEdit(self.end_settings_group_box)
+ self.end_character_line_edit.setObjectName('end_character_line_edit')
+ self.end_character_line_edit.setMaxLength(1)
+ self.end_settings_layout.addRow(self.end_character_label, self.end_character_line_edit)
+ self.info_on_end_label = QtWidgets.QLabel(self.end_settings_group_box)
+ self.info_on_end_label.setObjectName('info_on_end_label')
+ self.info_on_end_combo_box = QtWidgets.QComboBox(self.end_settings_group_box)
+ self.info_on_end_combo_box.setObjectName('info_on_end_combo_box')
+ self.info_on_end_combo_box.addItems(['', '', ''])
+ self.end_settings_layout.addRow(self.info_on_end_label, self.info_on_end_combo_box)
+ self.right_layout.addWidget(self.end_settings_group_box)
self.left_layout.addStretch()
self.right_layout.addStretch()
self.tool_bar_active_check_box.stateChanged.connect(self.on_tool_bar_active_check_box_changed)
@@ -64,6 +81,7 @@
self.add_from_service_check_box.stateChanged.connect(self.on_add_from_service_check_box_changed)
self.display_songbook_check_box.stateChanged.connect(self.on_songbook_check_box_changed)
self.display_copyright_check_box.stateChanged.connect(self.on_copyright_check_box_changed)
+ self.info_on_end_combo_box.activated.connect(self.on_info_on_end_combo_box_changed)
def retranslateUi(self):
self.mode_group_box.setTitle(translate('SongsPlugin.SongsTab', 'Songs Mode'))
@@ -76,6 +94,12 @@
self.display_copyright_check_box.setText(translate('SongsPlugin.SongsTab',
'Display "%s" symbol before copyright info') %
SongStrings.CopyrightSymbol)
+ self.end_settings_group_box.setTitle(translate('SongsPlugin.SongsTab', 'End slide behaviour'))
+ self.end_character_label.setText(translate('SongsPlugin.SongsTab', 'Song end character:'))
+ self.info_on_end_label.setText(translate('SongsPlugin.SongsTab', 'Show copyright info on:'))
+ self.info_on_end_combo_box.setItemText(0, translate('SongsPlugin.SongsTab', 'All slides (Recommended)'))
+ self.info_on_end_combo_box.setItemText(1, translate('SongsPlugin.SongsTab', 'First shown slide only'))
+ self.info_on_end_combo_box.setItemText(2, translate('SongsPlugin.SongsTab', 'Final slide of song only'))
def on_search_as_type_check_box_changed(self, check_state):
self.song_search = (check_state == QtCore.Qt.Checked)
@@ -95,6 +119,9 @@
def on_copyright_check_box_changed(self, check_state):
self.display_copyright_symbol = (check_state == QtCore.Qt.Checked)
+ def on_info_on_end_combo_box_changed(self):
+ self.info_on_end = self.info_on_end_combo_box.currentIndex()
+
def load(self):
settings = Settings()
settings.beginGroup(self.settings_section)
@@ -108,6 +135,9 @@
self.add_from_service_check_box.setChecked(self.update_load)
self.display_songbook_check_box.setChecked(self.display_songbook)
self.display_copyright_check_box.setChecked(self.display_copyright_symbol)
+ self.end_character_line_edit.setText(settings.value('end character'))
+ self.info_on_end = settings.value('info on end')
+ self.info_on_end_combo_box.setCurrentIndex(self.info_on_end)
settings.endGroup()
def save(self):
@@ -118,6 +148,8 @@
settings.setValue('add song from service', self.update_load)
settings.setValue('display songbook', self.display_songbook)
settings.setValue('display copyright symbol', self.display_copyright_symbol)
+ settings.setValue('end character', self.end_character_line_edit.text())
+ settings.setValue('info on end', self.info_on_end)
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 2016-03-31 16:34:22 +0000
+++ openlp/plugins/songs/songsplugin.py 2016-05-17 21:10:14 +0000
@@ -64,7 +64,9 @@
'songs/last directory export': '',
'songs/songselect username': '',
'songs/songselect password': '',
- 'songs/songselect searches': ''
+ 'songs/songselect searches': '',
+ 'songs/end character': '',
+ 'songs/info on end': 0 # 0: Show on all slides; 1: Show on first shown slide; 2: Show on end slide
}
Follow ups