Fade previews now work

This commit is contained in:
Tim Bentley 2010-08-06 17:38:52 +01:00
parent 956017da0e
commit bec051a502
2 changed files with 4 additions and 7 deletions

View File

@ -46,7 +46,6 @@ HTMLSRC = u"""
<script language="javascript">
var t = null;
var transition = %s;
var fadeComplete = null;
function blankState(state){
var black = 'none';
@ -75,12 +74,10 @@ HTMLSRC = u"""
var text1 = document.getElementById('lyricsmain');
var texto1 = document.getElementById('lyricsoutline');
var texts1 = document.getElementById('lyricsshadow');
fadeComplete = 'false';
if(!transition){
text1.innerHTML = newtext;
texto1.innerHTML = newtext;
texts1.innerHTML = newtext;
fadeComplete = 'true';
return;
}
var text2 = document.getElementById('lyricsmain2');
@ -135,11 +132,10 @@ HTMLSRC = u"""
texto2.style.opacity = 0
texts2.style.opacity = 0
}
fadeComplete = 'true';
}
function fadeFinsihed(){
return fadeComplete;
function fadeFinished(){
return (document.getElementById('lyricsmain').style.opacity==1);
}
</script>
</head>

View File

@ -164,7 +164,6 @@ class MainDisplay(DisplayWidget):
log.debug(u'text')
self.frame.evaluateJavaScript("startfade('" +
slide.replace("\\", "\\\\").replace("\'", "\\\'") + "')")
print self.frame.evaluateJavaScript("fadeFinished()").toString()
return self.preview()
def alert(self, text):
@ -270,6 +269,8 @@ class MainDisplay(DisplayWidget):
log.debug(u'preview')
# Wait for the webview to update before geting the preview.
# Important otherwise first preview will miss the background !
while self.frame.evaluateJavaScript("fadeFinished()").toString() == u'false':
Receiver.send_message(u'openlp_process_events')
while not self.loaded:
Receiver.send_message(u'openlp_process_events')
preview = QtGui.QImage(self.screen[u'size'].width(),