This commit is contained in:
Jonathan Corwin 2011-03-19 12:32:26 +00:00
commit 1909e757e7
13 changed files with 161 additions and 216 deletions

View File

@ -32,27 +32,6 @@ from openlp.core.lib.ui import UiStrings
log = logging.getLogger(__name__)
class ValidEdit(QtGui.QLineEdit):
"""
Only allow numeric characters to be edited
"""
def __init__(self, parent):
"""
Set up Override and Validator
"""
QtGui.QLineEdit.__init__(self, parent)
self.setValidator(QtGui.QIntValidator(0, 9999, self))
def validText(self):
"""
Only return Integers. Space is 0
"""
if self.text().isEmpty():
return QtCore.QString(u'0')
else:
return self.text()
class GeneralTab(SettingsTab):
"""
GeneralTab is the general settings tab in the settings dialog.
@ -164,30 +143,6 @@ class GeneralTab(SettingsTab):
self.displayGroupBox.setObjectName(u'displayGroupBox')
self.displayLayout = QtGui.QGridLayout(self.displayGroupBox)
self.displayLayout.setObjectName(u'displayLayout')
self.currentXLabel = QtGui.QLabel(self.displayGroupBox)
self.currentXLabel.setObjectName(u'currentXLabel')
self.displayLayout.addWidget(self.currentXLabel, 0, 0)
self.currentXValueLabel = QtGui.QLabel(self.displayGroupBox)
self.currentXValueLabel.setObjectName(u'currentXValueLabel')
self.displayLayout.addWidget(self.currentXValueLabel, 1, 0)
self.currentYLabel = QtGui.QLabel(self.displayGroupBox)
self.currentYLabel.setObjectName(u'currentYLabel')
self.displayLayout.addWidget(self.currentYLabel, 0, 1)
self.currentYValueLabel = QtGui.QLabel(self.displayGroupBox)
self.currentYValueLabel.setObjectName(u'currentYValueLabel')
self.displayLayout.addWidget(self.currentYValueLabel, 1, 1)
self.currentWidthLabel = QtGui.QLabel(self.displayGroupBox)
self.currentWidthLabel.setObjectName(u'currentWidthLabel')
self.displayLayout.addWidget(self.currentWidthLabel, 0, 2)
self.currentWidthValueLabel = QtGui.QLabel(self.displayGroupBox)
self.currentWidthValueLabel.setObjectName(u'currentWidthValueLabel')
self.displayLayout.addWidget(self.currentWidthValueLabel, 1, 2)
self.currentHeightLabel = QtGui.QLabel(self.displayGroupBox)
self.currentHeightLabel.setObjectName(u'currentHeightLabel')
self.displayLayout.addWidget(self.currentHeightLabel, 0, 3)
self.currentHeightValueLabel = QtGui.QLabel(self.displayGroupBox)
self.currentHeightValueLabel.setObjectName(u'Height')
self.displayLayout.addWidget(self.currentHeightValueLabel, 1, 3)
self.overrideCheckBox = QtGui.QCheckBox(self.displayGroupBox)
self.overrideCheckBox.setObjectName(u'overrideCheckBox')
self.displayLayout.addWidget(self.overrideCheckBox, 2, 0, 1, 4)
@ -196,26 +151,30 @@ class GeneralTab(SettingsTab):
self.customXLabel = QtGui.QLabel(self.displayGroupBox)
self.customXLabel.setObjectName(u'customXLabel')
self.displayLayout.addWidget(self.customXLabel, 3, 0)
self.customXValueEdit = ValidEdit(self.displayGroupBox)
self.customXValueEdit = QtGui.QSpinBox(self.displayGroupBox)
self.customXValueEdit.setObjectName(u'customXValueEdit')
self.customXValueEdit.setMaximum(9999)
self.displayLayout.addWidget(self.customXValueEdit, 4, 0)
self.customYLabel = QtGui.QLabel(self.displayGroupBox)
self.customYLabel.setObjectName(u'customYLabel')
self.displayLayout.addWidget(self.customYLabel, 3, 1)
self.customYValueEdit = ValidEdit(self.displayGroupBox)
self.customYValueEdit = QtGui.QSpinBox(self.displayGroupBox)
self.customYValueEdit.setObjectName(u'customYValueEdit')
self.customYValueEdit.setMaximum(9999)
self.displayLayout.addWidget(self.customYValueEdit, 4, 1)
self.customWidthLabel = QtGui.QLabel(self.displayGroupBox)
self.customWidthLabel.setObjectName(u'customWidthLabel')
self.displayLayout.addWidget(self.customWidthLabel, 3, 2)
self.customWidthValueEdit = ValidEdit(self.displayGroupBox)
self.customWidthValueEdit = QtGui.QSpinBox(self.displayGroupBox)
self.customWidthValueEdit.setObjectName(u'customWidthValueEdit')
self.customWidthValueEdit.setMaximum(9999)
self.displayLayout.addWidget(self.customWidthValueEdit, 4, 2)
self.customHeightLabel = QtGui.QLabel(self.displayGroupBox)
self.customHeightLabel.setObjectName(u'customHeightLabel')
self.displayLayout.addWidget(self.customHeightLabel, 3, 3)
self.customHeightValueEdit = ValidEdit(self.displayGroupBox)
self.customHeightValueEdit = QtGui.QSpinBox(self.displayGroupBox)
self.customHeightValueEdit.setObjectName(u'customHeightValueEdit')
self.customHeightValueEdit.setMaximum(9999)
self.displayLayout.addWidget(self.customHeightValueEdit, 4, 3)
self.rightLayout.addWidget(self.displayGroupBox)
self.rightLayout.addStretch()
@ -223,17 +182,13 @@ class GeneralTab(SettingsTab):
QtCore.QObject.connect(self.overrideCheckBox,
QtCore.SIGNAL(u'toggled(bool)'), self.onOverrideCheckBoxToggled)
QtCore.QObject.connect(self.customHeightValueEdit,
QtCore.SIGNAL(u'textEdited(const QString&)'),
self.onDisplayPositionChanged)
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayPositionChanged)
QtCore.QObject.connect(self.customWidthValueEdit,
QtCore.SIGNAL(u'textEdited(const QString&)'),
self.onDisplayPositionChanged)
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayPositionChanged)
QtCore.QObject.connect(self.customYValueEdit,
QtCore.SIGNAL(u'textEdited(const QString&)'),
self.onDisplayPositionChanged)
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayPositionChanged)
QtCore.QObject.connect(self.customXValueEdit,
QtCore.SIGNAL(u'textEdited(const QString&)'),
self.onDisplayPositionChanged)
QtCore.SIGNAL(u'valueChanged(int)'), self.onDisplayPositionChanged)
# Reload the tab, as the screen resolution/count may have changed.
QtCore.QObject.connect(Receiver.get_receiver(),
QtCore.SIGNAL(u'config_screen_changed'), self.load)
@ -273,8 +228,7 @@ class GeneralTab(SettingsTab):
'Automatically preview next item in service'))
self.timeoutLabel.setText(translate('OpenLP.GeneralTab',
'Slide loop delay:'))
self.timeoutSpinBox.setSuffix(
translate('OpenLP.GeneralTab', ' sec'))
self.timeoutSpinBox.setSuffix(translate('OpenLP.GeneralTab', ' sec'))
self.ccliGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'CCLI Details'))
self.numberLabel.setText(UiStrings.CCLINumberLabel)
@ -285,22 +239,11 @@ class GeneralTab(SettingsTab):
# Moved from display tab
self.displayGroupBox.setTitle(
translate('OpenLP.GeneralTab', 'Display Position'))
self.currentXLabel.setText(translate('OpenLP.GeneralTab', 'X'))
self.currentXValueLabel.setText(u'0')
self.currentYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
self.currentYValueLabel.setText(u'0')
self.currentHeightLabel.setText(
translate('OpenLP.GeneralTab', 'Height'))
self.currentHeightValueLabel.setText(u'0')
self.currentWidthLabel.setText(
translate('OpenLP.GeneralTab', 'Width'))
self.currentWidthValueLabel.setText(u'0')
self.overrideCheckBox.setText(translate('OpenLP.GeneralTab',
'Override display position'))
self.customXLabel.setText(translate('OpenLP.GeneralTab', 'X'))
self.customYLabel.setText(translate('OpenLP.GeneralTab', 'Y'))
self.customHeightLabel.setText(
translate('OpenLP.GeneralTab', 'Height'))
self.customHeightLabel.setText(translate('OpenLP.GeneralTab', 'Height'))
self.customWidthLabel.setText(translate('OpenLP.GeneralTab', 'Width'))
def load(self):
@ -310,8 +253,7 @@ class GeneralTab(SettingsTab):
settings = QtCore.QSettings()
settings.beginGroup(self.settingsSection)
self.monitorComboBox.clear()
for screen in self.screens.get_screen_list():
self.monitorComboBox.addItem(screen)
self.monitorComboBox.addItems(self.screens.get_screen_list())
self.numberEdit.setText(unicode(settings.value(
u'ccli number', QtCore.QVariant(u'')).toString()))
self.usernameEdit.setText(unicode(settings.value(
@ -334,26 +276,16 @@ class GeneralTab(SettingsTab):
QtCore.QVariant(False)).toBool())
self.timeoutSpinBox.setValue(settings.value(u'loop delay',
QtCore.QVariant(5)).toInt()[0])
self.currentXValueLabel.setText(
unicode(self.screens.current[u'size'].x()))
self.currentYValueLabel.setText(
unicode(self.screens.current[u'size'].y()))
self.currentHeightValueLabel.setText(
unicode(self.screens.current[u'size'].height()))
self.currentWidthValueLabel.setText(
unicode(self.screens.current[u'size'].width()))
self.overrideCheckBox.setChecked(settings.value(u'override position',
QtCore.QVariant(False)).toBool())
self.customXValueEdit.setText(settings.value(u'x position',
QtCore.QVariant(self.screens.current[u'size'].x())).toString())
self.customYValueEdit.setText(settings.value(u'y position',
QtCore.QVariant(self.screens.current[u'size'].y())).toString())
self.customHeightValueEdit.setText(
settings.value(u'height', QtCore.QVariant(
self.screens.current[u'size'].height())).toString())
self.customWidthValueEdit.setText(
settings.value(u'width', QtCore.QVariant(
self.screens.current[u'size'].width())).toString())
self.customXValueEdit.setValue(settings.value(u'x position',
QtCore.QVariant(self.screens.current[u'size'].x())).toInt()[0])
self.customYValueEdit.setValue(settings.value(u'y position',
QtCore.QVariant(self.screens.current[u'size'].y())).toInt()[0])
self.customHeightValueEdit.setValue(settings.value(u'height',
QtCore.QVariant(self.screens.current[u'size'].height())).toInt()[0])
self.customWidthValueEdit.setValue(settings.value(u'width',
QtCore.QVariant(self.screens.current[u'size'].width())).toInt()[0])
settings.endGroup()
self.customXValueEdit.setEnabled(self.overrideCheckBox.isChecked())
self.customYValueEdit.setEnabled(self.overrideCheckBox.isChecked())
@ -391,13 +323,13 @@ class GeneralTab(SettingsTab):
settings.setValue(u'songselect password',
QtCore.QVariant(self.passwordEdit.displayText()))
settings.setValue(u'x position',
QtCore.QVariant(self.customXValueEdit.text()))
QtCore.QVariant(self.customXValueEdit.value()))
settings.setValue(u'y position',
QtCore.QVariant(self.customYValueEdit.text()))
QtCore.QVariant(self.customYValueEdit.value()))
settings.setValue(u'height',
QtCore.QVariant(self.customHeightValueEdit.text()))
QtCore.QVariant(self.customHeightValueEdit.value()))
settings.setValue(u'width',
QtCore.QVariant(self.customWidthValueEdit.text()))
QtCore.QVariant(self.customWidthValueEdit.value()))
settings.setValue(u'override position',
QtCore.QVariant(self.overrideCheckBox.isChecked()))
settings.endGroup()
@ -421,10 +353,10 @@ class GeneralTab(SettingsTab):
# Reset screens after initial definition
if self.overrideChanged:
self.screens.override[u'size'] = QtCore.QRect(
int(self.customXValueEdit.validText()),
int(self.customYValueEdit.validText()),
int(self.customWidthValueEdit.validText()),
int(self.customHeightValueEdit.validText()))
self.customXValueEdit.value(),
self.customYValueEdit.value(),
self.customWidthValueEdit.value(),
self.customHeightValueEdit.value())
if self.overrideCheckBox.isChecked():
self.screens.set_override_display()
else:

View File

@ -117,7 +117,8 @@ class SlideController(QtGui.QWidget):
self.previewListWidget.setColumnWidth(0, self.controller.width())
self.previewListWidget.isLive = self.isLive
self.previewListWidget.setObjectName(u'PreviewListWidget')
self.previewListWidget.setSelectionBehavior(1)
self.previewListWidget.setSelectionBehavior(
QtGui.QAbstractItemView.SelectRows)
self.previewListWidget.setSelectionMode(
QtGui.QAbstractItemView.SingleSelection)
self.previewListWidget.setEditTriggers(

View File

@ -220,10 +220,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
Removes the current row from the list.
"""
self.slideListView.takeItem(self.slideListView.currentRow())
if self.slideListView.currentRow() == 0:
self.upButton.setEnabled(False)
if self.slideListView.currentRow() == self.slideListView.count():
self.downButton.setEnabled(False)
self.onCurrentRowChanged(self.slideListView.currentRow())
def onCurrentRowChanged(self, row):
"""

View File

@ -24,6 +24,7 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
from datetime import datetime
import logging
import os
@ -139,11 +140,16 @@ class MediaMediaItem(MediaManagerItem):
file_size = os.path.getsize(filename)
# File too big for processing
if file_size <= 52428800: # 50MiB
start = datetime.now()
while not self.mediaState:
Receiver.send_message(u'openlp_process_events')
service_item.media_length = self.mediaLength
service_item.add_capability(
ItemCapabilities.AllowsVariableStartTime)
tme = datetime.now() - start
if tme.seconds > 5:
break
if self.mediaState:
service_item.media_length = self.mediaLength
service_item.add_capability(
ItemCapabilities.AllowsVariableStartTime)
service_item.add_from_command(path, name, frame)
return True
else:
@ -189,4 +195,4 @@ class MediaMediaItem(MediaManagerItem):
if newState == Phonon.PlayingState:
self.mediaState = newState
self.mediaLength = self.mediaObject.totalTime()/1000
self.mediaObject.stop()
self.mediaObject.stop()

View File

@ -71,6 +71,8 @@ class Ui_EditSongDialog(object):
self.verseListWidget.setColumnCount(1)
self.verseListWidget.setSelectionBehavior(
QtGui.QAbstractItemView.SelectRows)
self.verseListWidget.setSelectionMode(
QtGui.QAbstractItemView.SingleSelection)
self.verseListWidget.setEditTriggers(
QtGui.QAbstractItemView.NoEditTriggers)
self.verseListWidget.setObjectName(u'verseListWidget')

View File

@ -297,7 +297,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.verseOrderEdit.setText(u' '.join(translated))
else:
self.verseOrderEdit.setText(u'')
self.verseListWidget.resizeRowsToContents()
self.tagRows()
# clear the results
self.authorsListView.clear()
@ -312,10 +311,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
topic_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(topic.id))
self.topicsListView.addItem(topic_name)
self.titleEdit.setFocus(QtCore.Qt.OtherFocusReason)
# if not preview hide the preview button
self.previewButton.setVisible(False)
if preview:
self.previewButton.setVisible(True)
# Hide or show the preview button.
self.previewButton.setVisible(preview)
def tagRows(self):
"""
@ -329,6 +326,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
row_def = u'%s%s' % (verse_tag, verse_def[1:])
row_label.append(row_def)
self.verseListWidget.setVerticalHeaderLabels(row_label)
self.verseListWidget.setColumnWidth(0, self.width)
self.verseListWidget.resizeRowsToContents()
self.verseListWidget.repaint()
def onAuthorAddButtonClicked(self):
item = int(self.authorsComboBox.currentIndex())
@ -453,9 +453,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.verseListWidget.setRowCount(
self.verseListWidget.rowCount() + 1)
self.verseListWidget.setItem(
int(self.verseListWidget.rowCount() - 1), 0, item)
self.verseListWidget.setColumnWidth(0, self.width)
self.verseListWidget.resizeRowsToContents()
self.verseListWidget.rowCount() - 1, 0, item)
self.tagRows()
def onVerseEditButtonClicked(self):
@ -482,8 +480,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
item = QtGui.QTableWidgetItem(tempList[row], 0)
item.setData(QtCore.Qt.UserRole, tempId[row])
self.verseListWidget.setItem(row, 0, item)
self.verseListWidget.resizeRowsToContents()
self.verseListWidget.repaint()
self.tagRows()
def onVerseEditAllButtonClicked(self):
@ -500,58 +496,56 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.verse_form.setVerse(verse_list)
else:
self.verse_form.setVerse(u'')
if self.verse_form.exec_():
verse_list = self.verse_form.getVerseAll()
verse_list = unicode(verse_list.replace(u'\r\n', u'\n'))
self.verseListWidget.clear()
self.verseListWidget.setRowCount(0)
for row in self.findVerseSplit.split(verse_list):
for match in row.split(u'---['):
for count, parts in enumerate(match.split(u']---\n')):
if len(parts) > 1:
if count == 0:
# handling carefully user inputted versetags
separator = parts.find(u':')
if separator >= 0:
verse_name = parts[0:separator].strip()
verse_num = parts[separator+1:].strip()
else:
verse_name = parts
verse_num = u'1'
verse_index = \
VerseType.from_loose_input(verse_name)
verse_tag = VerseType.Tags[verse_index]
# Later we need to handle v1a as well.
#regex = re.compile(r'(\d+\w.)')
regex = re.compile(r'\D*(\d+)\D*')
match = regex.match(verse_num)
if match:
verse_num = match.group(1)
else:
verse_num = u'1'
verse_def = u'%s%s' % (verse_tag, verse_num)
else:
if parts.endswith(u'\n'):
parts = parts.rstrip(u'\n')
item = QtGui.QTableWidgetItem(parts)
item.setData(QtCore.Qt.UserRole,
QtCore.QVariant(verse_def))
self.verseListWidget.setRowCount(
self.verseListWidget.rowCount() + 1)
self.verseListWidget.setItem(
int(self.verseListWidget.rowCount() - 1),
0, item)
self.verseListWidget.setColumnWidth(0, self.width)
self.verseListWidget.resizeRowsToContents()
self.verseListWidget.repaint()
self.tagRows()
self.verseEditButton.setEnabled(False)
self.verseDeleteButton.setEnabled(False)
if not self.verse_form.exec_():
return
verse_list = self.verse_form.getVerseAll()
verse_list = unicode(verse_list.replace(u'\r\n', u'\n'))
self.verseListWidget.clear()
self.verseListWidget.setRowCount(0)
for row in self.findVerseSplit.split(verse_list):
for match in row.split(u'---['):
for count, parts in enumerate(match.split(u']---\n')):
if len(parts) <= 1:
continue
if count == 0:
# handling carefully user inputted versetags
separator = parts.find(u':')
if separator >= 0:
verse_name = parts[0:separator].strip()
verse_num = parts[separator+1:].strip()
else:
verse_name = parts
verse_num = u'1'
verse_index = VerseType.from_loose_input(verse_name)
verse_tag = VerseType.Tags[verse_index]
# Later we need to handle v1a as well.
#regex = re.compile(r'(\d+\w.)')
regex = re.compile(r'\D*(\d+)\D*')
match = regex.match(verse_num)
if match:
verse_num = match.group(1)
else:
verse_num = u'1'
verse_def = u'%s%s' % (verse_tag, verse_num)
else:
if parts.endswith(u'\n'):
parts = parts.rstrip(u'\n')
item = QtGui.QTableWidgetItem(parts)
item.setData(QtCore.Qt.UserRole,
QtCore.QVariant(verse_def))
self.verseListWidget.setRowCount(
self.verseListWidget.rowCount() + 1)
self.verseListWidget.setItem(
self.verseListWidget.rowCount() - 1, 0, item)
self.tagRows()
self.verseEditButton.setEnabled(False)
self.verseDeleteButton.setEnabled(False)
def onVerseDeleteButtonClicked(self):
self.verseListWidget.removeRow(self.verseListWidget.currentRow())
self.verseEditButton.setEnabled(False)
self.verseDeleteButton.setEnabled(False)
if not self.verseListWidget.selectedItems():
self.verseEditButton.setEnabled(False)
self.verseDeleteButton.setEnabled(False)
def _validate_song(self):
"""
@ -728,7 +722,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.song.title = unicode(self.titleEdit.text())
self.song.alternate_title = unicode(self.alternativeEdit.text())
self.song.copyright = unicode(self.copyrightEdit.text())
# Values will be set when cleaning the song.
# Values will be set when cleaning the song.
self.song.search_title = u''
self.song.search_lyrics = u''
self.song.verse_order = u''
@ -753,7 +747,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.song.theme_name = theme_name
else:
self.song.theme_name = None
self.processLyrics()
self._processLyrics()
self.song.authors = []
for row in range(self.authorsListView.count()):
item = self.authorsListView.item(row)
@ -769,12 +763,12 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if not preview:
self.song = None
def processLyrics(self):
def _processLyrics(self):
"""
Process the lyric data entered by the user into the OpenLP XML format.
"""
# This method must only be run after the self.song = Song() assignment.
log.debug(u'processLyrics')
log.debug(u'_processLyrics')
try:
sxml = SongXML()
multiple = []

View File

@ -271,6 +271,18 @@ def clean_song(manager, song):
verses = SongXML().get_verses(song.lyrics)
lyrics = u' '.join([whitespace.sub(u' ', verse[1]) for verse in verses])
song.search_lyrics = lyrics.lower()
# We need a new and clean SongXML instance.
sxml = SongXML()
# Rebuild the song's verses, to remove any wrong verse names (for example
# translated ones), which might have been added prior to 1.9.5.
for verse in verses:
sxml.add_verse_to_lyrics(
VerseType.Tags[VerseType.from_loose_input(verse[0][u'type'])],
verse[0][u'label'],
verse[1],
verse[0][u'lang'] if verse[0].has_key(u'lang') else None
)
song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
# The song does not have any author, add one.
if not song.authors:
name = SongStrings.AuthorUnknown

View File

@ -34,31 +34,32 @@ import os
import re
from openlp.core.ui.wizard import WizardStrings
from openlp.plugins.songs.lib import VerseType
from openlp.plugins.songs.lib.songimport import SongImport
log = logging.getLogger(__name__)
class SongBeamerTypes(object):
MarkTypes = {
u'Refrain': u'C',
u'Chorus': u'C',
u'Vers': u'V',
u'Verse': u'V',
u'Strophe': u'V',
u'Intro': u'I',
u'Coda': u'E',
u'Ending': u'E',
u'Bridge': u'B',
u'Interlude': u'B',
u'Zwischenspiel': u'B',
u'Pre-Chorus': u'P',
u'Pre-Refrain': u'P',
u'Pre-Bridge': u'O',
u'Pre-Coda': u'O',
u'Unbekannt': u'O',
u'Unknown': u'O',
u'Unbenannt': u'O'
}
u'Refrain': VerseType.Tags[VerseType.Chorus],
u'Chorus': VerseType.Tags[VerseType.Chorus],
u'Vers': VerseType.Tags[VerseType.Verse],
u'Verse': VerseType.Tags[VerseType.Verse],
u'Strophe': VerseType.Tags[VerseType.Verse],
u'Intro': VerseType.Tags[VerseType.Intro],
u'Coda': VerseType.Tags[VerseType.Ending],
u'Ending': VerseType.Tags[VerseType.Ending],
u'Bridge': VerseType.Tags[VerseType.Bridge],
u'Interlude': VerseType.Tags[VerseType.Bridge],
u'Zwischenspiel': VerseType.Tags[VerseType.Bridge],
u'Pre-Chorus': VerseType.Tags[VerseType.PreChorus],
u'Pre-Refrain': VerseType.Tags[VerseType.PreChorus],
u'Pre-Bridge': VerseType.Tags[VerseType.Other],
u'Pre-Coda': VerseType.Tags[VerseType.Other],
u'Unbekannt': VerseType.Tags[VerseType.Other],
u'Unknown': VerseType.Tags[VerseType.Other],
u'Unbenannt': VerseType.Tags[VerseType.Other]
}
class SongBeamerImport(SongImport):
@ -84,7 +85,7 @@ class SongBeamerImport(SongImport):
# TODO: check that it is a valid SongBeamer file
self.set_defaults()
self.current_verse = u''
self.current_verse_type = u'V'
self.current_verse_type = VerseType.Tags[VerseType.Verse]
read_verses = False
file_name = os.path.split(file)[1]
self.import_wizard.incrementProgressBar(
@ -111,7 +112,7 @@ class SongBeamerImport(SongImport):
self.add_verse(self.current_verse,
self.current_verse_type)
self.current_verse = u''
self.current_verse_type = u'V'
self.current_verse_type = VerseType.Tags[VerseType.Verse]
read_verses = True
verse_start = True
elif read_verses:
@ -157,7 +158,7 @@ class SongBeamerImport(SongImport):
(u'<[/]?c.*?>', u''),
(u'<align.*?>', u''),
(u'<valign.*?>', u'')
]
]
for pair in tag_pairs:
self.current_verse = re.compile(pair[0]).sub(pair[1],
self.current_verse)

View File

@ -31,7 +31,7 @@ The basic XML for storing the lyrics in the song database looks like this::
<?xml version="1.0" encoding="UTF-8"?>
<song version="1.0">
<lyrics>
<verse type="Chorus" label="1" lang="en">
<verse type="c" label="1" lang="en">
<![CDATA[ ... ]]>
</verse>
</lyrics>
@ -89,8 +89,8 @@ class SongXML(object):
Add a verse to the ``<lyrics>`` tag.
``type``
A string denoting the type of verse. Possible values are *Verse*,
*Chorus*, *Bridge*, *Pre-Chorus*, *Intro*, *Ending* and *Other*.
A string denoting the type of verse. Possible values are *v*,
*c*, *b*, *p*, *i*, *e* and *o*.
Any other type is **not** allowed, this also includes translated
types.
@ -128,8 +128,8 @@ class SongXML(object):
The returned list has the following format::
[[{'lang': 'en', 'type': 'Verse', 'label': '1'}, u"English verse"],
[{'lang': 'en', 'type': 'Chorus', 'label': '1'}, u"English chorus"]]
[[{'lang': 'en', 'type': 'v', 'label': '1'}, u"English verse"],
[{'lang': 'en', 'type': 'c', 'label': '1'}, u"English chorus"]]
"""
self.song_xml = None
if xml[:5] == u'<?xml':
@ -451,10 +451,12 @@ class OpenLyrics(object):
if text:
text += u'\n'
text += u'\n'.join([unicode(line) for line in lines.line])
verse_name = self._get(verse, u'name')
verse_type_index = VerseType.from_tag(verse_name[0])
verse_type = VerseType.Names[verse_type_index]
verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_name)
verse_def = self._get(verse, u'name').lower()
if verse_def[0] in VerseType.Tags:
verse_tag = verse_def[0]
else:
verse_tag = VerseType.Tags[VerseType.Other]
verse_number = re.compile(u'[a-zA-Z]*').sub(u'', verse_def)
# OpenLyrics allows e. g. "c", but we need "c1". However, this does
# not correct the verse order.
if not verse_number:
@ -462,7 +464,7 @@ class OpenLyrics(object):
lang = None
if self._get(verse, u'lang'):
lang = self._get(verse, u'lang')
sxml.add_verse_to_lyrics(verse_type, verse_number, text, lang)
sxml.add_verse_to_lyrics(verse_tag, verse_number, text, lang)
song.lyrics = unicode(sxml.extract_xml(), u'utf-8')
# Process verse order
if hasattr(properties, u'verseOrder'):

