From 9259eed4a61029f00b7844c9345dcc6bcdbc343d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sat, 15 Oct 2011 13:30:39 +0200 Subject: [PATCH] -fixed bug 871272 -clean ups Fixes: https://launchpad.net/bugs/871272 --- openlp/core/lib/serviceitem.py | 10 ++++------ openlp/core/ui/maindisplay.py | 3 ++- openlp/plugins/media/lib/mediaitem.py | 11 +++++------ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/openlp/core/lib/serviceitem.py b/openlp/core/lib/serviceitem.py index 510d71cde..6dff9f6ab 100644 --- a/openlp/core/lib/serviceitem.py +++ b/openlp/core/lib/serviceitem.py @@ -122,9 +122,8 @@ class ServiceItem(object): def _new_item(self): """ - Method to set the internal id of the item - This is used to compare service items to see if they are - the same + Method to set the internal id of the item. This is used to compare + service items to see if they are the same. """ self._uuid = unicode(uuid.uuid1()) @@ -160,9 +159,8 @@ class ServiceItem(object): def render(self, use_override=False): """ The render method is what generates the frames for the screen and - obtains the display information from the renderemanager. - At this point all the slides are built for the given - display size. + obtains the display information from the renderemanager. At this point + all the slides are built for the given display size. """ log.debug(u'Render called') self._display_frames = [] diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index d6eff912c..36f911df5 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -355,7 +355,7 @@ class MainDisplay(QtGui.QGraphicsView): """ # We request a background video but have no service Item if isBackground and not hasattr(self, u'serviceItem'): - return None + return False if not self.mediaObject: self.createMediaObject() log.debug(u'video') @@ -385,6 +385,7 @@ class MainDisplay(QtGui.QGraphicsView): # Update the preview frame. if self.isLive: Receiver.send_message(u'maindisplay_active') + return True def videoState(self, newState, oldState): """ diff --git a/openlp/plugins/media/lib/mediaitem.py b/openlp/plugins/media/lib/mediaitem.py index f2e0bbc06..c8f746851 100644 --- a/openlp/plugins/media/lib/mediaitem.py +++ b/openlp/plugins/media/lib/mediaitem.py @@ -39,7 +39,7 @@ from openlp.core.lib.ui import UiStrings, critical_error_message_box log = logging.getLogger(__name__) -CLAPPERBOARD = QtGui.QPixmap(u':/media/media_video.png').toImage() +CLAPPERBOARD = QtGui.QImage(u':/media/media_video.png') class MediaMediaItem(MediaManagerItem): """ @@ -95,14 +95,14 @@ class MediaMediaItem(MediaManagerItem): def onResetClick(self): """ - Called to reset the Live backgound with the media selected, + Called to reset the Live backgound with the media selected. """ self.resetAction.setVisible(False) self.plugin.liveController.display.resetVideo() def videobackgroundReplaced(self): """ - Triggered by main display on change of serviceitem + Triggered by main display on change of serviceitem. """ self.resetAction.setVisible(False) @@ -179,8 +179,7 @@ class MediaMediaItem(MediaManagerItem): def mediaStateWait(self, mediaState): """ - Wait for the video to change its state - Wait no longer than 5 seconds. + Wait for the video to change its state. Wait no longer than 5 seconds. """ start = datetime.now() while self.mediaObject.state() != mediaState: @@ -198,7 +197,7 @@ class MediaMediaItem(MediaManagerItem): def onDeleteClick(self): """ - Remove a media item from the list + Remove a media item from the list. """ if check_item_selected(self.listView, translate('MediaPlugin.MediaItem', 'You must select a media file to delete.')):