openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #00748
[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)
Fix bugs with Live Controller
Tidy up Editing from Preview Controller
Fix Custom Plugin editor to block exit if changes are unsaved.
--
https://code.launchpad.net/~trb143/openlp/fixes/+merge/14269
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/mediamanageritem.py'
--- openlp/core/lib/mediamanageritem.py 2009-10-30 17:44:16 +0000
+++ openlp/core/lib/mediamanageritem.py 2009-10-31 20:45:24 +0000
@@ -24,6 +24,7 @@
import types
import os
+import uuid
from PyQt4 import QtCore, QtGui
@@ -360,18 +361,23 @@
log.debug(self.PluginNameShort + u' Preview Requested')
service_item = self.buildServiceItem()
if service_item is not None:
+ service_item.fromPlugin = True
self.parent.preview_controller.addServiceItem(service_item)
def onLiveClick(self):
log.debug(self.PluginNameShort + u' Live Requested')
service_item = self.buildServiceItem()
if service_item is not None:
+ service_item.fromPlugin = True
+ service_item.uuid = unicode(uuid.uuid1())
self.parent.live_controller.addServiceItem(service_item)
def onAddClick(self):
log.debug(self.PluginNameShort + u' Add Requested')
service_item = self.buildServiceItem()
if service_item is not None:
+ service_item.fromPlugin = False
+ service_item.uuid = unicode(uuid.uuid1())
self.parent.service_manager.addServiceItem(service_item)
def buildServiceItem(self):
=== modified file 'openlp/core/ui/servicemanager.py'
--- openlp/core/ui/servicemanager.py 2009-10-31 08:45:24 +0000
+++ openlp/core/ui/servicemanager.py 2009-10-31 20:45:24 +0000
@@ -27,7 +27,6 @@
import logging
import cPickle
import zipfile
-import uuid
from PyQt4 import QtCore, QtGui
from openlp.core.lib import PluginConfig, OpenLPToolbar, ServiceItem, \
@@ -563,7 +562,6 @@
self.repaintServiceList(sitem + 1, 0)
self.parent.LiveController.replaceServiceManagerItem(item)
else:
- item.uuid = unicode(uuid.uuid1())
if sitem == -1:
self.serviceItems.append({u'data': item,
u'order': len(self.serviceItems) + 1,
=== modified file 'openlp/core/ui/slidecontroller.py'
--- openlp/core/ui/slidecontroller.py 2009-10-31 09:03:54 +0000
+++ openlp/core/ui/slidecontroller.py 2009-10-31 20:45:24 +0000
@@ -284,14 +284,15 @@
str_to_bool(self.songsconfig.get_config(u'display songbar', True)):
for action in self.Songbar.actions:
self.Songbar.actions[action].setVisible(False)
- verses = item.verse_order.split(u' ')
- for verse in verses:
- try:
- self.Songbar.actions[verse].setVisible(True)
- except:
- #More than 20 verses hard luck
- pass
- self.Songbar.setVisible(True)
+ if item.verse_order is not None:
+ verses = item.verse_order.split(u' ')
+ for verse in verses:
+ try:
+ self.Songbar.actions[verse].setVisible(True)
+ except:
+ #More than 20 verses hard luck
+ pass
+ self.Songbar.setVisible(True)
elif item.service_item_type == ServiceType.Image:
#Not sensible to allow loops with 1 frame
if len(item.frames) > 1:
@@ -301,7 +302,7 @@
"""
Allows the Preview toolbar to be customised
"""
- if item.name == u'Songs':
+ if item.name == u'Songs' and item.fromPlugin:
self.Toolbar.makeWidgetsVisible(self.song_list)
else:
self.Toolbar.makeWidgetsInvisible(self.song_list)
=== modified file 'openlp/plugins/custom/forms/editcustomdialog.py'
--- openlp/plugins/custom/forms/editcustomdialog.py 2009-10-29 13:44:33 +0000
+++ openlp/plugins/custom/forms/editcustomdialog.py 2009-10-31 20:45:24 +0000
@@ -120,7 +120,7 @@
self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1)
self.buttonBox = QtGui.QDialogButtonBox(customEditDialog)
self.buttonBox.setStandardButtons(
- QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
+ QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save)
self.buttonBox.setObjectName(u'buttonBox')
self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 1)
=== modified file 'openlp/plugins/custom/forms/editcustomform.py'
--- openlp/plugins/custom/forms/editcustomform.py 2009-10-29 13:44:33 +0000
+++ openlp/plugins/custom/forms/editcustomform.py 2009-10-31 20:45:24 +0000
@@ -101,7 +101,7 @@
verseList = songXML.get_verses()
for verse in verseList:
self.VerseListView.addItem(verse[1])
- theme = unicode(self.customSlide.theme_name)
+ theme = self.customSlide.theme_name
id = self.ThemeComboBox.findText(theme, QtCore.Qt.MatchExactly)
if id == -1:
id = 0 # Not Found
@@ -224,9 +224,12 @@
def _validate(self):
if len(self.TitleEdit.displayText()) == 0:
self.TitleEdit.setFocus()
- return False, self.trUtf8(u'You need to enter a title \n')
+ return False, self.trUtf8(u'You need to enter a title')
# must have 1 slide
if self.VerseListView.count() == 0:
self.VerseTextEdit.setFocus()
- return False, self.trUtf8(u'You need to enter a slide \n')
+ return False, self.trUtf8(u'You need to enter a slide')
+ if len(self.VerseTextEdit.toPlainText()) > 0:
+ self.VerseTextEdit.setFocus()
+ return False, self.trUtf8(u'You have unsaved data')
return True, u''
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2009-10-31 08:45:24 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2009-10-31 20:45:24 +0000
@@ -468,6 +468,8 @@
def processTitle(self):
log.debug(u'processTitle')
self.song.search_title = self.song.search_title.replace(u'\'', u'')
+ self.song.search_title = self.song.search_title.replace(u'\"', u'')
+ self.song.search_title = self.song.search_title.replace(u'\`', u'')
self.song.search_title = self.song.search_title.replace(u',', u'')
self.song.search_title = self.song.search_title.replace(u';', u'')
self.song.search_title = self.song.search_title.replace(u':', u'')
=== modified file 'openlp/plugins/songs/lib/mediaitem.py'
--- openlp/plugins/songs/lib/mediaitem.py 2009-10-30 21:47:15 +0000
+++ openlp/plugins/songs/lib/mediaitem.py 2009-10-31 20:45:24 +0000
@@ -289,6 +289,7 @@
song = self.parent.songmanager.get_song(item_id)
service_item.theme = song.theme_name
service_item.editEnabled = True
+ service_item.fromPlugin = True
service_item.editId = item_id
service_item.verse_order = song.verse_order
if song.lyrics.startswith(u'<?xml version='):
Follow ups