ServiceItem cleanup - remove code duplication

This commit is contained in:
Tim Bentley 2009-11-14 11:44:06 +00:00
parent b0ae4e4ceb
commit 3ecec95aca

View File

@ -387,33 +387,18 @@ class SlideController(QtGui.QWidget):
def addServiceItem(self, item): def addServiceItem(self, item):
""" """
Method to install the service item into the controller and Method to install the service item into the controller
request the correct the toolbar of the plugin
Called by plugins Called by plugins
""" """
log.debug(u'addServiceItem') log.debug(u'addServiceItem')
#If old item was a command tell it to stop
if self.wasCommandItem:
self.onMediaStop()
self.wasCommandItem = False
before = time.time() before = time.time()
item.render() item.render()
log.log(15, u'Rendering took %4s' % (time.time() - before)) log.log(15, u'Rendering took %4s' % (time.time() - before))
self.enableToolBar(item)
if item.is_command():
self.wasCommandItem = True
if self.isLive:
Receiver().send_message(u'%s_start' % item.name.lower(), \
[item.title, item.service_item_path,
item.get_frame_title(), self.isLive])
else:
if item.is_media():
self.onMediaStart(item)
slideno = 0 slideno = 0
if self.songEdit: if self.songEdit:
slideno = self.selectedRow slideno = self.selectedRow
self.songEdit = False self.songEdit = False
self.displayServiceManagerItems(item, slideno) self.addServiceManagerItem(item, slideno)
def replaceServiceManagerItem(self, item): def replaceServiceManagerItem(self, item):
""" """