openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #03292
[Merge] lp:~trb143/openlp/renderer into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/renderer into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Related bugs:
#630254 When using images, blank to theme does nothing
https://bugs.launchpad.net/bugs/630254
#630285 OpeLP goes live on items even though a hide screen mode is active
https://bugs.launchpad.net/bugs/630285
Fix 2 screen hiding bugs
--
https://code.launchpad.net/~trb143/openlp/renderer/+merge/34642
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/renderer into lp:openlp.
=== modified file 'openlp/core/lib/htmlbuilder.py'
--- openlp/core/lib/htmlbuilder.py 2010-09-04 17:55:10 +0000
+++ openlp/core/lib/htmlbuilder.py 2010-09-05 19:54:43 +0000
@@ -145,6 +145,7 @@
}
document.getElementById('black').style.display = black;
document.getElementById('lyricsmain').style.visibility = lyrics;
+ document.getElementById('image').style.visibility = lyrics;
outline = document.getElementById('lyricsoutline')
if(outline!=null)
outline.style.visibility = lyrics;
@@ -327,7 +328,7 @@
else:
background = \
u'background: -webkit-gradient(radial, %s 50%%, 100, %s ' \
- u'50%%, %s, from(%s), to(%s))' % (width, width, width,
+ u'50%%, %s, from(%s), to(%s))' % (width, width, width,
theme.background_startColor, theme.background_endColor)
return background
@@ -370,10 +371,10 @@
lyricsmain = u''
outline = u''
shadow = u''
- if theme:
+ if theme and item.main:
lyricstable = u'left: %spx; top: %spx;' % \
(item.main.x(), item.main.y())
- lyrics = build_lyrics_format_css(theme, item.main.width(),
+ lyrics = build_lyrics_format_css(theme, item.main.width(),
item.main.height())
# For performance reasons we want to show as few DIV's as possible,
# especially when animating/transitions.
@@ -393,7 +394,7 @@
if webkitvers >= 533.3:
lyricsmain += build_lyrics_outline_css(theme)
else:
- outline = build_lyrics_outline_css(theme)
+ outline = build_lyrics_outline_css(theme)
if theme.display_shadow:
if theme.display_outline and webkitvers < 534.3:
shadow = u'padding-left: %spx; padding-top: %spx ' % \
@@ -405,7 +406,7 @@
theme.display_shadow_size)
lyrics_css = style % (lyricstable, lyrics, lyricsmain, outline, shadow)
return lyrics_css
-
+
def build_lyrics_outline_css(theme, is_shadow=False):
"""
Build the css which controls the theme outline
@@ -413,7 +414,7 @@
`theme`
Object containing theme information
-
+
`is_shadow`
If true, use the shadow colors instead
"""
@@ -437,7 +438,7 @@
`theme`
Object containing theme information
-
+
`width`
Width of the lyrics block
@@ -461,8 +462,8 @@
'text-align: %s; vertical-align: %s; font-family: %s; ' \
'font-size: %spt; color: %s; line-height: %d%%; ' \
'margin:0; padding:0; width: %spx; height: %spx; ' % \
- (align, valign, theme.font_main_name, theme.font_main_proportion,
- theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
+ (align, valign, theme.font_main_name, theme.font_main_proportion,
+ theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
width, height)
if theme.display_outline:
if webkit_version() < 534.3:
@@ -472,7 +473,7 @@
if theme.font_main_weight == u'Bold':
lyrics += u' font-weight:bold; '
return lyrics
-
+
def build_lyrics_html(item, webkitvers):
"""
Build the HTML required to show the lyrics
@@ -520,7 +521,7 @@
text-align: %s;
"""
theme = item.themedata
- if not theme:
+ if not theme or not item.footer:
return u''
if theme.display_horizontalAlign == 2:
align = u'center'
=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py 2010-08-31 17:51:48 +0000
+++ openlp/core/lib/rendermanager.py 2010-09-05 19:54:43 +0000
@@ -93,6 +93,8 @@
"""
self.global_theme = global_theme
self.theme_level = theme_level
+ self.global_theme_data = \
+ self.theme_manager.getThemeData(self.global_theme)
self.themedata = None
def set_service_theme(self, service_theme):
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2010-09-03 22:03:54 +0000
+++ openlp/core/lib/serviceitem.py 2010-09-05 19:54:43 +0000
@@ -170,6 +170,7 @@
u'verseTag': slide[u'verseTag'] })
log.log(15, u'Formatting took %4s' % (time.time() - before))
elif self.service_item_type == ServiceItemType.Image:
+ self.themedata = self.render_manager.global_theme_data
for slide in self._raw_frames:
slide[u'image'] = resize_image(slide[u'image'],
self.render_manager.width, self.render_manager.height)
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2010-09-04 19:13:26 +0000
+++ openlp/core/ui/maindisplay.py 2010-09-05 19:54:43 +0000
@@ -97,6 +97,7 @@
self.screens = screens
self.isLive = live
self.alertTab = None
+ self.hide_mode = None
self.setWindowTitle(u'OpenLP Display')
self.setWindowFlags(QtCore.Qt.FramelessWindowHint |
QtCore.Qt.WindowStaysOnTopHint)
@@ -340,6 +341,9 @@
self.webView.setHtml(html)
if serviceItem.foot_text and serviceItem.foot_text:
self.footer(serviceItem.foot_text)
+ # if was hidden keep it hidden
+ if self.hide_mode and self.isLive:
+ self.hideDisplay(self.hide_mode)
def footer(self, text):
"""
@@ -365,6 +369,7 @@
self.frame.evaluateJavaScript(u'show_blank("theme");')
if mode != HideMode.Screen and self.isHidden():
self.setVisible(True)
+ self.hide_mode = mode
def showDisplay(self):
"""
@@ -378,6 +383,7 @@
self.setVisible(True)
# Trigger actions when display is active again
Receiver.send_message(u'maindisplay_active')
+ self.hide_mode = None
class AudioPlayer(QtCore.QObject):
"""
Follow ups