This commit is contained in:
Tim Bentley 2011-03-19 07:29:13 +00:00
commit 10107f447b
11 changed files with 55 additions and 43 deletions

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

@ -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

@ -543,8 +543,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
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):
"""

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>

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()