openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00948
[Merge] lp:~trb143/openlp/cleanups into lp:openlp
Tim Bentley has proposed merging lp:~trb143/openlp/cleanups into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
--
https://code.launchpad.net/~trb143/openlp/cleanups/+merge/16151
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2009-12-06 13:55:07 +0000
+++ openlp/core/lib/mediamanageritem.py 2009-12-14 18:30:36 +0000
@@ -357,7 +357,7 @@
self.trUtf8('No items selected...'),
self.trUtf8('You must select one or more items'))
else:
- log.debug(self.PluginNameShort + u' Preview Requested')
+ log.debug(self.PluginNameShort + u' Preview requested')
service_item = self.buildServiceItem()
if service_item:
service_item.fromPlugin = True
@@ -369,7 +369,7 @@
self.trUtf8('No items selected...'),
self.trUtf8('You must select one or more items'))
else:
- log.debug(self.PluginNameShort + u' Live Requested')
+ log.debug(self.PluginNameShort + u' Live requested')
service_item = self.buildServiceItem()
if service_item:
service_item.fromPlugin = True
@@ -381,7 +381,7 @@
self.trUtf8('No items selected...'),
self.trUtf8('You must select one or more items'))
else:
- log.debug(self.PluginNameShort + u' Add Requested')
+ log.debug(self.PluginNameShort + u' Add requested')
service_item = self.buildServiceItem()
if service_item:
service_item.fromPlugin = False
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py 2009-12-08 17:52:45 +0000
+++ openlp/core/lib/renderer.py 2009-12-14 18:30:36 +0000
@@ -578,7 +578,7 @@
painter.drawText(x, y + metrics.ascent(), line)
painter.end()
if self._theme.display_slideTransition:
- # Print 2nd image with 50% weight
+ # Print 2nd image with 70% weight
painter = QtGui.QPainter()
painter.begin(self._frameOp)
painter.setRenderHint(QtGui.QPainter.Antialiasing);
=== modified file 'openlp/core/lib/serviceitem.py'
--- openlp/core/lib/serviceitem.py 2009-12-08 17:04:27 +0000
+++ openlp/core/lib/serviceitem.py 2009-12-14 18:30:36 +0000
@@ -112,6 +112,8 @@
for slide in self._raw_frames:
slide[u'image'] = \
self.RenderManager.resize_image(slide[u'image'])
+ elif self.service_item_type == ServiceItemType.Command:
+ pass
else:
log.error(u'Invalid value renderer :%s' % self.service_item_type)
=== modified file 'openlp/core/ui/alertform.py'
--- openlp/core/ui/alertform.py 2009-11-30 20:29:26 +0000
+++ openlp/core/ui/alertform.py 2009-12-14 18:30:36 +0000
@@ -99,4 +99,4 @@
self.CancelButton.setText(self.trUtf8('Cancel'))
def onDisplayClicked(self):
- self.parent.mainDisplay.displayAlert(self.AlertEntryEditItem.text())
+ self.parent.mainDisplay.displayAlert(unicode(self.AlertEntryEditItem.text()))
=== modified file 'openlp/core/ui/maindisplay.py'
--- openlp/core/ui/maindisplay.py 2009-12-05 08:05:11 +0000
+++ openlp/core/ui/maindisplay.py 2009-12-14 18:30:36 +0000
@@ -234,8 +234,12 @@
``text``
display text
"""
+ log.debug(u'display alert called %s' % text)
alertTab = self.parent.settingsForm.AlertsTab
- alertframe = QtGui.QPixmap.fromImage(self.frame)
+ if isinstance(self.frame, QtGui.QImage):
+ alertframe = QtGui.QPixmap.fromImage(self.frame)
+ else:
+ alertframe = QtGui.QPixmap.fromImage(self.frame[u'main'])
painter = QtGui.QPainter(alertframe)
top = alertframe.rect().height() * 0.9
painter.fillRect(
@@ -261,7 +265,10 @@
def timerEvent(self, event):
if event.timerId() == self.timer_id:
- self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame))
+ if isinstance(self.frame, QtGui.QImage):
+ self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame))
+ else:
+ self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame[u'main']))
self.killTimer(self.timer_id)
self.timer_id = 0
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2009-12-11 19:02:45 +0000
+++ openlp/core/ui/slidecontroller.py 2009-12-14 18:30:36 +0000
@@ -246,7 +246,7 @@
self.SlidePreview.sizePolicy().hasHeightForWidth())
self.SlidePreview.setSizePolicy(sizePolicy)
self.SlidePreview.setFixedSize(
- QtCore.QSize(self.settingsmanager.slidecontroller_image, 225))
+ QtCore.QSize(self.settingsmanager.slidecontroller_image,self.settingsmanager.slidecontroller_image / 1.3 ))
self.SlidePreview.setFrameShape(QtGui.QFrame.Box)
self.SlidePreview.setFrameShadow(QtGui.QFrame.Plain)
self.SlidePreview.setLineWidth(1)
@@ -390,14 +390,12 @@
#If old item was a command tell it to stop
if self.serviceItem and self.serviceItem.is_command():
self.onMediaStop()
- if item.is_command():
- if self.isLive:
- Receiver.send_message(u'%s_start' % item.name.lower(), \
- [item.title, item.service_item_path,
- item.get_frame_title(), slideno, self.isLive])
- else:
- if item.is_media():
- self.onMediaStart(item)
+ if item.is_media():
+ self.onMediaStart(item)
+ elif item.is_command():
+ Receiver.send_message(u'%s_start' % item.name.lower(), \
+ [item.title, item.service_item_path,
+ item.get_frame_title(), slideno, self.isLive])
self.displayServiceManagerItems(item, slideno)
def displayServiceManagerItems(self, serviceItem, slideno):
@@ -475,7 +473,8 @@
if not self.serviceItem:
return
if self.serviceItem.is_command():
- Receiver.send_message(u'%s_first'% self.serviceItem.name.lower())
+ Receiver.send_message(u'%s_first'% \
+ self.serviceItem.name.lower(), self.isLive)
self.updatePreview()
else:
self.PreviewListWidget.selectRow(0)
@@ -504,17 +503,20 @@
row = self.PreviewListWidget.currentRow()
self.selectedRow = 0
if row > -1 and row < self.PreviewListWidget.rowCount():
- if self.serviceItem.is_command():
- Receiver.send_message(u'%s_slide'% self.serviceItem.name.lower(), [row])
- if self.isLive:
- self.updatePreview()
+ if self.serviceItem.is_command() and self.isLive:
+ Receiver.send_message(u'%s_slide'% \
+ self.serviceItem.name.lower(), u'%s:%s' % (row, self.isLive))
+ self.updatePreview()
else:
before = time.time()
frame = self.serviceItem.get_rendered_frame(row)
if isinstance(frame, QtGui.QImage):
self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame))
else:
- self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame[u'main']))
+ if isinstance(frame[u'main'], basestring):
+ self.SlidePreview.setPixmap(QtGui.QPixmap(frame[u'main']))
+ else:
+ self.SlidePreview.setPixmap(QtGui.QPixmap.fromImage(frame[u'main']))
log.log(15, u'Slide Rendering took %4s' % (time.time() - before))
if self.isLive:
self.parent.mainDisplay.frameView(frame, True)
@@ -553,7 +555,8 @@
if not self.serviceItem:
return
if self.serviceItem.is_command():
- Receiver.send_message(u'%s_next'% self.serviceItem.name.lower())
+ Receiver.send_message(u'%s_next' % \
+ self.serviceItem.name.lower(), self.isLive)
self.updatePreview()
else:
row = self.PreviewListWidget.currentRow() + 1
@@ -570,7 +573,7 @@
return
if self.serviceItem.is_command():
Receiver.send_message(
- u'%s_previous'% self.serviceItem.name.lower())
+ u'%s_previous'% self.serviceItem.name.lower(), self.isLive)
self.updatePreview()
else:
row = self.PreviewListWidget.currentRow() - 1
@@ -586,7 +589,8 @@
if not self.serviceItem:
return
if self.serviceItem.is_command():
- Receiver.send_message(u'%s_last'% self.serviceItem.name.lower())
+ Receiver.send_message(u'%s_last' % \
+ self.serviceItem.name.lower(), self.isLive)
self.updatePreview()
else:
self.PreviewListWidget.selectRow(self.PreviewListWidget.rowCount() - 1)
@@ -628,11 +632,16 @@
self.serviceItem, row)
def onMediaStart(self, item):
- self.mediaObject.stop()
- self.mediaObject.clearQueue()
- file = os.path.join(item.service_item_path, item.get_frame_title())
- self.mediaObject.setCurrentSource(Phonon.MediaSource(file))
- self.onMediaPlay()
+ if self.isLive:
+ Receiver.send_message(u'%s_start' % item.name.lower(), \
+ [item.title, item.service_item_path,
+ item.get_frame_title(), slideno, self.isLive])
+ else:
+ self.mediaObject.stop()
+ self.mediaObject.clearQueue()
+ 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:
=== modified file 'openlp/plugins/bibles/lib/bibleOSISimpl.py'
--- openlp/plugins/bibles/lib/bibleOSISimpl.py 2009-12-11 19:02:45 +0000
+++ openlp/plugins/bibles/lib/bibleOSISimpl.py 2009-12-14 18:30:36 +0000
@@ -28,6 +28,7 @@
import logging
import chardet
import codecs
+import time
from PyQt4 import QtCore
@@ -174,12 +175,17 @@
testament)
dialogobject.incrementProgressBar(
self.booksOfBible[p[0]])
+ Receiver.send_message(u'process_events')
+ #minor delay to get the events processed
+ time.sleep(0.1)
count = 0
self.bibledb.add_verse(book.id, p[1], p[2], text)
count += 1
#Every 3 verses repaint the screen
- if count % 3 == 0:
+ if count % 30 == 0:
Receiver.send_message(u'process_events')
+ #minor delay to get the events processed
+ time.sleep(0.1)
count = 0
except:
log.exception(u'Loading bible from OSIS file failed')
=== modified file 'openlp/plugins/custom/customplugin.py'
--- openlp/plugins/custom/customplugin.py 2009-11-30 20:29:26 +0000
+++ openlp/plugins/custom/customplugin.py 2009-12-14 18:30:36 +0000
@@ -27,7 +27,7 @@
from forms import EditCustomForm
from openlp.core.lib import Plugin, build_icon
-from openlp.plugins.custom.lib import CustomManager, CustomMediaItem
+from openlp.plugins.custom.lib import CustomManager, CustomMediaItem, CustomTab
class CustomPlugin(Plugin):
@@ -51,6 +51,9 @@
self.edit_custom_form = EditCustomForm(self.custommanager)
self.icon = build_icon(u':/media/media_custom.png')
+ def get_settings_tab(self):
+ return CustomTab(self.name)
+
def get_media_manager_item(self):
# Create the CustomManagerItem object
return CustomMediaItem(self, self.icon, self.name)
=== modified file 'openlp/plugins/custom/lib/__init__.py'
--- openlp/plugins/custom/lib/__init__.py 2009-11-30 20:29:26 +0000
+++ openlp/plugins/custom/lib/__init__.py 2009-12-14 18:30:36 +0000
@@ -25,3 +25,4 @@
from manager import CustomManager
from mediaitem import CustomMediaItem
+from customtab import CustomTab
=== added file 'openlp/plugins/custom/lib/customtab.py'
--- openlp/plugins/custom/lib/customtab.py 1970-01-01 00:00:00 +0000
+++ openlp/plugins/custom/lib/customtab.py 2009-12-14 18:30:36 +0000
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
+
+###############################################################################
+# OpenLP - Open Source Lyrics Projection #
+# --------------------------------------------------------------------------- #
+# Copyright (c) 2008-2009 Raoul Snyman #
+# Portions copyright (c) 2008-2009 Tim Bentley, Jonathan Corwin, Michael #
+# Gorven, Scott Guerrieri, Maikel Stuivenberg, Martin Thompson, Jon Tibble, #
+# Carsten Tinggaard #
+# --------------------------------------------------------------------------- #
+# This program is free software; you can redistribute it and/or modify it #
+# under the terms of the GNU General Public License as published by the Free #
+# Software Foundation; version 2 of the License. #
+# #
+# This program is distributed in the hope that it will be useful, but WITHOUT #
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
+# more details. #
+# #
+# You should have received a copy of the GNU General Public License along #
+# with this program; if not, write to the Free Software Foundation, Inc., 59 #
+# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
+###############################################################################
+
+from PyQt4 import QtCore, QtGui
+
+from openlp.core.lib import SettingsTab, str_to_bool
+
+class CustomTab(SettingsTab):
+ """
+ CustomTab is the Custom settings tab in the settings dialog.
+ """
+ def __init__(self, title, section=None):
+ SettingsTab.__init__(self, title, section)
+
+ def setupUi(self):
+ self.setObjectName(u'CustomTab')
+ self.tabTitleVisible = self.trUtf8('Custom')
+ self.CustomLayout = QtGui.QFormLayout(self)
+ self.CustomLayout.setObjectName(u'CustomLayout')
+ self.CustomModeGroupBox = QtGui.QGroupBox(self)
+ self.CustomModeGroupBox.setObjectName(u'CustomModeGroupBox')
+ self.CustomModeLayout = QtGui.QVBoxLayout(self.CustomModeGroupBox)
+ self.CustomModeLayout.setSpacing(8)
+ self.CustomModeLayout.setMargin(8)
+ self.CustomModeLayout.setObjectName(u'CustomModeLayout')
+ self.DisplayFooterCheckBox = QtGui.QCheckBox(self.CustomModeGroupBox)
+ self.DisplayFooterCheckBox.setObjectName(u'DisplayFooterCheckBox')
+ self.CustomModeLayout.addWidget(self.DisplayFooterCheckBox)
+ self.CustomLayout.setWidget(
+ 0, QtGui.QFormLayout.LabelRole, self.CustomModeGroupBox)
+ QtCore.QObject.connect(self.DisplayFooterCheckBox,
+ QtCore.SIGNAL(u'stateChanged(int)'),
+ self.onDisplayFooterCheckBoxChanged)
+
+ def retranslateUi(self):
+ self.CustomModeGroupBox.setTitle(self.trUtf8('Custom Display'))
+ self.DisplayFooterCheckBox.setText(
+ self.trUtf8('Display Footer:'))
+
+ def onDisplayFooterCheckBoxChanged(self, check_state):
+ self.displayFooter = False
+ # we have a set value convert to True/False
+ if check_state == QtCore.Qt.Checked:
+ self.displayFooter = True
+
+ def load(self):
+ self.displayFooter = str_to_bool(
+ self.config.get_config(u'display footer', True))
+ self.DisplayFooterCheckBox.setChecked(self.displayFooter)
+
+ def save(self):
+ self.config.set_config(u'display footer', unicode(self.displayFooter))
=== modified file 'openlp/plugins/custom/lib/mediaitem.py'
--- openlp/plugins/custom/lib/mediaitem.py 2009-11-30 20:29:26 +0000
+++ openlp/plugins/custom/lib/mediaitem.py 2009-12-14 18:30:36 +0000
@@ -27,7 +27,8 @@
from PyQt4 import QtCore, QtGui
-from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD, Receiver
+from openlp.core.lib import MediaManagerItem, SongXMLParser, BaseListWithDnD,\
+Receiver, str_to_bool
class CustomListView(BaseListWithDnD):
def __init__(self, parent=None):
@@ -155,9 +156,13 @@
verseList = songXML.get_verses()
for verse in verseList:
raw_slides.append(verse[1])
- raw_footer.append(title + u' '+ credit)
service_item.title = title
for slide in raw_slides:
service_item.add_from_text(slide[:30], slide)
+ if str_to_bool(self.parent.config.get_config(u'display footer', True)) or \
+ len(credit) > 0:
+ raw_footer.append(title + u' '+ credit)
+ else:
+ raw_footer.append(u'')
service_item.raw_footer = raw_footer
return True
=== modified file 'openlp/plugins/presentations/lib/messagelistener.py'
--- openlp/plugins/presentations/lib/messagelistener.py 2009-11-30 20:29:26 +0000
+++ openlp/plugins/presentations/lib/messagelistener.py 2009-12-14 18:30:36 +0000
@@ -30,6 +30,122 @@
from openlp.core.lib import Receiver
+class Controller(object):
+ """
+ This is the Presentation listener who acts on events from the slide
+ controller and passes the messages on the the correct presentation handlers
+ """
+ global log
+ log = logging.getLogger(u'Controller')
+ log.info(u'Controller loaded')
+
+ def __init__(self, live):
+ self.isLive = live
+ log.info(u'%s controller loaded' % live)
+
+ def addHandler(self, controller, file):
+ log.debug(u'Live = %s, addHandler %s' % (self.isLive, file))
+ self.controller = controller
+ if self.controller.is_loaded():
+ self.shutdown(None)
+ self.controller.load_presentation(file)
+ if self.isLive:
+ self.controller.start_presentation()
+ Receiver.send_message(u'live_slide_hide')
+ self.controller.slidenumber = 0
+
+ def activate(self):
+ log.debug(u'Live = %s, activate' % self.isLive)
+ if self.controller.is_active():
+ return
+ if not self.controller.is_loaded():
+ self.controller.load_presentation(self.controller.filepath)
+ if self.isLive:
+ self.controller.start_presentation()
+ if self.controller.slidenumber > 1:
+ self.controller.goto_slide(self.controller.slidenumber)
+
+ def slide(self, slide, live):
+ log.debug(u'Live = %s, slide' % live)
+# if not isLive:
+# return
+ self.activate()
+ self.controller.goto_slide(int(slide) + 1)
+ self.controller.poll_slidenumber(live)
+
+ def first(self, message):
+ """
+ Based on the handler passed at startup triggers the first slide
+ """
+ log.debug(u'Live = %s, first' % self.isLive)
+ print "first ", message
+ if not self.isLive:
+ return
+ self.activate()
+ self.controller.start_presentation()
+ self.controller.poll_slidenumber(self.isLive)
+
+ def last(self, message):
+ """
+ Based on the handler passed at startup triggers the first slide
+ """
+ log.debug(u'Live = %s, last' % self.isLive)
+ print "last ", message
+ if not self.isLive:
+ return
+ self.activate()
+ self.controller.goto_slide(self.controller.get_slide_count())
+ self.controller.poll_slidenumber(self.isLive)
+
+ def next(self, message):
+ """
+ Based on the handler passed at startup triggers the next slide event
+ """
+ log.debug(u'Live = %s, next' % self.isLive)
+ print "next ", message
+ if not self.isLive:
+ return
+ self.activate()
+ self.controller.next_step()
+ self.controller.poll_slidenumber(self.isLive)
+
+ def previous(self, message):
+ """
+ Based on the handler passed at startup triggers the previous slide event
+ """
+ log.debug(u'Live = %s, previous' % self.isLive)
+ if not self.isLive:
+ return
+ print "previous ", message
+ self.activate()
+ self.controller.previous_step()
+ self.controller.poll_slidenumber(self.isLive)
+
+ def shutdown(self, message):
+ """
+ Based on the handler passed at startup triggers slide show to shut down
+ """
+ log.debug(u'Live = %s, shutdown' % self.isLive)
+ self.controller.close_presentation()
+ self.controller.slidenumber = 0
+ #self.timer.stop()
+
+ def blank(self):
+ if not self.isLive:
+ return
+ if not self.controller.is_loaded():
+ return
+ if not self.controller.is_active():
+ return
+ self.controller.blank_screen()
+
+ def unblank(self):
+ if not self.is_live:
+ return
+ self.activate()
+ self.controller.unblank_screen()
+
+
class MessageListener(object):
"""
This is the Presentation listener who acts on events from the slide
@@ -41,8 +157,9 @@
def __init__(self, controllers):
self.controllers = controllers
- self.handler = None
- self.is_live = None
+ self.previewHandler = Controller(False)
+ self.liveHandler = Controller(True)
+ self.isLive = None
# messages are sent from core.ui.slidecontroller
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'presentations_start'), self.startup)
@@ -71,108 +188,84 @@
Start of new presentation
Save the handler as any new presentations start here
"""
- self.handler, file, self.is_live = self.decodeMessage(message)
- self.controller = self.controllers[self.handler]
- if self.controller.is_loaded():
- self.shutdown(None)
- self.controller.load_presentation(file)
- if self.is_live:
- self.controller.start_presentation()
- Receiver.send_message(u'live_slide_hide')
- self.controller.slidenumber = 0
- self.timer.start()
-
- def activate(self):
- if self.controller.is_active():
- return
- if not self.controller.is_loaded():
- self.controller.load_presentation(self.controller.filepath)
- self.controller.start_presentation()
- if self.controller.slidenumber > 1:
- self.controller.goto_slide(self.controller.slidenumber)
+ log.debug(u'Startup called with message %s' % message)
+ self.handler, file, isLive = self.decodeMessage(message)
+ if isLive:
+ self.liveHandler.addHandler(self.controllers[self.handler], file)
+ else:
+ self.previewHandler.addHandler(self.controllers[self.handler], file)
def slide(self, message):
- if not self.is_live:
- return
- self.activate()
- if message:
- self.controller.goto_slide(message[0]+1)
- self.controller.poll_slidenumber(self.is_live)
+ slide, live = self.splitMessage(message)
+ if live:
+ self.liveHandler.slide(slide, live)
+ else:
+ self.previewHandler.slide(slide, live)
def first(self, message):
- """
- Based on the handler passed at startup triggers the first slide
- """
- if not self.is_live:
- return
- self.activate()
- self.controller.start_presentation()
- self.controller.poll_slidenumber(self.is_live)
+ if self.isLive:
+ self.liveHandler.first(message)
+ else:
+ self.previewHandler.first(message)
def last(self, message):
- """
- Based on the handler passed at startup triggers the first slide
- """
- if not self.is_live:
- return
- self.activate()
- self.controller.goto_slide(self.controller.get_slide_count())
- self.controller.poll_slidenumber(self.is_live)
+ if self.isLive:
+ self.liveHandler.last(message)
+ else:
+ self.previewHandler.last(message)
def next(self, message):
- """
- Based on the handler passed at startup triggers the next slide event
- """
- if not self.is_live:
- return
- self.activate()
- self.controller.next_step()
- self.controller.poll_slidenumber(self.is_live)
+ if self.isLive:
+ self.liveHandler.next(message)
+ else:
+ self.previewHandler.next(message)
def previous(self, message):
- """
- Based on the handler passed at startup triggers the previous slide event
- """
- if not self.is_live:
- return
- self.activate()
- self.controller.previous_step()
- self.controller.poll_slidenumber(self.is_live)
+ if self.isLive:
+ self.liveHandler.previous(message)
+ else:
+ self.previewHandler.previous(message)
def shutdown(self, message):
- """
- Based on the handler passed at startup triggers slide show to shut down
- """
- if self.is_live:
+ if self.isLive:
+ self.liveHandler.shutdown(message)
Receiver.send_message(u'live_slide_show')
- self.controller.close_presentation()
- self.controller.slidenumber = 0
- self.timer.stop()
+ else:
+ self.previewHandler.shutdown(message)
def blank(self):
- if not self.is_live:
- return
- if not self.controller.is_loaded():
- return
- if not self.controller.is_active():
- return
- self.controller.blank_screen()
+ if self.isLive:
+ self.liveHandler.blank()
+ else:
+ self.previewHandler.blank()
def unblank(self):
- if not self.is_live:
- return
- self.activate()
- self.controller.unblank_screen()
+ if self.isLive:
+ self.liveHandler.unblank()
+ else:
+ self.previewHandler.unblank()
+
+ def splitMessage(self, message):
+ """
+ Splits the selection messages
+ into it's component parts
+
+ ``message``
+ Message containing Presentaion handler name and file to be presented.
+ """
+ bits = message.split(u':')
+ return bits[0], bits[1]
def decodeMessage(self, message):
"""
- Splits the message from the SlideController into it's component parts
+ Splits the initial message from the SlideController
+ into it's component parts
``message``
Message containing Presentaion handler name and file to be presented.
"""
file = os.path.join(message[1], message[2])
- return message[0], file, message[3]
+ return message[0], file, message[4]
def timeout(self):
self.controller.poll_slidenumber(self.is_live)
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2009-12-05 08:05:11 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2009-12-14 18:30:36 +0000
@@ -336,14 +336,19 @@
data = u'%s:%s' %(verse, subVerse)
item.setData(QtCore.Qt.UserRole, QtCore.QVariant(data))
item.setText(afterText)
- #number of lines has change
+ #number of lines has change so repaint the list moving the data
if len(tempText.split(u'\n')) != len(afterText.split(u'\n')):
tempList = {}
+ tempId = {}
for row in range(0, self.VerseListWidget.count()):
tempList[row] = self.VerseListWidget.item(row).text()
+ tempId[row] = self.VerseListWidget.item(row).\
+ data(QtCore.Qt.UserRole)
self.VerseListWidget.clear()
for row in range (0, len(tempList)):
- self.VerseListWidget.addItem(tempList[row])
+ item = QtGui.QListWidgetItem(tempList[row])
+ item.setData(QtCore.Qt.UserRole, tempId[row])
+ self.VerseListWidget.addItem(item)
self.VerseListWidget.repaint()
self.VerseEditButton.setEnabled(False)
self.VerseDeleteButton.setEnabled(False)
Follow ups