forked from openlp/openlp
Fix up transitions so they work
This commit is contained in:
parent
d56632aa14
commit
c892f9b38f
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
from PyQt4 import QtCore, QtGui, QtWebKit
|
from PyQt4 import QtCore, QtGui, QtWebKit
|
||||||
from PyQt4.phonon import Phonon
|
from PyQt4.phonon import Phonon
|
||||||
@ -262,7 +263,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.transparent = QtGui.QPixmap(
|
self.transparent = QtGui.QPixmap(
|
||||||
self.screen[u'size'].width(), self.screen[u'size'].height())
|
self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||||
self.transparent.fill(QtCore.Qt.transparent)
|
self.transparent.fill(QtCore.Qt.transparent)
|
||||||
# self.display_text.setPixmap(self.transparent)
|
# self.displayText.setPixmap(self.transparent)
|
||||||
#self.frameView(self.transparent)
|
#self.frameView(self.transparent)
|
||||||
# To display or not to display?
|
# To display or not to display?
|
||||||
if not self.screen[u'primary']:
|
if not self.screen[u'primary']:
|
||||||
@ -290,12 +291,12 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.scene.addItem(self.proxy)
|
self.scene.addItem(self.proxy)
|
||||||
|
|
||||||
def setupText(self):
|
def setupText(self):
|
||||||
#self.display_text = QtGui.QGraphicsTextItem()
|
#self.displayText = QtGui.QGraphicsTextItem()
|
||||||
self.display_text = QtGui.QGraphicsPixmapItem()
|
self.displayText = QtGui.QGraphicsPixmapItem()
|
||||||
#self.display_text.setPos(0,0)
|
#self.displayText.setPos(0,0)
|
||||||
#self.display_text.setTextWidth(self.size().width())
|
#self.displayText.setTextWidth(self.size().width())
|
||||||
self.display_text.setZValue(4)
|
self.displayText.setZValue(4)
|
||||||
self.scene.addItem(self.display_text)
|
self.scene.addItem(self.displayText)
|
||||||
|
|
||||||
def setupAlert(self):
|
def setupAlert(self):
|
||||||
self.alertText = QtGui.QGraphicsTextItem()
|
self.alertText = QtGui.QGraphicsTextItem()
|
||||||
@ -328,7 +329,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
Store the images so they can be replaced when required
|
Store the images so they can be replaced when required
|
||||||
"""
|
"""
|
||||||
log.debug(u'hideDisplay mode = %d', mode)
|
log.debug(u'hideDisplay mode = %d', mode)
|
||||||
#self.display_text.setPixmap(self.transparent)
|
#self.displayText.setPixmap(self.transparent)
|
||||||
if mode == HideMode.Screen:
|
if mode == HideMode.Screen:
|
||||||
#self.display_image.setPixmap(self.transparent)
|
#self.display_image.setPixmap(self.transparent)
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
@ -409,25 +410,26 @@ class MainDisplay(DisplayWidget):
|
|||||||
log.debug(u'frameView')
|
log.debug(u'frameView')
|
||||||
if transition:
|
if transition:
|
||||||
if self.frame is not None:
|
if self.frame is not None:
|
||||||
self.display_text.setPixmap(
|
self.displayText.setPixmap(
|
||||||
QtGui.QPixmap.fromImage(self.frame))
|
QtGui.QPixmap.fromImage(self.frame))
|
||||||
self.update()
|
self.repaint()
|
||||||
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
time.sleep(0.1)
|
||||||
self.frame = None
|
self.frame = None
|
||||||
if frame[u'trans'] is not None:
|
if frame[u'trans'] is not None:
|
||||||
self.display_text.setPixmap(
|
self.displayText.setPixmap(
|
||||||
QtGui.QPixmap.fromImage(frame[u'trans']))
|
QtGui.QPixmap.fromImage(frame[u'trans']))
|
||||||
self.repaint()
|
self.repaint()
|
||||||
|
Receiver.send_message(u'openlp_process_events')
|
||||||
|
time.sleep(0.1)
|
||||||
self.frame = frame[u'trans']
|
self.frame = frame[u'trans']
|
||||||
self.display_text.setPixmap(
|
self.displayText.setPixmap(
|
||||||
QtGui.QPixmap.fromImage(frame[u'main']))
|
QtGui.QPixmap.fromImage(frame[u'main']))
|
||||||
self.display_frame = frame[u'main']
|
|
||||||
self.repaint()
|
|
||||||
else:
|
else:
|
||||||
if isinstance(frame, QtGui.QPixmap):
|
if isinstance(frame, QtGui.QPixmap):
|
||||||
self.display_text.setPixmap(frame)
|
self.displayText.setPixmap(frame)
|
||||||
else:
|
else:
|
||||||
self.display_text.setPixmap(QtGui.QPixmap.fromImage(frame))
|
self.displayText.setPixmap(QtGui.QPixmap.fromImage(frame))
|
||||||
self.display_frame = frame
|
|
||||||
if not self.isVisible() and self.screens.display:
|
if not self.isVisible() and self.screens.display:
|
||||||
self.setVisible(True)
|
self.setVisible(True)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user