moved code to core

This commit is contained in:
Andreas Preikschat 2011-01-17 16:38:10 +01:00
parent 471de78bfe
commit 42a955582b
3 changed files with 13 additions and 10 deletions

View File

@ -94,6 +94,8 @@ class DisplayWidget(QtGui.QGraphicsView):
else: else:
event.ignore() event.ignore()
class MainDisplay(DisplayWidget): class MainDisplay(DisplayWidget):
""" """
This is the display screen. This is the display screen.
@ -270,6 +272,8 @@ class MainDisplay(DisplayWidget):
else: else:
js = u'show_image("");' js = u'show_image("");'
self.frame.evaluateJavaScript(js) self.frame.evaluateJavaScript(js)
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
def resetImage(self): def resetImage(self):
""" """
@ -278,6 +282,8 @@ class MainDisplay(DisplayWidget):
""" """
log.debug(u'resetImage') log.debug(u'resetImage')
self.displayImage(self.serviceItem.bg_image_bytes) self.displayImage(self.serviceItem.bg_image_bytes)
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
def resetVideo(self): def resetVideo(self):
""" """
@ -292,6 +298,8 @@ class MainDisplay(DisplayWidget):
self.phononActive = False self.phononActive = False
else: else:
self.frame.evaluateJavaScript(u'show_video("close");') self.frame.evaluateJavaScript(u'show_video("close");')
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
def videoPlay(self): def videoPlay(self):
""" """
@ -359,6 +367,8 @@ class MainDisplay(DisplayWidget):
self.webView.setVisible(False) self.webView.setVisible(False)
self.videoWidget.setVisible(True) self.videoWidget.setVisible(True)
self.audio.setVolume(vol) self.audio.setVolume(vol)
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
return self.preview() return self.preview()
def isLoaded(self): def isLoaded(self):
@ -475,6 +485,7 @@ class MainDisplay(DisplayWidget):
# Trigger actions when display is active again # Trigger actions when display is active again
Receiver.send_message(u'maindisplay_active') Receiver.send_message(u'maindisplay_active')
class AudioPlayer(QtCore.QObject): class AudioPlayer(QtCore.QObject):
""" """
This Class will play audio only allowing components to work with a This Class will play audio only allowing components to work with a

View File

@ -31,7 +31,7 @@ from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \
ItemCapabilities, SettingsManager, translate, check_item_selected, \ ItemCapabilities, SettingsManager, translate, check_item_selected, \
check_directory_exists, Receiver check_directory_exists
from openlp.core.ui import criticalErrorMessageBox from openlp.core.ui import criticalErrorMessageBox
from openlp.core.utils import AppLocation, delete_file, get_images_filter from openlp.core.utils import AppLocation, delete_file, get_images_filter
@ -192,8 +192,6 @@ class ImageMediaItem(MediaManagerItem):
""" """
self.resetAction.setVisible(False) self.resetAction.setVisible(False)
self.parent.liveController.display.resetImage() self.parent.liveController.display.resetImage()
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
def onReplaceClick(self): def onReplaceClick(self):
""" """
@ -209,8 +207,6 @@ class ImageMediaItem(MediaManagerItem):
(path, name) = os.path.split(filename) (path, name) = os.path.split(filename)
self.parent.liveController.display.directImage(name, filename) self.parent.liveController.display.directImage(name, filename)
self.resetAction.setVisible(True) self.resetAction.setVisible(True)
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
else: else:
criticalErrorMessageBox( criticalErrorMessageBox(
translate('ImagePlugin.MediaItem', 'Live Background Error'), translate('ImagePlugin.MediaItem', 'Live Background Error'),

View File

@ -30,7 +30,7 @@ import os
from PyQt4 import QtCore, QtGui from PyQt4 import QtCore, QtGui
from openlp.core.lib import MediaManagerItem, BaseListWithDnD, build_icon, \ 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 from openlp.core.ui import criticalErrorMessageBox
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -98,8 +98,6 @@ class MediaMediaItem(MediaManagerItem):
""" """
self.resetAction.setVisible(False) self.resetAction.setVisible(False)
self.parent.liveController.display.resetVideo() self.parent.liveController.display.resetVideo()
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
def onReplaceClick(self): def onReplaceClick(self):
""" """
@ -114,8 +112,6 @@ class MediaMediaItem(MediaManagerItem):
(path, name) = os.path.split(filename) (path, name) = os.path.split(filename)
self.parent.liveController.display.video(filename, 0, True) self.parent.liveController.display.video(filename, 0, True)
self.resetAction.setVisible(True) self.resetAction.setVisible(True)
# Update the preview frame.
Receiver.send_message(u'maindisplay_active')
else: else:
criticalErrorMessageBox(translate('MediaPlugin.MediaItem', criticalErrorMessageBox(translate('MediaPlugin.MediaItem',
'Live Background Error'), 'Live Background Error'),