forked from openlp/openlp
Renderer replacement- screen fix
This commit is contained in:
parent
44ae86e82b
commit
c46901cb8a
@ -84,9 +84,8 @@ def build_html(theme, screen, alert, image):
|
|||||||
build_image(theme, width, height, alert),
|
build_image(theme, width, height, alert),
|
||||||
build_lyrics(theme, width, height, alert),
|
build_lyrics(theme, width, height, alert),
|
||||||
build_alert(theme, width, height, alert),
|
build_alert(theme, width, height, alert),
|
||||||
build_image(theme, width, height, alert))
|
build_image(theme, width, height, alert), aa)
|
||||||
#build_image_src(theme, width, height, alert, image))
|
#build_image_src(theme, width, height, alert, image))
|
||||||
print html
|
|
||||||
return html
|
return html
|
||||||
|
|
||||||
def build_video(theme, width, height, alert):
|
def build_video(theme, width, height, alert):
|
||||||
|
@ -68,7 +68,6 @@ class DisplayManager(QtGui.QWidget):
|
|||||||
def __init__(self, screens):
|
def __init__(self, screens):
|
||||||
QtGui.QWidget.__init__(self)
|
QtGui.QWidget.__init__(self)
|
||||||
self.screens = screens
|
self.screens = screens
|
||||||
#self.videoDisplay = VideoDisplay(self, screens)
|
|
||||||
self.audioPlayer = AudioPlayer(self)
|
self.audioPlayer = AudioPlayer(self)
|
||||||
self.mainDisplay = WebViewer(self, screens)
|
self.mainDisplay = WebViewer(self, screens)
|
||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
@ -82,11 +81,8 @@ class DisplayManager(QtGui.QWidget):
|
|||||||
QtCore.QObject.connect(Receiver.get_receiver(),
|
QtCore.QObject.connect(Receiver.get_receiver(),
|
||||||
QtCore.SIGNAL(u'config_updated'), self.setup)
|
QtCore.SIGNAL(u'config_updated'), self.setup)
|
||||||
|
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
log.debug(u'mainDisplay - setup')
|
log.debug(u'mainDisplay - setup')
|
||||||
#self.videoDisplay.setup()
|
|
||||||
self.mainDisplay.setup()
|
|
||||||
#Build the initial frame.
|
#Build the initial frame.
|
||||||
self.initialFrame = QtGui.QImage(
|
self.initialFrame = QtGui.QImage(
|
||||||
self.screens.current[u'size'].width(),
|
self.screens.current[u'size'].width(),
|
||||||
@ -101,6 +97,7 @@ class DisplayManager(QtGui.QWidget):
|
|||||||
(self.screens.current[u'size'].width() - splash_image.width()) / 2,
|
(self.screens.current[u'size'].width() - splash_image.width()) / 2,
|
||||||
(self.screens.current[u'size'].height() - splash_image.height()) / 2,
|
(self.screens.current[u'size'].height() - splash_image.height()) / 2,
|
||||||
splash_image)
|
splash_image)
|
||||||
|
self.mainDisplay.setup()
|
||||||
self.mainDisplay.newDisplay(self.initialFrame, None, None)
|
self.mainDisplay.newDisplay(self.initialFrame, None, None)
|
||||||
self.mainDisplay.show()
|
self.mainDisplay.show()
|
||||||
|
|
||||||
@ -210,8 +207,10 @@ class WebViewer(DisplayWidget):
|
|||||||
|
|
||||||
def __init__(self, parent, screens):
|
def __init__(self, parent, screens):
|
||||||
DisplayWidget.__init__(self, parent=None)
|
DisplayWidget.__init__(self, parent=None)
|
||||||
self.screen = screens
|
self.screens = screens
|
||||||
self.setupSelf()
|
self.setWindowTitle(u'OpenLP Display')
|
||||||
|
self.setWindowFlags(QtCore.Qt.FramelessWindowHint |
|
||||||
|
QtCore.Qt.WindowStaysOnTopHint)
|
||||||
self.currimage = False
|
self.currimage = False
|
||||||
# self.byteArray = QtCore.QByteArray()
|
# self.byteArray = QtCore.QByteArray()
|
||||||
# buffer = QtCore.QBuffer(self.byteArray) #// use buffer to store pixmap into byteArray
|
# buffer = QtCore.QBuffer(self.byteArray) #// use buffer to store pixmap into byteArray
|
||||||
@ -223,7 +222,6 @@ class WebViewer(DisplayWidget):
|
|||||||
# buffer.open(QtCore.QIODevice.WriteOnly)
|
# buffer.open(QtCore.QIODevice.WriteOnly)
|
||||||
# pixmap = QtGui.QPixmap("file:///home/timali/Pictures/out.png")
|
# pixmap = QtGui.QPixmap("file:///home/timali/Pictures/out.png")
|
||||||
# pixmap.save(buffer, "PNG")
|
# pixmap.save(buffer, "PNG")
|
||||||
self.setup()
|
|
||||||
# self.image1 = "file:///home/timali/Pictures/IMG_0726.jpg"
|
# self.image1 = "file:///home/timali/Pictures/IMG_0726.jpg"
|
||||||
# self.image2 = "file:///home/timali/Pictures/out.png"
|
# self.image2 = "file:///home/timali/Pictures/out.png"
|
||||||
self.currvideo = False
|
self.currvideo = False
|
||||||
@ -272,18 +270,15 @@ class WebViewer(DisplayWidget):
|
|||||||
self.frame.evaluateJavaScript("document.getElementById('video').play()")
|
self.frame.evaluateJavaScript("document.getElementById('video').play()")
|
||||||
self.currimage = not self.currimage
|
self.currimage = not self.currimage
|
||||||
|
|
||||||
def setupSelf(self):
|
|
||||||
self.setWindowTitle(u'OpenLP Display')
|
|
||||||
self.setWindowFlags(QtCore.Qt.FramelessWindowHint |
|
|
||||||
QtCore.Qt.WindowStaysOnTopHint)
|
|
||||||
self.setGeometry(1440, 0, self.screen.current[u'size'].width(), self.screen.current[u'size'].height())
|
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
|
log.debug(u'Setup %s for %s ' % (
|
||||||
|
self.screens, self.screens.monitor_number))
|
||||||
|
self.screen = self.screens.current
|
||||||
|
self.setVisible(False)
|
||||||
|
self.setGeometry(self.screen[u'size'])
|
||||||
self.webView = QtWebKit.QWebView(self)
|
self.webView = QtWebKit.QWebView(self)
|
||||||
self.webView.setGeometry(0, 0, self.screen.current[u'size'].width(), self.screen.current[u'size'].height())
|
self.webView.setGeometry(0, 0, self.screen[u'size'].width(), self.screen[u'size'].height())
|
||||||
self.page = self.webView.page()
|
self.page = self.webView.page()
|
||||||
# html = build_html(None, self.screen, None, self.byteArray)
|
|
||||||
# self.webView.setHtml(html)
|
|
||||||
self.frame = self.page.mainFrame()
|
self.frame = self.page.mainFrame()
|
||||||
self.frame.setScrollBarPolicy(QtCore.Qt.Vertical,
|
self.frame.setScrollBarPolicy(QtCore.Qt.Vertical,
|
||||||
QtCore.Qt.ScrollBarAlwaysOff)
|
QtCore.Qt.ScrollBarAlwaysOff)
|
||||||
@ -302,7 +297,7 @@ class WebViewer(DisplayWidget):
|
|||||||
|
|
||||||
def newDisplay(self, image, text, video=None):
|
def newDisplay(self, image, text, video=None):
|
||||||
if not video:
|
if not video:
|
||||||
html = build_html(None, self.screen.current, None, image)
|
html = build_html(None, self.screen, None, image)
|
||||||
self.webView.setHtml(html)
|
self.webView.setHtml(html)
|
||||||
|
|
||||||
#class DisplayWidget(QtGui.QGraphicsView):
|
#class DisplayWidget(QtGui.QGraphicsView):
|
||||||
|
Loading…
Reference in New Issue
Block a user