From 565c429bf9fa04f1312a2fa648f7936362ccb0ae Mon Sep 17 00:00:00 2001 From: rimach Date: Tue, 23 Aug 2011 22:19:45 +0200 Subject: [PATCH] preview issue fixed --- openlp/core/lib/htmlbuilder.py | 4 ++-- openlp/core/ui/maindisplay.py | 4 ++++ openlp/core/ui/media/mediamanager.py | 5 +---- openlp/core/ui/media/phononapi.py | 7 ++++--- openlp/core/ui/media/webkitapi.py | 13 ++++++++----- openlp/core/ui/slidecontroller.py | 7 +++++-- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 543207bfd..06eedb762 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -53,8 +53,8 @@ body { position: absolute; left: 0px; top: 0px; - width: %spx; - height: %spx; + width: 100%%;//%spx; + height: 100%%;//%spx; } #black { z-index: 8; diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index ac453d4ec..32790c4c2 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -69,6 +69,10 @@ class Display(QtGui.QGraphicsView): QtWebKit.QWebSettings.PluginsEnabled, True) self.page = self.webView.page() self.frame = self.page.mainFrame() + self.frame.setScrollBarPolicy(QtCore.Qt.Vertical, + QtCore.Qt.ScrollBarAlwaysOff) + self.frame.setScrollBarPolicy(QtCore.Qt.Horizontal, + QtCore.Qt.ScrollBarAlwaysOff) screen = {} screen[u'size'] = self.size() serviceItem = ServiceItem() diff --git a/openlp/core/ui/media/mediamanager.py b/openlp/core/ui/media/mediamanager.py index bdfcf1cdb..60d99c80c 100644 --- a/openlp/core/ui/media/mediamanager.py +++ b/openlp/core/ui/media/mediamanager.py @@ -135,6 +135,7 @@ class MediaManager(object): self.Timer.stop() else: for display in self.curDisplayMediaAPI.keys(): + self.curDisplayMediaAPI[display].resize(display) self.curDisplayMediaAPI[display].update_ui(display) if self.curDisplayMediaAPI[display] \ .state == MediaState.Playing: @@ -228,7 +229,6 @@ class MediaManager(object): return if display == self.parent.previewController.previewDisplay or \ display == self.parent.liveController.previewDisplay: - display.resize(display.controller.slidePreview.size()) display.hasAudio = False for api in self.APIs.values(): api.setup(display) @@ -246,9 +246,6 @@ class MediaManager(object): After Mainwindow changes or Splitter moved all related media widgets have to be resized """ - if display == self.parent.previewController.previewDisplay or \ - display == self.parent.liveController.previewDisplay: - display.resize(controller.slidePreview.size()) api.resize(display) def video(self, controller, file, muted, isBackground): diff --git a/openlp/core/ui/media/phononapi.py b/openlp/core/ui/media/phononapi.py index 9fbb9a461..ee20fd1da 100644 --- a/openlp/core/ui/media/phononapi.py +++ b/openlp/core/ui/media/phononapi.py @@ -98,10 +98,11 @@ class PhononAPI(MediaAPI): display.phononWidget = Phonon.VideoWidget(display) display.phononWidget.resize(display.size()) display.mediaObject = Phonon.MediaObject(display) - display.audio = Phonon.AudioOutput( \ - Phonon.VideoCategory, display.mediaObject) Phonon.createPath(display.mediaObject, display.phononWidget) - Phonon.createPath(display.mediaObject, display.audio) + if display.hasAudio: + display.audio = Phonon.AudioOutput( \ + Phonon.VideoCategory, display.mediaObject) + Phonon.createPath(display.mediaObject, display.audio) display.phononWidget.raise_() display.phononWidget.hide() self.hasOwnWidget = True diff --git a/openlp/core/ui/media/webkitapi.py b/openlp/core/ui/media/webkitapi.py index 74f52380d..08c2a8b5b 100644 --- a/openlp/core/ui/media/webkitapi.py +++ b/openlp/core/ui/media/webkitapi.py @@ -203,8 +203,8 @@ class WebkitAPI(MediaAPI): var flashMovie = getFlashMovieObject("OpenLPFlashMovie"); var src = "src = 'file:///" + path + "'"; var view_parm = " wmode='opaque'" + - " width='" + window.innerWidth + "'" + - " height='" + window.innerHeight + "'"; + " width='100%%'" + + " height='100%%'"; var swf_parm = " name='OpenLPFlashMovie'" + " autostart='true' loop='false' play='true'" + " hidden='false' swliveconnect='true' allowscriptaccess='always'" + @@ -275,8 +275,11 @@ class WebkitAPI(MediaAPI): def load(self, display): log.debug(u'load vid in Webkit Controller') controller = display.controller - volume = controller.media_info.volume - vol = float(volume) / float(100) + if display.hasAudio: + volume = controller.media_info.volume + vol = float(volume) / float(100) + else: + vol = 0 path = controller.media_info.file_info.absoluteFilePath() if controller.media_info.is_background: loop = u'true' @@ -329,7 +332,7 @@ class WebkitAPI(MediaAPI): def volume(self, display, vol): controller = display.controller # 1.0 is the highest value - if display.hasVolume: + if display.hasAudio: vol = float(vol) / float(100) if not controller.media_info.isFlash: display.frame.evaluateJavaScript( diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index ddb9c688e..ab5045bb5 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -417,9 +417,8 @@ class SlideController(Controller): # The SlidePreview's ratio. self.ratio = float(self.screens.current[u'size'].width()) / \ float(self.screens.current[u'size'].height()) - self.previewSizeChanged() self.mediaManager.setup_display(self.display) - self.previewDisplay.resize(self.slidePreview.size()) + self.previewSizeChanged() self.previewDisplay.setup() self.mediaManager.setup_display(self.previewDisplay) if self.serviceItem: @@ -443,11 +442,15 @@ class SlideController(Controller): max_height = self.previewFrame.height() - self.grid.margin() * 2 self.slidePreview.setFixedSize(QtCore.QSize(max_height * self.ratio, max_height)) + self.previewDisplay.setFixedSize(QtCore.QSize(max_height * self.ratio, + max_height)) else: # We have to take the width as limit. max_width = self.previewFrame.width() - self.grid.margin() * 2 self.slidePreview.setFixedSize(QtCore.QSize(max_width, max_width / self.ratio)) + self.previewDisplay.setFixedSize(QtCore.QSize(max_width, + max_width / self.ratio)) # Make sure that the frames have the correct size. self.previewListWidget.setColumnWidth(0, self.previewListWidget.viewport().size().width())