Remove unneed varables

Move code into serviceItem
Fix up splitter code
This commit is contained in:
Tim Bentley 2009-11-14 12:24:27 +00:00
parent 26b9274604
commit 78fd8efdf7
2 changed files with 12 additions and 13 deletions

View File

@ -29,7 +29,7 @@ import uuid
from PyQt4 import QtGui from PyQt4 import QtGui
from openlp.core.lib import buildIcon from openlp.core.lib import buildIcon, Receiver
class ServiceItemType(object): class ServiceItemType(object):
""" """
@ -298,3 +298,7 @@ class ServiceItem(object):
Returns the title of the raw frame Returns the title of the raw frame
""" """
return self._raw_frames[row][u'title'] return self._raw_frames[row][u'title']
def request_audit(self):
if self.audit:
Receiver.send_message(u'songusage_live', self.audit)

View File

@ -86,9 +86,9 @@ class SlideController(QtGui.QWidget):
u'Edit Song', u'Edit Song',
] ]
self.timer_id = 0 self.timer_id = 0
self.wasCommandItem = False
self.songEdit = False self.songEdit = False
self.selectedRow = 0 self.selectedRow = 0
self.serviceItem = None
self.Panel = QtGui.QWidget(parent.ControlSplitter) self.Panel = QtGui.QWidget(parent.ControlSplitter)
# Layout for holding panel # Layout for holding panel
self.PanelLayout = QtGui.QVBoxLayout(self.Panel) self.PanelLayout = QtGui.QVBoxLayout(self.Panel)
@ -293,15 +293,12 @@ class SlideController(QtGui.QWidget):
Handle changes of width from the splitter between the live and preview Handle changes of width from the splitter between the live and preview
controller. Event only issues when changes have finished controller. Event only issues when changes have finished
""" """
if self.wasCommandItem:
return
width = self.parent.ControlSplitter.sizes()[self.split] width = self.parent.ControlSplitter.sizes()[self.split]
height = width * self.parent.RenderManager.screen_ratio height = width * self.parent.RenderManager.screen_ratio
self.PreviewListWidget.setColumnWidth(0, width) self.PreviewListWidget.setColumnWidth(0, width)
for framenumber, frame in enumerate(self.commandItem.frames): if self.serviceItem and not self.serviceItem.is_text():
if frame[u'text']: for framenumber, frame in enumerate(self.serviceItem.get_frames()):
return self.PreviewListWidget.setRowHeight(framenumber, height)
self.PreviewListWidget.setRowHeight(framenumber, height)
def trackSplitter(self, tab, pos): def trackSplitter(self, tab, pos):
""" """
@ -415,12 +412,10 @@ class SlideController(QtGui.QWidget):
""" """
log.debug(u'addServiceManagerItem') log.debug(u'addServiceManagerItem')
#If old item was a command tell it to stop #If old item was a command tell it to stop
if self.wasCommandItem: if self.serviceItem and self.serviceItem.is_command():
self.onMediaStop() self.onMediaStop()
self.wasCommandItem = False
self.enableToolBar(item) self.enableToolBar(item)
if item.is_command(): if item.is_command():
self.wasCommandItem = False
if self.isLive: if self.isLive:
Receiver().send_message(u'%s_start' % item.name.lower(), \ Receiver().send_message(u'%s_start' % item.name.lower(), \
[item.title, item.service_item_path, [item.title, item.service_item_path,
@ -474,8 +469,8 @@ class SlideController(QtGui.QWidget):
self.onSlideSelected() self.onSlideSelected()
self.PreviewListWidget.setFocus() self.PreviewListWidget.setFocus()
log.log(15, u'Display Rendering took %4s' % (time.time() - before)) log.log(15, u'Display Rendering took %4s' % (time.time() - before))
if self.serviceItem.audit and self.isLive: if self.isLive:
Receiver().send_message(u'songusage_live', self.serviceItem.audit) self.serviceItem.request_audit()
log.debug(u'displayServiceManagerItems End') log.debug(u'displayServiceManagerItems End')
#Screen event methods #Screen event methods