openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00867
[Merge] lp:~trb143/openlp/fixes into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/fixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Refactoring of ServiceItem and SlideController.
- Many changes.
Fix error in theme preview display.
--
https://code.launchpad.net/~trb143/openlp/fixes/+merge/14880
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/rendermanager.py'
--- openlp/core/lib/rendermanager.py 2009-11-08 13:56:25 +0000
+++ openlp/core/lib/rendermanager.py 2009-11-15 07:35:20 +0000
@@ -193,17 +193,17 @@
self.renderer.set_theme(themedata)
self.build_text_rectangle(themedata)
self.renderer.set_frame_dest(self.width, self.height, True)
- verse = []
- verse.append(u'Amazing Grace!')
- verse.append(u'How sweet the sound')
- verse.append(u'To save a wretch like me;')
- verse.append(u'I once was lost but now am found,')
- verse.append(u'Was blind, but now I see.')
+ verse = u'Amazing Grace!\n'\
+ 'How sweet the sound\n'\
+ 'To save a wretch like me;\n'\
+ 'I once was lost but now am found,\n'\
+ 'Was blind, but now I see.'
footer = []
footer.append(u'Amazing Grace (John Newton)' )
footer.append(u'Public Domain')
footer.append(u'CCLI xxx')
- return self.renderer.generate_frame_from_lines(verse, footer)
+ formatted = self.renderer.format_slide(verse, False)
+ return self.renderer.generate_frame_from_lines(formatted[0], footer)
def format_slide(self, words):
"""
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2009-11-12 19:05:24 +0000
+++ openlp/core/lib/serviceitem.py 2009-11-15 07:35:20 +0000
@@ -29,7 +29,7 @@
from PyQt4 import QtGui
-from openlp.core.lib import buildIcon
+from openlp.core.lib import buildIcon, Receiver
class ServiceItemType(object):
"""
@@ -49,31 +49,28 @@
log = logging.getLogger(u'ServiceItem')
log.info(u'Service Item created')
- def __init__(self, hostplugin=None):
+ def __init__(self, plugin=None):
"""
Set up the service item.
- ``hostplugin``
+ ``plugin``
The plugin that this service item belongs to.
"""
- self.plugin = hostplugin
- if hostplugin:
- self.RenderManager = self.plugin.render_manager
- self.shortname = hostplugin.name
- self.name = self.plugin.name
+ if plugin:
+ self.RenderManager = plugin.render_manager
+ self.name = plugin.name
self.title = u''
self.audit = u''
self.items = []
self.iconic_representation = None
- self.raw_slides = None
- self.frames = []
self.raw_footer = None
self.theme = None
self.service_item_path = None
self.service_item_type = None
- self.editEnabled = False
- self.service_frames = []
- self.uuid = unicode(uuid.uuid1())
+ self.edit_enabled = False
+ self._raw_frames = []
+ self._display_frames = []
+ self._uuid = unicode(uuid.uuid1())
def addIcon(self, icon):
"""
@@ -92,32 +89,27 @@
The render method is what generates the frames for the screen.
"""
log.debug(u'Render called')
- self.frames = []
+ self._display_frames = []
if self.service_item_type == ServiceItemType.Text:
log.debug(u'Formatting slides')
if self.theme is None:
self.RenderManager.set_override_theme(None)
else:
self.RenderManager.set_override_theme(self.theme)
- for slide in self.service_frames:
+ for slide in self._raw_frames:
before = time.time()
formated = self.RenderManager.format_slide(slide[u'raw_slide'])
for format in formated:
- frame = None
lines = u''
for line in format:
lines += line + u'\n'
title = lines.split(u'\n')[0]
- self.frames.append({u'title': title, u'text': lines,
- u'image': frame})
- log.info(u'Formatting took %4s' % (time.time() - before))
- elif self.service_item_type == ServiceItemType.Command:
- self.frames = self.service_frames
+ self._display_frames.append({u'title': title, u'text': lines})
+ log.log(15, u'Formatting took %4s' % (time.time() - before))
elif self.service_item_type == ServiceItemType.Image:
- for slide in self.service_frames:
+ for slide in self._raw_frames:
slide[u'image'] = \
self.RenderManager.resize_image(slide[u'image'])
- self.frames = self.service_frames
else:
log.error(u'Invalid value renderer :%s' % self.service_item_type)
@@ -132,19 +124,19 @@
self.RenderManager.set_override_theme(None)
else:
self.RenderManager.set_override_theme(self.theme)
- format = self.frames[row][u'text'].split(u'\n')
+ format = self._display_frames[row][u'text'].split(u'\n')
frame = self.RenderManager.generate_slide(format,
self.raw_footer)
return frame
- def add_from_image(self, path, frame_title, image):
+ def add_from_image(self, path, title, image):
"""
Add an image slide to the service item.
``path``
The directory in which the image file is located.
- ``frame_title``
+ ``title``
A title for the slide in the service item.
``image``
@@ -152,10 +144,10 @@
"""
self.service_item_type = ServiceItemType.Image
self.service_item_path = path
- self.service_frames.append(
- {u'title': frame_title, u'text': None, u'image': image})
+ self._raw_frames.append(
+ {u'title': title, u'image': image})
- def add_from_text(self, frame_title, raw_slide):
+ def add_from_text(self, title, raw_slide):
"""
Add a text slide to the service item.
@@ -166,24 +158,27 @@
The raw text of the slide.
"""
self.service_item_type = ServiceItemType.Text
- frame_title = frame_title.split(u'\n')[0]
- self.service_frames.append(
- {u'title': frame_title, u'raw_slide': raw_slide})
+ title = title.split(u'\n')[0]
+ self._raw_frames.append(
+ {u'title': title, u'raw_slide': raw_slide})
- def add_from_command(self, path, frame_title, image):
+ def add_from_command(self, path, file_name, image):
"""
Add a slide from a command.
- ``frame_title``
- The title of the slide in the service item.
-
- ``command``
+ ``path``
+ The title of the slide in the service item.
+
+ ``file_name``
+ The title of the slide in the service item.
+
+ ``immage``
The command of/for the slide.
"""
self.service_item_type = ServiceItemType.Command
self.service_item_path = path
- self.service_frames.append(
- {u'title': frame_title, u'command': None, u'text':None, u'image': image})
+ self._raw_frames.append(
+ {u'title': file_name, u'image': image})
def get_service_repr(self):
"""
@@ -192,7 +187,7 @@
"""
service_header = {
u'name': self.name.lower(),
- u'plugin': self.shortname,
+ u'plugin': self.name,
u'theme':self.theme,
u'title':self.title,
u'icon':self.icon,
@@ -202,13 +197,13 @@
}
service_data = []
if self.service_item_type == ServiceItemType.Text:
- for slide in self.service_frames:
+ for slide in self._raw_frames:
service_data.append(slide)
elif self.service_item_type == ServiceItemType.Image:
- for slide in self.service_frames:
+ for slide in self._raw_frames:
service_data.append(slide[u'title'])
elif self.service_item_type == ServiceItemType.Command:
- for slide in self.service_frames:
+ for slide in self._raw_frames:
service_data.append({u'title':slide[u'title'], u'image':slide[u'image']})
return {u'header': service_header, u'data': service_data}
@@ -234,7 +229,7 @@
self.audit = header[u'audit']
if self.service_item_type == ServiceItemType.Text:
for slide in serviceitem[u'serviceitem'][u'data']:
- self.service_frames.append(slide)
+ self._raw_frames.append(slide)
elif self.service_item_type == ServiceItemType.Image:
for text_image in serviceitem[u'serviceitem'][u'data']:
filename = os.path.join(path, text_image)
@@ -247,11 +242,11 @@
def merge(self, other):
"""
- Updates the uuid with the value from the original one
- The uuid is unique for a give service item but this allows one to
+ Updates the _uuid with the value from the original one
+ The _uuid is unique for a give service item but this allows one to
replace an original version.
"""
- self.uuid = other.uuid
+ self._uuid = other._uuid
def __eq__(self, other):
"""
@@ -259,25 +254,51 @@
"""
if not other:
return False
- return self.uuid == other.uuid
+ return self._uuid == other._uuid
def __ne__(self, other):
"""
Confirms the service items are not for the same instance
"""
- return self.uuid != other.uuid
+ return self._uuid != other._uuid
- def isSong(self):
+ def is_song(self):
return self.name == u'Songs'
- def isMedia(self):
+ def is_media(self):
return self.name.lower() == u'media'
- def isCommand(self):
+ def is_command(self):
return self.service_item_type == ServiceItemType.Command
- def isImage(self):
+ def is_image(self):
return self.service_item_type == ServiceItemType.Image
- def isText(self):
+ def is_text(self):
return self.service_item_type == ServiceItemType.Text
+
+ def get_frames(self):
+ if self.service_item_type == ServiceItemType.Text:
+ return self._display_frames
+ else:
+ return self._raw_frames
+
+ def get_rendered_frame(self, row):
+ """
+ Returns the correct frame for a given list and
+ renders it if required.
+ """
+ if self.service_item_type == ServiceItemType.Text:
+ return self.render_individual(row)
+ else:
+ return self._raw_frames[row][u'image']
+
+ def get_frame_title(self, row=0):
+ """
+ Returns the title of the raw frame
+ """
+ return self._raw_frames[row][u'title']
+
+ def request_audit(self):
+ if self.audit:
+ Receiver.send_message(u'songusage_live', self.audit)
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2009-11-15 07:02:27 +0000
+++ openlp/core/ui/servicemanager.py 2009-11-15 07:35:20 +0000
@@ -47,7 +47,7 @@
# else:
# pos = parentitem.data(0, QtCore.Qt.UserRole).toInt()[0]
# serviceItem = self.parent.serviceItems[pos - 1]
-# if serviceItem[u'data'].editEnabled:
+# if serviceItem[u'data'].edit_enabled:
# self.parent.editAction.setVisible(True)
# else:
# self.parent.editAction.setVisible(False)
@@ -387,14 +387,14 @@
#Repaint the screen
self.ServiceManagerList.clear()
for itemcount, item in enumerate(self.serviceItems):
- serviceitem = item[u'data']
+ serviceitem = item[u'service_item']
treewidgetitem = QtGui.QTreeWidgetItem(self.ServiceManagerList)
treewidgetitem.setText(0,serviceitem.title)
treewidgetitem.setIcon(0,serviceitem.iconic_representation)
treewidgetitem.setData(0, QtCore.Qt.UserRole,
QtCore.QVariant(item[u'order']))
treewidgetitem.setExpanded(item[u'expanded'])
- for count, frame in enumerate(serviceitem.frames):
+ for count, frame in enumerate(serviceitem.get_frames()):
treewidgetitem1 = QtGui.QTreeWidgetItem(treewidgetitem)
text = frame[u'title']
treewidgetitem1.setText(0,text[:40])
@@ -430,12 +430,12 @@
zip = zipfile.ZipFile(unicode(filename), 'w')
for item in self.serviceItems:
service.append(
- {u'serviceitem':item[u'data'].get_service_repr()})
- if item[u'data'].service_item_type == ServiceItemType.Image or \
- item[u'data'].service_item_type == ServiceItemType.Command:
- for frame in item[u'data'].frames:
+ {u'serviceitem':item[u'service_item'].get_service_repr()})
+ if item[u'service_item'].service_item_type == ServiceItemType.Image or \
+ item[u'service_item'].service_item_type == ServiceItemType.Command:
+ for frame in item[u'service_item'].frames:
path_from = unicode(os.path.join(
- item[u'data'].service_item_path, frame[u'title']))
+ item[u'service_item'].service_item_path, frame[u'title']))
zip.write(path_from)
file = open(servicefile, u'wb')
cPickle.dump(service, file)
@@ -541,7 +541,7 @@
tempServiceItems = self.serviceItems
self.onNewService()
for item in tempServiceItems:
- self.addServiceItem(item[u'data'])
+ self.addServiceItem(item[u'service_item'])
def addServiceItem(self, item):
"""
@@ -554,19 +554,19 @@
sitem, count = self.findServiceItem()
item.render()
if self.remoteEditTriggered:
- item.merge(self.serviceItems[sitem][u'data'])
- self.serviceItems[sitem][u'data'] = item
+ item.merge(self.serviceItems[sitem][u'service_item'])
+ self.serviceItems[sitem][u'service_item'] = item
self.remoteEditTriggered = False
self.repaintServiceList(sitem + 1, 0)
self.parent.LiveController.replaceServiceManagerItem(item)
else:
if sitem == -1:
- self.serviceItems.append({u'data': item,
+ self.serviceItems.append({u'service_item': item,
u'order': len(self.serviceItems) + 1,
u'expanded':True})
self.repaintServiceList(len(self.serviceItems) + 1, 0)
else:
- self.serviceItems.insert(sitem + 1, {u'data': item,
+ self.serviceItems.insert(sitem + 1, {u'service_item': item,
u'order': len(self.serviceItems)+1,
u'expanded':True})
self.repaintServiceList(sitem + 1, 0)
@@ -578,7 +578,7 @@
"""
item, count = self.findServiceItem()
self.parent.PreviewController.addServiceManagerItem(
- self.serviceItems[item][u'data'], count)
+ self.serviceItems[item][u'service_item'], count)
def makeLive(self):
"""
@@ -586,17 +586,18 @@
"""
item, count = self.findServiceItem()
self.parent.LiveController.addServiceManagerItem(
- self.serviceItems[item][u'data'], count)
+ self.serviceItems[item][u'service_item'], count)
def remoteEdit(self):
"""
Posts a remote edit message to a plugin to allow item to be edited.
"""
item, count = self.findServiceItem()
- if self.serviceItems[item][u'data'].editEnabled:
+ if self.serviceItems[item][u'service_item'].edit_enabled:
self.remoteEditTriggered = True
- Receiver.send_message(u'%s_edit' % self.serviceItems[item][u'data'].name, u'L:%s' %
- self.serviceItems[item][u'data'].editId )
+ Receiver.send_message(u'%s_edit' %
+ self.serviceItems[item][u'service_item'].name, u'L:%s' %
+ self.serviceItems[item][u'service_item'].editId )
def onRemoteEditClear(self):
self.remoteEditTriggered = False
@@ -694,5 +695,5 @@
def onThemeChangeAction(self):
theme = unicode(self.sender().text())
item, count = self.findServiceItem()
- self.serviceItems[item][u'data'].theme = theme
+ self.serviceItems[item][u'service_item'].theme = theme
self.regenerateServiceItems()
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2009-11-15 07:02:27 +0000
+++ openlp/core/ui/slidecontroller.py 2009-11-15 07:35:20 +0000
@@ -85,9 +85,9 @@
u'Edit Song',
]
self.timer_id = 0
- self.commandItem = None
self.songEdit = False
- self.row = 0
+ self.selectedRow = 0
+ self.serviceItem = None
self.Panel = QtGui.QWidget(parent.ControlSplitter)
# Layout for holding panel
self.PanelLayout = QtGui.QVBoxLayout(self.Panel)
@@ -295,15 +295,12 @@
Handle changes of width from the splitter between the live and preview
controller. Event only issues when changes have finished
"""
- if not self.commandItem:
- return
width = self.parent.ControlSplitter.sizes()[self.split]
height = width * self.parent.RenderManager.screen_ratio
self.PreviewListWidget.setColumnWidth(0, width)
- for framenumber, frame in enumerate(self.commandItem.frames):
- if frame[u'text']:
- return
- self.PreviewListWidget.setRowHeight(framenumber, height)
+ if self.serviceItem and not self.serviceItem.is_text():
+ for framenumber, frame in enumerate(self.serviceItem.get_frames()):
+ self.PreviewListWidget.setRowHeight(framenumber, height)
def trackSplitter(self, tab, pos):
"""
@@ -347,9 +344,9 @@
self.Songbar.setVisible(False)
self.Mediabar.setVisible(False)
self.Toolbar.makeWidgetsInvisible(self.image_list)
- if item.isText():
+ if item.is_text():
self.Toolbar.makeWidgetsInvisible(self.image_list)
- if item.isSong() and \
+ if item.is_song() and \
str_to_bool(self.songsconfig.get_config(u'display songbar', True)):
for action in self.Songbar.actions:
self.Songbar.actions[action].setVisible(False)
@@ -364,11 +361,11 @@
#More than 20 verses hard luck
pass
self.Songbar.setVisible(True)
- elif item.isImage():
+ elif item.is_image():
#Not sensible to allow loops with 1 frame
- if len(item.frames) > 1:
+ if len(item.get_frames()) > 1:
self.Toolbar.makeWidgetsVisible(self.image_list)
- elif item.isMedia():
+ elif item.is_media():
self.Toolbar.setVisible(False)
self.Mediabar.setVisible(True)
self.volumeSlider.setAudioOutput(self.parent.mainDisplay.audio)
@@ -380,47 +377,33 @@
self.Toolbar.setVisible(True)
self.Mediabar.setVisible(False)
self.Toolbar.makeWidgetsInvisible(self.song_edit_list)
- if item.editEnabled and item.fromPlugin:
+ if item.edit_enabled and item.fromPlugin:
self.Toolbar.makeWidgetsVisible(self.song_edit_list)
- elif item.isMedia():
+ elif item.is_media():
self.Toolbar.setVisible(False)
self.Mediabar.setVisible(True)
self.volumeSlider.setAudioOutput(self.audio)
def addServiceItem(self, item):
"""
- Method to install the service item into the controller and
- request the correct the toolbar of the plugin
+ Method to install the service item into the controller
Called by plugins
"""
log.debug(u'addServiceItem')
- #If old item was a command tell it to stop
- if self.commandItem and self.commandItem.isCommand():
- self.onMediaStop()
- self.commandItem = item
before = time.time()
item.render()
log.log(15, u'Rendering took %4s' % (time.time() - before))
- self.enableToolBar(item)
- if item.isCommand():
- if self.isLive:
- Receiver.send_message(u'%s_start' % item.name.lower(), \
- [item.shortname, item.service_item_path,
- item.service_frames[0][u'title'], self.isLive])
- else:
- if item.isMedia():
- self.onMediaStart(item)
slideno = 0
if self.songEdit:
- slideno = self.row
+ slideno = self.selectedRow
self.songEdit = False
- self.displayServiceManagerItems(item, slideno)
+ self.addServiceManagerItem(item, slideno)
def replaceServiceManagerItem(self, item):
"""
Replacement item following a remote edit
"""
- if item.__eq__(self.commandItem):
+ if item.__eq__(self.serviceItem):
self.addServiceManagerItem(item, self.PreviewListWidget.currentRow())
def addServiceManagerItem(self, item, slideno):
@@ -431,17 +414,16 @@
"""
log.debug(u'addServiceManagerItem')
#If old item was a command tell it to stop
- if self.commandItem and self.commandItem.isCommand():
+ if self.serviceItem and self.serviceItem.is_command():
self.onMediaStop()
- self.commandItem = item
self.enableToolBar(item)
- if item.isCommand():
+ if item.is_command():
if self.isLive:
Receiver.send_message(u'%s_start' % item.name.lower(), \
- [item.shortname, item.service_item_path,
- item.service_frames[0][u'title'], slideno, self.isLive])
+ [item.title, item.service_item_path,
+ item.get_frame_title(), slideno, self.isLive])
else:
- if item.isMedia():
+ if item.is_media():
self.onMediaStart(item)
self.displayServiceManagerItems(item, slideno)
@@ -455,17 +437,17 @@
#Set pointing cursor when we have somthing to point at
self.PreviewListWidget.setCursor(QtCore.Qt.PointingHandCursor)
before = time.time()
- self.serviceitem = serviceitem
+ self.serviceItem = serviceitem
self.PreviewListWidget.clear()
self.PreviewListWidget.setRowCount(0)
self.PreviewListWidget.setColumnWidth(0, width)
- for framenumber, frame in enumerate(self.serviceitem.frames):
+ for framenumber, frame in enumerate(self.serviceItem.get_frames()):
self.PreviewListWidget.setRowCount(
self.PreviewListWidget.rowCount() + 1)
item = QtGui.QTableWidgetItem()
slide_height = 0
#It is a Image
- if frame[u'text'] is None:
+ if not self.serviceItem.is_text():
label = QtGui.QLabel()
label.setMargin(4)
pixmap = self.parent.RenderManager.resize_image(frame[u'image'])
@@ -478,7 +460,7 @@
self.PreviewListWidget.setItem(framenumber, 0, item)
if slide_height != 0:
self.PreviewListWidget.setRowHeight(framenumber, slide_height)
- if self.serviceitem.frames[0][u'text']:
+ if self.serviceItem.is_text():
self.PreviewListWidget.resizeRowsToContents()
self.PreviewListWidget.setColumnWidth(
0, self.PreviewListWidget.viewport().size().width())
@@ -489,8 +471,8 @@
self.onSlideSelected()
self.PreviewListWidget.setFocus()
log.log(15, u'Display Rendering took %4s' % (time.time() - before))
- if self.serviceitem.audit and self.isLive:
- Receiver.send_message(u'songusage_live', self.serviceitem.audit)
+ if self.isLive:
+ self.serviceItem.request_audit()
log.debug(u'displayServiceManagerItems End')
#Screen event methods
@@ -498,8 +480,8 @@
"""
Go to the first slide.
"""
- if self.commandItem and self.commandItem.isCommand():
- Receiver.send_message(u'%s_first'% self.commandItem.name.lower())
+ if self.serviceItem.is_command():
+ Receiver.send_message(u'%s_first'% self.serviceItem.name.lower())
self.updatePreview()
else:
self.PreviewListWidget.selectRow(0)
@@ -512,11 +494,11 @@
"""
Blank the screen.
"""
- if self.commandItem and self.commandItem.isCommand():
+ if self.serviceItem and self.serviceItem.is_command():
if blanked:
- Receiver.send_message(u'%s_blank'% self.commandItem.name.lower())
+ Receiver.send_message(u'%s_blank'% self.serviceItem.name.lower())
else:
- Receiver.send_message(u'%s_unblank'% self.commandItem.name.lower())
+ Receiver.send_message(u'%s_unblank'% self.serviceItem.name.lower())
else:
self.parent.mainDisplay.blankDisplay(blanked)
@@ -526,22 +508,20 @@
if this is the Live Controller also display on the screen
"""
row = self.PreviewListWidget.currentRow()
- self.row = 0
+ self.selectedRow = 0
if row > -1 and row < self.PreviewListWidget.rowCount():
- if self.commandItem.isCommand():
- Receiver.send_message(u'%s_slide'% self.commandItem.name.lower(), [row])
+ if self.serviceItem.is_command():
+ Receiver.send_message(u'%s_slide'% self.serviceItem.name.lower(), [row])
if self.isLive:
self.updatePreview()
else:
- frame = self.serviceitem.frames[row][u'image']
before = time.time()
- if frame is None:
- frame = self.serviceitem.render_individual(row)
+ frame = self.serviceItem.get_rendered_frame(row)
self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
log.log(15, u'Slide Rendering took %4s' % (time.time() - before))
if self.isLive:
self.parent.mainDisplay.frameView(frame)
- self.row = row
+ self.selectedRow = row
def onSlideChange(self, row):
"""
@@ -573,8 +553,8 @@
"""
Go to the next slide.
"""
- if self.commandItem and self.commandItem.isCommand():
- Receiver.send_message(u'%s_next'% self.commandItem.name.lower())
+ if self.serviceItem.is_command():
+ Receiver.send_message(u'%s_next'% self.serviceItem.name.lower())
self.updatePreview()
else:
row = self.PreviewListWidget.currentRow() + 1
@@ -587,9 +567,9 @@
"""
Go to the previous slide.
"""
- if self.commandItem and self.commandItem.isCommand():
+ if self.serviceItem.is_command():
Receiver.send_message(
- u'%s_previous'% self.commandItem.name.lower())
+ u'%s_previous'% self.serviceItem.name.lower())
self.updatePreview()
else:
row = self.PreviewListWidget.currentRow() - 1
@@ -602,8 +582,8 @@
"""
Go to the last slide.
"""
- if self.commandItem and self.commandItem.isCommand():
- Receiver.send_message(u'%s_last'% self.commandItem.name.lower())
+ if self.serviceItem.is_command():
+ Receiver.send_message(u'%s_last'% self.serviceItem.name.lower())
self.updatePreview()
else:
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1)
@@ -632,8 +612,8 @@
def onEditSong(self):
self.songEdit = True
- Receiver.send_message(u'%s_edit' % self.commandItem.name, u'P:%s' %
- self.commandItem.editId )
+ Receiver.send_message(u'%s_edit' % self.serviceItem.name, u'P:%s' %
+ self.serviceItem.editId )
def onGoLive(self):
"""
@@ -642,24 +622,24 @@
row = self.PreviewListWidget.currentRow()
if row > -1 and row < self.PreviewListWidget.rowCount():
self.parent.LiveController.addServiceManagerItem(
- self.commandItem, row)
+ self.serviceItem, row)
def onMediaStart(self, item):
self.mediaObject.stop()
self.mediaObject.clearQueue()
- file = os.path.join(item.service_item_path, item.service_frames[0][u'title'])
+ file = os.path.join(item.service_item_path, item.get_frame_title())
self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
self.onMediaPlay()
def onMediaPause(self):
if self.isLive:
- Receiver.send_message(u'%s_pause'% self.commandItem.name.lower())
+ Receiver.send_message(u'%s_pause'% self.serviceItem.name.lower())
else:
self.mediaObject.pause()
def onMediaPlay(self):
if self.isLive:
- Receiver.send_message(u'%s_play'% self.commandItem.name.lower(), self.isLive)
+ Receiver.send_message(u'%s_play'% self.serviceItem.name.lower(), self.isLive)
else:
self.SlidePreview.hide()
self.video.show()
@@ -667,7 +647,7 @@
def onMediaStop(self):
if self.isLive:
- Receiver.send_message(u'%s_stop'% self.commandItem.name.lower())
+ Receiver.send_message(u'%s_stop'% self.serviceItem.name.lower())
else:
self.mediaObject.stop()
self.video.hide()
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2009-11-06 18:50:46 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2009-11-15 07:35:20 +0000
@@ -145,7 +145,7 @@
customSlide = self.parent.custommanager.get_custom(item_id)
title = customSlide.title
credit = customSlide.credits
- service_item.editEnabled = True
+ service_item.edit_enabled = True
service_item.editId = item_id
theme = customSlide.theme_name
if len(theme) is not 0 :
@@ -159,4 +159,4 @@
for slide in raw_slides:
service_item.add_from_text(slide[:30], slide)
service_item.raw_footer = raw_footer
- return True
+ return True
\ No newline at end of file
=== modified file 'openlp/plugins/presentations/lib/mediaitem.py'
--- openlp/plugins/presentations/lib/mediaitem.py 2009-11-03 19:01:53 +0000
+++ openlp/plugins/presentations/lib/mediaitem.py 2009-11-15 07:35:20 +0000
@@ -136,18 +136,18 @@
return False
service_item.title = unicode(self.DisplayTypeComboBox.currentText())
service_item.shortname = unicode(self.DisplayTypeComboBox.currentText())
- cont = self.controllers[service_item.shortname]
+ controller = self.controllers[service_item.shortname]
for item in items:
bitem = self.ListView.item(item.row())
filename = unicode((bitem.data(QtCore.Qt.UserRole)).toString())
(path, name) = os.path.split(filename)
- cont.store_filename(filename)
- if cont.get_slide_preview_file(1) is None:
- cont.load_presentation(filename)
+ controller.store_filename(filename)
+ if controller.get_slide_preview_file(1) is None:
+ controller.load_presentation(filename)
i = 1
- img = cont.get_slide_preview_file(i)
+ img = controller.get_slide_preview_file(i)
while img:
service_item.add_from_command(path, name, img)
i = i + 1
- img = cont.get_slide_preview_file(i)
+ img = controller.get_slide_preview_file(i)
return True
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2009-11-12 00:44:26 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2009-11-15 07:35:20 +0000
@@ -287,7 +287,7 @@
item_id = self.remoteSong
song = self.parent.songmanager.get_song(item_id)
service_item.theme = song.theme_name
- service_item.editEnabled = True
+ service_item.edit_enabled = True
service_item.editId = item_id
service_item.verse_order = song.verse_order
if song.lyrics.startswith(u'<?xml version='):
@@ -320,4 +320,3 @@
song.title, author_audit, song.copyright, song.ccli_number
]
return True
-
Follow ups