View File

@ -31,9 +31,9 @@ OutputDir=..\..\dist
OutputBaseFilename=OpenLP-{#RealVersion}-setup
Compression=lzma
SolidCompression=true
SetupIconFile=C:\Program Files\Inno Setup 5\Examples\Setup.ico
WizardImageFile=C:\Program Files\Inno Setup 5\WizModernImage-IS.bmp
WizardSmallImageFile=C:\Program Files\Inno Setup 5\WizModernSmallImage-IS.bmp
SetupIconFile=OpenLP.ico
WizardImageFile=WizImageBig.bmp
WizardSmallImageFile=WizImageSmall.bmp
[Languages]
Name: english; MessagesFile: compiler:Default.isl
@ -78,15 +78,6 @@ Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filenam
Filename: {app}\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent
[Registry]
Root: HKCU; SubKey: Software\OpenLP\OpenLP\alerts; ValueType: dword; ValueName: status; ValueData: $00000001
Root: HKCU; SubKey: Software\OpenLP\OpenLP\bibles; ValueType: dword; ValueName: status; ValueData: $00000001
Root: HKCU; SubKey: Software\OpenLP\OpenLP\custom; ValueType: dword; ValueName: status; ValueData: $00000001
Root: HKCU; SubKey: Software\OpenLP\OpenLP\images; ValueType: dword; ValueName: status; ValueData: $00000001
Root: HKCU; SubKey: Software\OpenLP\OpenLP\media; ValueType: dword; ValueName: status; ValueData: $00000001
Root: HKCU; SubKey: Software\OpenLP\OpenLP\presentations; ValueType: dword; ValueName: status; ValueData: $00000001
Root: HKCU; SubKey: Software\OpenLP\OpenLP\remotes; ValueType: dword; ValueName: status; ValueData: $00000000
Root: HKCU; SubKey: Software\OpenLP\OpenLP\songs; ValueType: dword; ValueName: status; ValueData: $00000001
Root: HKCU; SubKey: Software\OpenLP\OpenLP\songusage; ValueType: dword; ValueName: status; ValueData: $00000001
[Code]
function GetUninstallString(): String;

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@ -116,8 +116,15 @@ dist_path = os.path.join(branch_path, u'dist', u'OpenLP')
enchant_path = os.path.join(site_packages, u'enchant')
def update_code():
print u'Updating the code...'
os.chdir(branch_path)
print u'Reverting any changes to the code...'
bzr = Popen((u'bzr', u'revert'), stdout=PIPE)
output, error = bzr.communicate()
code = bzr.wait()
if code != 0:
print output
raise Exception(u'Error reverting the code')
print u'Updating the code...'
bzr = Popen((u'bzr', u'update'), stdout=PIPE)
output, error = bzr.communicate()
code = bzr.wait()