forked from openlp/openlp
Move changes to get displays working correctly and sort out Impress
This commit is contained in:
parent
dc7148b76e
commit
dc6be31d1f
@ -68,6 +68,10 @@ class OpenLP(QtGui.QApplication):
|
|||||||
global log
|
global log
|
||||||
log.info(u'OpenLP Application Loaded')
|
log.info(u'OpenLP Application Loaded')
|
||||||
|
|
||||||
|
def notify(self, obj, evt):
|
||||||
|
#TODO needed for presentation exceptions
|
||||||
|
return QtGui.QApplication.notify(self, obj, evt)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
"""
|
"""
|
||||||
Run the OpenLP application.
|
Run the OpenLP application.
|
||||||
|
@ -100,8 +100,8 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.display_image.setScaledContents(True)
|
self.display_image.setScaledContents(True)
|
||||||
self.display_text = QtGui.QLabel(self)
|
self.display_text = QtGui.QLabel(self)
|
||||||
self.display_text.setScaledContents(True)
|
self.display_text.setScaledContents(True)
|
||||||
self.alertDisplay = QtGui.QLabel(self)
|
self.display_alert = QtGui.QLabel(self)
|
||||||
self.alertDisplay.setScaledContents(True)
|
self.display_alert.setScaledContents(True)
|
||||||
self.primary = True
|
self.primary = True
|
||||||
self.displayBlank = False
|
self.displayBlank = False
|
||||||
self.blankFrame = None
|
self.blankFrame = None
|
||||||
@ -141,7 +141,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.setGeometry(self.screen[u'size'])
|
self.setGeometry(self.screen[u'size'])
|
||||||
self.alertScreenPosition = self.screen[u'size'].height() * 0.9
|
self.alertScreenPosition = self.screen[u'size'].height() * 0.9
|
||||||
self.alertHeight = self.screen[u'size'].height() - self.alertScreenPosition
|
self.alertHeight = self.screen[u'size'].height() - self.alertScreenPosition
|
||||||
self.alertDisplay.setGeometry(
|
self.display_alert.setGeometry(
|
||||||
QtCore.QRect(0, self.alertScreenPosition,
|
QtCore.QRect(0, self.alertScreenPosition,
|
||||||
self.screen[u'size'].width(),self.alertHeight))
|
self.screen[u'size'].width(),self.alertHeight))
|
||||||
self.video.setGeometry(self.screen[u'size'])
|
self.video.setGeometry(self.screen[u'size'])
|
||||||
@ -163,6 +163,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
(self.screen[u'size'].height() - splash_image.height()) / 2,
|
(self.screen[u'size'].height() - splash_image.height()) / 2,
|
||||||
splash_image)
|
splash_image)
|
||||||
self.display_image.setPixmap(QtGui.QPixmap.fromImage(self.InitialFrame))
|
self.display_image.setPixmap(QtGui.QPixmap.fromImage(self.InitialFrame))
|
||||||
|
self.repaint()
|
||||||
#Build a Black screen
|
#Build a Black screen
|
||||||
painter = QtGui.QPainter()
|
painter = QtGui.QPainter()
|
||||||
self.blankFrame = QtGui.QImage(
|
self.blankFrame = QtGui.QImage(
|
||||||
@ -170,11 +171,13 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.screen[u'size'].height(),
|
self.screen[u'size'].height(),
|
||||||
QtGui.QImage.Format_ARGB32_Premultiplied)
|
QtGui.QImage.Format_ARGB32_Premultiplied)
|
||||||
painter.begin(self.blankFrame)
|
painter.begin(self.blankFrame)
|
||||||
|
#TODO make black when testing finished
|
||||||
painter.fillRect(self.blankFrame.rect(), QtCore.Qt.red)
|
painter.fillRect(self.blankFrame.rect(), QtCore.Qt.red)
|
||||||
#build a blank transparent image
|
#build a blank transparent image
|
||||||
self.transparent = QtGui.QPixmap(self.screen[u'size'].width(),
|
self.transparent = QtGui.QPixmap(self.screen[u'size'].width(),
|
||||||
self.screen[u'size'].height())
|
self.screen[u'size'].height())
|
||||||
self.transparent.fill(QtCore.Qt.transparent)
|
self.transparent.fill(QtCore.Qt.transparent)
|
||||||
|
self.display_alert.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']:
|
||||||
@ -183,7 +186,6 @@ class MainDisplay(DisplayWidget):
|
|||||||
else:
|
else:
|
||||||
self.setVisible(False)
|
self.setVisible(False)
|
||||||
self.primary = True
|
self.primary = True
|
||||||
self.repaint()
|
|
||||||
|
|
||||||
def resetDisplay(self):
|
def resetDisplay(self):
|
||||||
if self.primary:
|
if self.primary:
|
||||||
@ -248,6 +250,7 @@ class MainDisplay(DisplayWidget):
|
|||||||
if self.display_frame:
|
if self.display_frame:
|
||||||
self.frameView(self.display_frame)
|
self.frameView(self.display_frame)
|
||||||
|
|
||||||
|
|
||||||
def displayAlert(self, text=u''):
|
def displayAlert(self, text=u''):
|
||||||
"""
|
"""
|
||||||
Called from the Alert Tab to display an alert
|
Called from the Alert Tab to display an alert
|
||||||
@ -292,22 +295,24 @@ class MainDisplay(DisplayWidget):
|
|||||||
painter.drawText(
|
painter.drawText(
|
||||||
x, y + metrics.height() - metrics.descent() - 1, text)
|
x, y + metrics.height() - metrics.descent() - 1, text)
|
||||||
painter.end()
|
painter.end()
|
||||||
self.alertDisplay.setPixmap(alertframe)
|
self.display_alert.setPixmap(alertframe)
|
||||||
self.alertDisplay.setVisible(True)
|
self.display_alert.setVisible(True)
|
||||||
# check to see if we have a timer running
|
# check to see if we have a timer running
|
||||||
if self.timer_id == 0:
|
if self.timer_id == 0:
|
||||||
self.timer_id = self.startTimer(int(alertTab.timeout) * 1000)
|
self.timer_id = self.startTimer(int(alertTab.timeout) * 1000)
|
||||||
|
|
||||||
def timerEvent(self, event):
|
def timerEvent(self, event):
|
||||||
if event.timerId() == self.timer_id:
|
if event.timerId() == self.timer_id:
|
||||||
self.alertDisplay.setPixmap(self.transparent)
|
self.display_alert.setPixmap(self.transparent)
|
||||||
self.killTimer(self.timer_id)
|
self.killTimer(self.timer_id)
|
||||||
self.timer_id = 0
|
self.timer_id = 0
|
||||||
self.generateAlert()
|
self.generateAlert()
|
||||||
|
|
||||||
def onMediaQueue(self, message):
|
def onMediaQueue(self, message):
|
||||||
log.debug(u'Queue new media message %s' % message)
|
log.debug(u'Queue new media message %s' % message)
|
||||||
|
self.display_image.close()
|
||||||
self.display_text.close()
|
self.display_text.close()
|
||||||
|
self.display_alert.close()
|
||||||
file = os.path.join(message[1], message[2])
|
file = os.path.join(message[1], message[2])
|
||||||
if self.firstTime:
|
if self.firstTime:
|
||||||
self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
|
self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
|
||||||
@ -325,12 +330,12 @@ class MainDisplay(DisplayWidget):
|
|||||||
self.mediaLoaded = True
|
self.mediaLoaded = True
|
||||||
self.display_image.hide()
|
self.display_image.hide()
|
||||||
self.display_text.hide()
|
self.display_text.hide()
|
||||||
self.alertDisplay.hide()
|
self.display_alert.hide()
|
||||||
self.video.setFullScreen(True)
|
self.video.setFullScreen(True)
|
||||||
self.video.setVisible(True)
|
self.video.setVisible(True)
|
||||||
self.mediaObject.play()
|
self.mediaObject.play()
|
||||||
if self.primary:
|
|
||||||
self.setVisible(True)
|
self.setVisible(True)
|
||||||
|
self.hide()
|
||||||
|
|
||||||
def onMediaPause(self):
|
def onMediaPause(self):
|
||||||
log.debug(u'Media paused by user')
|
log.debug(u'Media paused by user')
|
||||||
@ -343,8 +348,6 @@ class MainDisplay(DisplayWidget):
|
|||||||
|
|
||||||
def onMediaFinish(self):
|
def onMediaFinish(self):
|
||||||
log.debug(u'Reached end of media playlist')
|
log.debug(u'Reached end of media playlist')
|
||||||
if self.primary:
|
|
||||||
self.setVisible(False)
|
|
||||||
self.mediaObject.stop()
|
self.mediaObject.stop()
|
||||||
self.mediaObject.clearQueue()
|
self.mediaObject.clearQueue()
|
||||||
self.mediaLoaded = False
|
self.mediaLoaded = False
|
||||||
|
@ -256,7 +256,7 @@ class ImpressController(PresentationController):
|
|||||||
return False
|
return False
|
||||||
if self.controller is None:
|
if self.controller is None:
|
||||||
return False
|
return False
|
||||||
return self.controller.isRunning() and self.controller.isActive()
|
return True
|
||||||
|
|
||||||
def unblank_screen(self):
|
def unblank_screen(self):
|
||||||
return self.controller.resume()
|
return self.controller.resume()
|
||||||
|
Loading…
Reference in New Issue
Block a user