Stop double loading of Service items from service manager unless triggered by remote edit.

bzr-revno: 752
This commit is contained in:
Tim Bentley 2010-03-21 20:38:58 +00:00
commit c8a0c2a34b

View File

@ -403,14 +403,14 @@ class SlideController(QtGui.QWidget):
if self.songEdit: if self.songEdit:
slideno = self.selectedRow slideno = self.selectedRow
self.songEdit = False self.songEdit = False
self.addServiceManagerItem(item, slideno) self._processItem(item, slideno)
def replaceServiceManagerItem(self, item): def replaceServiceManagerItem(self, item):
""" """
Replacement item following a remote edit Replacement item following a remote edit
""" """
if item.__eq__(self.serviceItem): if item.__eq__(self.serviceItem):
self.addServiceManagerItem(item, self.PreviewListWidget.currentRow()) self._processItem(item, self.PreviewListWidget.currentRow())
def addServiceManagerItem(self, item, slideno): def addServiceManagerItem(self, item, slideno):
""" """
@ -419,27 +419,32 @@ class SlideController(QtGui.QWidget):
Called by ServiceManager Called by ServiceManager
""" """
log.debug(u'addServiceManagerItem') log.debug(u'addServiceManagerItem')
#If old item was a command tell it to stop #If service item is the same as the current on only change slide
if self.serviceItem and self.serviceItem.is_command(): if item.__eq__(self.serviceItem):
self.onMediaStop() self.PreviewListWidget.selectRow(slideno)
if item.is_media(): self.onSlideSelected()
self.onMediaStart(item) return
elif item.is_command(): self._processItem(item, slideno)
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)
def displayServiceManagerItems(self, serviceItem, slideno): def _processItem(self, serviceItem, slideno):
""" """
Loads a ServiceItem into the system from ServiceManager Loads a ServiceItem into the system from ServiceManager
Display the slide number passed 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 = {} self.slideList = {}
width = self.parent.ControlSplitter.sizes()[self.split] width = self.parent.ControlSplitter.sizes()[self.split]
#Set pointing cursor when we have somthing to point at #Set pointing cursor when we have somthing to point at
@ -503,7 +508,6 @@ class SlideController(QtGui.QWidget):
log.log(15, u'Display Rendering took %4s' % (time.time() - before)) log.log(15, u'Display Rendering took %4s' % (time.time() - before))
if self.isLive: if self.isLive:
self.serviceItem.request_audit() self.serviceItem.request_audit()
log.debug(u'displayServiceManagerItems End')
#Screen event methods #Screen event methods
def onSlideSelectedFirst(self): def onSlideSelectedFirst(self):