From 42a955582bbd1d258f69ddb3f46621364ee90f7f Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 17 Jan 2011 16:38:10 +0100 Subject: [PATCH] moved code to core --- openlp/core/ui/maindisplay.py | 11 +++++++++++ openlp/plugins/images/lib/mediaitem.py | 6 +----- openlp/plugins/media/lib/mediaitem.py | 6 +----- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 273a3c4f0..ad45d200d 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -94,6 +94,8 @@ class DisplayWidget(QtGui.QGraphicsView): else: event.ignore() + + class MainDisplay(DisplayWidget): """ This is the display screen. @@ -270,6 +272,8 @@ class MainDisplay(DisplayWidget): else: js = u'show_image("");' self.frame.evaluateJavaScript(js) + # Update the preview frame. + Receiver.send_message(u'maindisplay_active') def resetImage(self): """ @@ -278,6 +282,8 @@ class MainDisplay(DisplayWidget): """ log.debug(u'resetImage') self.displayImage(self.serviceItem.bg_image_bytes) + # Update the preview frame. + Receiver.send_message(u'maindisplay_active') def resetVideo(self): """ @@ -292,6 +298,8 @@ class MainDisplay(DisplayWidget): self.phononActive = False else: self.frame.evaluateJavaScript(u'show_video("close");') + # Update the preview frame. + Receiver.send_message(u'maindisplay_active') def videoPlay(self): """ @@ -359,6 +367,8 @@ class MainDisplay(DisplayWidget): self.webView.setVisible(False) self.videoWidget.setVisible(True) self.audio.setVolume(vol) + # Update the preview frame. + Receiver.send_message(u'maindisplay_active') return self.preview() def isLoaded(self): @@ -475,6 +485,7 @@ class MainDisplay(DisplayWidget): # Trigger actions when display is active again Receiver.send_message(u'maindisplay_active') + class AudioPlayer(QtCore.QObject): """ This Class will play audio only allowing components to work with a diff --git a/openlp/plugins/images/lib/mediaitem.py b/openlp/plugins/images/lib/mediaitem.py index b31ab5884..bd84219fb 100644 --- a/openlp/plugins/images/lib/mediaitem.py +++ b/openlp/plugins/images/lib/mediaitem.py @@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ ItemCapabilities, SettingsManager, translate, check_item_selected, \ - check_directory_exists, Receiver + check_directory_exists from openlp.core.ui import criticalErrorMessageBox from openlp.core.utils import AppLocation, delete_file, get_images_filter @@ -192,8 +192,6 @@ class ImageMediaItem(MediaManagerItem): """ self.resetAction.setVisible(False) self.parent.liveController.display.resetImage() - # Update the preview frame. - Receiver.send_message(u'maindisplay_active') def onReplaceClick(self): """ @@ -209,8 +207,6 @@ class ImageMediaItem(MediaManagerItem): (path, name) = os.path.split(filename) self.parent.liveController.display.directImage(name, filename) self.resetAction.setVisible(True) - # Update the preview frame. - Receiver.send_message(u'maindisplay_active') else: criticalErrorMessageBox( translate('ImagePlugin.MediaItem', 'Live Background Error'), diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index ba0a5dc96..121fa80a0 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -30,7 +30,7 @@ import os from PyQt4 import QtCore, QtGui from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ - ItemCapabilities, SettingsManager, translate, check_item_selected, Receiver + ItemCapabilities, SettingsManager, translate, check_item_selected from openlp.core.ui import criticalErrorMessageBox log = logging.getLogger(__name__) @@ -98,8 +98,6 @@ class MediaMediaItem(MediaManagerItem): """ self.resetAction.setVisible(False) self.parent.liveController.display.resetVideo() - # Update the preview frame. - Receiver.send_message(u'maindisplay_active') def onReplaceClick(self): """ @@ -114,8 +112,6 @@ class MediaMediaItem(MediaManagerItem): (path, name) = os.path.split(filename) self.parent.liveController.display.video(filename, 0, True) self.resetAction.setVisible(True) - # Update the preview frame. - Receiver.send_message(u'maindisplay_active') else: criticalErrorMessageBox(translate('MediaPlugin.MediaItem', 'Live Background Error'),