Fix up song tagging so case does not matter

Fix bug in transitions when using images
Remove MediaTab as not wanted
This commit is contained in:
Tim Bentley 2009-12-05 08:05:11 +00:00
parent b8149cc826
commit 480fc4771f
6 changed files with 26 additions and 72 deletions

View File

@ -198,9 +198,11 @@ class MainDisplay(DisplayWidget):
self.displayAlert()
elif not self.displayBlank:
if transition:
if self.hasTransition and self.frame[u'trans'] is not None:
if self.hasTransition:
if self.frame[u'trans'] is not None:
self.display.setPixmap(QtGui.QPixmap.fromImage(self.frame[u'trans']))
self.repaint()
if frame[u'trans'] is not None:
self.display.setPixmap(QtGui.QPixmap.fromImage(frame[u'trans']))
self.repaint()
self.hasTransition = True

View File

@ -354,9 +354,12 @@ class SlideController(QtGui.QWidget):
str_to_bool(self.songsconfig.get_config(u'show songbar', True)):
for action in self.Songbar.actions:
self.Songbar.actions[action].setVisible(False)
if item.verse_order:
hasButtons = False
for slide in self.slideList:
self.Songbar.actions[slide.lower()].setVisible(True)
if slide is not None:
self.Songbar.actions[slide].setVisible(True)
hasButtons = True
if hasButtons:
self.Songbar.setVisible(True)
elif item.is_image():
#Not sensible to allow loops with 1 frame
@ -447,9 +450,9 @@ class SlideController(QtGui.QWidget):
if self.serviceItem.is_text():
#only load the slot once
try:
test = self.slideList[frame[u'verseTag'].lower()]
test = self.slideList[frame[u'verseTag']]
except:
self.slideList[frame[u'verseTag'].lower()] = framenumber
self.slideList[frame[u'verseTag']] = framenumber
item.setText(frame[u'text'])
else:
label = QtGui.QLabel()

View File

@ -1,51 +0,0 @@
# -*- 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 MediaTab(SettingsTab):
"""
mediaTab is the media settings tab in the settings dialog.
"""
def __init__(self, title, section=None):
SettingsTab.__init__(self, title, section)
def setupUi(self):
self.setObjectName(u'MediaTab')
self.tabTitleVisible = self.trUtf8('Media')
#self.MediaLayout = QtGui.QFormLayout(self)
#self.MediaLayout.setObjectName(u'MediaLayout')
def retranslateUi(self):
pass
def load(self):
pass
def save(self):
pass

View File

@ -40,9 +40,6 @@ class MediaPlugin(Plugin):
# passed with drag and drop messages
self.dnd_id = u'Media'
def get_settings_tab(self):
return MediaTab(self.name)
def initialise(self):
log.info(u'Plugin Initialising')
Plugin.initialise(self)

View File

@ -369,7 +369,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
for count, parts in enumerate(match.split(u']---\n')):
if len(parts) > 1:
if count == 0:
variant = parts
#make sure the tag is correctly cased
variant = u'%s%s' % \
(parts[0:1].upper(), parts[1:].lower())
else:
if parts.endswith(u'\n'):
parts = parts.rstrip(u'\n')

View File

@ -289,28 +289,29 @@ class SongMediaItem(MediaManagerItem):
service_item.theme = song.theme_name
service_item.edit_enabled = True
service_item.editId = item_id
service_item.verse_order = song.verse_order
if song.lyrics.startswith(u'<?xml version='):
songXML = SongXMLParser(song.lyrics)
verseList = songXML.get_verses()
#no verse list or only 1 space (in error)
if service_item.verse_order is None or \
service_item.verse_order == u'' or service_item.verse_order == u' ':
if song.verse_order is None or \
song.verse_order == u'' or song.verse_order == u' ':
for verse in verseList:
service_item.add_from_text(verse[1][:30], unicode(verse[1]))
else:
#Loop through the verse list and expand the song accordingly.
for order in service_item.verse_order.split(u' '):
for order in song.verse_order.upper().split(u' '):
if len(order) == 0:
break
for verse in verseList:
if verse[1]:
if verse[0][u'type'].lower() == "verse" and \
verse[0][u'label'][0].lower() == order[1:].lower():
if verse[0][u'type'] == "Verse":
if verse[0][u'label'][0] == order[1:]:
verseTag = u'%s:%s' % \
(verse[0][u'type'], verse[0][u'label'])
service_item.add_from_text\
(verse[1][:30], verse[1], verseTag)
else:
if verse[0][u'type'][0].lower() == order[0].lower():
if verse[0][u'type'][0] == order[0]:
verseTag = u'%s:%s' % \
(verse[0][u'type'], verse[0][u'label'])
service_item.add_from_text\