From 2d43cd2d8a19d9b1dd089b4af13a996f8342bf37 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 21 Mar 2010 15:08:46 +0000 Subject: [PATCH 1/2] Stop double loading of service items --- openlp/core/ui/slidecontroller.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 08583cb54..b6392a4d7 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -419,6 +419,11 @@ class SlideController(QtGui.QWidget): Called by ServiceManager """ log.debug(u'addServiceManagerItem') + #If service item is the same as the current on only change slide + if item.__eq__(self.serviceItem): + self.PreviewListWidget.selectRow(slideno) + self.onSlideSelected() + return #If old item was a command tell it to stop if self.serviceItem and self.serviceItem.is_command(): self.onMediaStop() From 3e4683bd6dff627eb82ad492f4ea31c8fd545055 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 21 Mar 2010 17:56:56 +0000 Subject: [PATCH 2/2] Fix up issues and confusion with service item edit --- openlp/core/ui/slidecontroller.py | 37 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index b6392a4d7..51ad5b6b9 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -403,14 +403,14 @@ class SlideController(QtGui.QWidget): if self.songEdit: slideno = self.selectedRow self.songEdit = False - self.addServiceManagerItem(item, slideno) + self._processItem(item, slideno) def replaceServiceManagerItem(self, item): """ Replacement item following a remote edit """ if item.__eq__(self.serviceItem): - self.addServiceManagerItem(item, self.PreviewListWidget.currentRow()) + self._processItem(item, self.PreviewListWidget.currentRow()) def addServiceManagerItem(self, item, slideno): """ @@ -424,27 +424,27 @@ class SlideController(QtGui.QWidget): self.PreviewListWidget.selectRow(slideno) self.onSlideSelected() return - #If old item was a command tell it to stop - if self.serviceItem and self.serviceItem.is_command(): - self.onMediaStop() - if item.is_media(): - self.onMediaStart(item) - elif item.is_command(): - if self.isLive: - blanked = self.blankButton.isChecked() - else: - blanked = False - Receiver.send_message(u'%s_start' % item.name.lower(), \ - [item.title, item.service_item_path, - item.get_frame_title(), slideno, self.isLive, blanked]) - self.displayServiceManagerItems(item, slideno) + self._processItem(item, slideno) - def displayServiceManagerItems(self, serviceItem, slideno): + def _processItem(self, serviceItem, slideno): """ Loads a ServiceItem into the system from ServiceManager Display the slide number passed """ - log.debug(u'displayServiceManagerItems Start') + log.debug(u'processsManagerItem') + #If old item was a command tell it to stop + if self.serviceItem and self.serviceItem.is_command(): + self.onMediaStop() + if serviceItem.is_media(): + self.onMediaStart(serviceItem) + elif serviceItem.is_command(): + if self.isLive: + blanked = self.blankButton.isChecked() + else: + blanked = False + Receiver.send_message(u'%s_start' % serviceItem.name.lower(), \ + [serviceItem.title, serviceItem.service_item_path, + serviceItem.get_frame_title(), slideno, self.isLive, blanked]) self.slideList = {} width = self.parent.ControlSplitter.sizes()[self.split] #Set pointing cursor when we have somthing to point at @@ -508,7 +508,6 @@ class SlideController(QtGui.QWidget): log.log(15, u'Display Rendering took %4s' % (time.time() - before)) if self.isLive: self.serviceItem.request_audit() - log.debug(u'displayServiceManagerItems End') #Screen event methods def onSlideSelectedFirst(self):