forked from openlp/openlp
Fix Transitions in Bibles
Fix Blank at start Bible slide Fix Blank display on restart so the correct blanking method is used. bzr-revno: 1218 Fixes: https://launchpad.net/bugs/701353
This commit is contained in:
commit
0461cf0258
@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<Theme>
|
||||
<Name>openlp.org 2.0 Demo Theme</Name>
|
||||
<BackgroundType>2</BackgroundType>
|
||||
<BackgroundParameter1>./openlp/core/test/data_for_tests/treesbig.jpg</BackgroundParameter1>
|
||||
<BackgroundParameter2>clBlack</BackgroundParameter2>
|
||||
<BackgroundParameter3/>
|
||||
<FontName>Tahoma</FontName>
|
||||
<FontColor>clWhite</FontColor>
|
||||
<FontProportion>16</FontProportion>
|
||||
<Shadow>-1</Shadow>
|
||||
<ShadowColor>$00000001</ShadowColor>
|
||||
<Outline>-1</Outline>
|
||||
<OutlineColor>clRed</OutlineColor>
|
||||
<HorizontalAlign>2</HorizontalAlign>
|
||||
<VerticalAlign>2</VerticalAlign>
|
||||
</Theme>
|
@ -293,6 +293,7 @@ def clean_tags(text):
|
||||
Remove Tags from text for display
|
||||
"""
|
||||
text = text.replace(u'<br>', u'\n')
|
||||
text = text.replace(u' ', u' ')
|
||||
for tag in DisplayTags.get_html_tags():
|
||||
text = text.replace(tag[u'start tag'], u'')
|
||||
text = text.replace(tag[u'end tag'], u'')
|
||||
|
@ -641,4 +641,4 @@ def build_alert_css(alertTab, width):
|
||||
align = u'top'
|
||||
alert = style % (width, align, alertTab.font_face, alertTab.font_size,
|
||||
alertTab.font_color, alertTab.bg_color)
|
||||
return alert
|
||||
return alert
|
||||
|
@ -687,8 +687,17 @@ class SlideController(QtGui.QWidget):
|
||||
Allow the main display to blank the main display at startup time
|
||||
"""
|
||||
log.debug(u'mainDisplaySetBackground live = %s' % self.isLive)
|
||||
display_type = QtCore.QSettings().value(
|
||||
self.parent.generalSettingsSection + u'/screen blank',
|
||||
QtCore.QVariant(u'')).toString()
|
||||
if not self.display.primary:
|
||||
self.onBlankDisplay(True)
|
||||
# Order done to handle initial conversion
|
||||
if display_type == u'themed':
|
||||
self.onThemeDisplay(True)
|
||||
elif display_type == u'hidden':
|
||||
self.onHideDisplay(True)
|
||||
else:
|
||||
self.onBlankDisplay(True)
|
||||
|
||||
def onSlideBlank(self):
|
||||
"""
|
||||
@ -712,13 +721,15 @@ class SlideController(QtGui.QWidget):
|
||||
self.ThemeScreen.setChecked(False)
|
||||
if self.screens.display_count > 1:
|
||||
self.DesktopScreen.setChecked(False)
|
||||
QtCore.QSettings().setValue(
|
||||
self.parent.generalSettingsSection + u'/screen blank',
|
||||
QtCore.QVariant(checked))
|
||||
if checked:
|
||||
Receiver.send_message(u'maindisplay_hide', HideMode.Blank)
|
||||
QtCore.QSettings().setValue(
|
||||
self.parent.generalSettingsSection + u'/screen blank',
|
||||
QtCore.QVariant(u'blanked'))
|
||||
else:
|
||||
Receiver.send_message(u'maindisplay_show')
|
||||
QtCore.QSettings().remove(
|
||||
self.parent.generalSettingsSection + u'/screen blank')
|
||||
self.blankPlugin(checked)
|
||||
|
||||
def onThemeDisplay(self, checked):
|
||||
@ -733,8 +744,13 @@ class SlideController(QtGui.QWidget):
|
||||
self.DesktopScreen.setChecked(False)
|
||||
if checked:
|
||||
Receiver.send_message(u'maindisplay_hide', HideMode.Theme)
|
||||
QtCore.QSettings().setValue(
|
||||
self.parent.generalSettingsSection + u'/screen blank',
|
||||
QtCore.QVariant(u'themed'))
|
||||
else:
|
||||
Receiver.send_message(u'maindisplay_show')
|
||||
QtCore.QSettings().remove(
|
||||
self.parent.generalSettingsSection + u'/screen blank')
|
||||
self.blankPlugin(checked)
|
||||
|
||||
def onHideDisplay(self, checked):
|
||||
@ -745,12 +761,19 @@ class SlideController(QtGui.QWidget):
|
||||
self.HideMenu.setDefaultAction(self.DesktopScreen)
|
||||
self.BlankScreen.setChecked(False)
|
||||
self.ThemeScreen.setChecked(False)
|
||||
if self.screens.display_count > 1:
|
||||
self.DesktopScreen.setChecked(checked)
|
||||
# On valid if more than 1 display
|
||||
if self.screens.display_count <= 1:
|
||||
return
|
||||
self.DesktopScreen.setChecked(checked)
|
||||
if checked:
|
||||
Receiver.send_message(u'maindisplay_hide', HideMode.Screen)
|
||||
QtCore.QSettings().setValue(
|
||||
self.parent.generalSettingsSection + u'/screen blank',
|
||||
QtCore.QVariant(u'hidden'))
|
||||
else:
|
||||
Receiver.send_message(u'maindisplay_show')
|
||||
QtCore.QSettings().remove(
|
||||
self.parent.generalSettingsSection + u'/screen blank')
|
||||
self.hidePlugin(checked)
|
||||
|
||||
def blankPlugin(self, blank):
|
||||
@ -1040,9 +1063,8 @@ class SlideController(QtGui.QWidget):
|
||||
if self.BlankScreen.isChecked:
|
||||
self.BlankScreen.setChecked(False)
|
||||
self.HideMenu.setDefaultAction(self.BlankScreen)
|
||||
QtCore.QSettings().setValue(
|
||||
self.parent.generalSettingsSection + u'/screen blank',
|
||||
QtCore.QVariant(False))
|
||||
QtCore.QSettings().remove(
|
||||
self.parent.generalSettingsSection + u'/screen blank')
|
||||
if self.ThemeScreen.isChecked:
|
||||
self.ThemeScreen.setChecked(False)
|
||||
self.HideMenu.setDefaultAction(self.ThemeScreen)
|
||||
|
@ -524,7 +524,7 @@ class ThemeManager(QtGui.QWidget):
|
||||
xml_data = file_is_unicode(xml_data)
|
||||
if not xml_data:
|
||||
break
|
||||
filexml = self.checkVersionAndConvert(xml_data)
|
||||
filexml = self._checkVersionAndConvert(xml_data)
|
||||
outfile = open(fullpath, u'w')
|
||||
outfile.write(filexml.encode(u'utf-8'))
|
||||
else:
|
||||
@ -554,22 +554,6 @@ class ThemeManager(QtGui.QWidget):
|
||||
if outfile:
|
||||
outfile.close()
|
||||
|
||||
def checkVersionAndConvert(self, xml_data):
|
||||
"""
|
||||
Check if a theme is from OpenLP version 1
|
||||
|
||||
``xml_data``
|
||||
Theme XML to check the version of
|
||||
"""
|
||||
log.debug(u'checkVersion1 ')
|
||||
theme = xml_data.encode(u'ascii', u'xmlcharrefreplace')
|
||||
tree = ElementTree(element=XML(theme)).getroot()
|
||||
# look for old version 1 tags
|
||||
if tree.find(u'BackgroundType') is None:
|
||||
return xml_data
|
||||
else:
|
||||
return self._migrateVersion122(xml_data)
|
||||
|
||||
def checkIfThemeExists(self, themeName):
|
||||
"""
|
||||
Check if theme already exists and displays error message
|
||||
@ -661,6 +645,22 @@ class ThemeManager(QtGui.QWidget):
|
||||
image = os.path.join(self.path, theme + u'.png')
|
||||
return image
|
||||
|
||||
def _checkVersionAndConvert(self, xml_data):
|
||||
"""
|
||||
Check if a theme is from OpenLP version 1
|
||||
|
||||
``xml_data``
|
||||
Theme XML to check the version of
|
||||
"""
|
||||
log.debug(u'checkVersion1 ')
|
||||
theme = xml_data.encode(u'ascii', u'xmlcharrefreplace')
|
||||
tree = ElementTree(element=XML(theme)).getroot()
|
||||
# look for old version 1 tags
|
||||
if tree.find(u'BackgroundType') is None:
|
||||
return xml_data
|
||||
else:
|
||||
return self._migrateVersion122(xml_data)
|
||||
|
||||
def _createThemeFromXml(self, themeXml, path):
|
||||
"""
|
||||
Return a theme object using information parsed from XML
|
||||
|
@ -716,21 +716,21 @@ class BibleMediaItem(MediaManagerItem):
|
||||
second_copyright, second_permissions)
|
||||
if footer not in raw_footer:
|
||||
raw_footer.append(footer)
|
||||
bible_text = u'%s\u00a0%s\n\n%s\u00a0%s' % (verse_text, text,
|
||||
bible_text = u'%s %s\n\n%s %s' % (verse_text, text,
|
||||
verse_text, second_text)
|
||||
raw_slides.append(bible_text)
|
||||
raw_slides.append(bible_text.rstrip())
|
||||
bible_text = u''
|
||||
# If we are 'Verse Per Slide' then create a new slide.
|
||||
elif self.parent.settings_tab.layout_style == 0:
|
||||
bible_text = u'%s\u00a0%s' % (verse_text, text)
|
||||
raw_slides.append(bible_text)
|
||||
bible_text = u'%s %s' % (verse_text, text)
|
||||
raw_slides.append(bible_text.rstrip())
|
||||
bible_text = u''
|
||||
# If we are 'Verse Per Line' then force a new line.
|
||||
elif self.parent.settings_tab.layout_style == 1:
|
||||
bible_text = u'%s %s\u00a0%s\n' % (bible_text, verse_text, text)
|
||||
bible_text = u'%s %s %s\n' % (bible_text, verse_text, text)
|
||||
# We have to be 'Continuous'.
|
||||
else:
|
||||
bible_text = u'%s %s\u00a0%s\n' % (bible_text, verse_text, text)
|
||||
bible_text = u'%s %s %s\n' % (bible_text, verse_text, text)
|
||||
if not old_item:
|
||||
start_item = item
|
||||
elif self.checkTitle(item, old_item):
|
||||
@ -741,7 +741,7 @@ class BibleMediaItem(MediaManagerItem):
|
||||
raw_title.append(self.formatTitle(start_item, item))
|
||||
# If there are no more items we check whether we have to add bible_text.
|
||||
if bible_text:
|
||||
raw_slides.append(bible_text)
|
||||
raw_slides.append(bible_text.lstrip())
|
||||
bible_text = u''
|
||||
# Service Item: Capabilities
|
||||
if self.parent.settings_tab.layout_style == 2 and not second_bible:
|
||||
|
Loading…
Reference in New Issue
Block a user