Merged in latest changes from trunk

This commit is contained in:
Raoul Snyman 2009-07-14 10:55:10 +02:00
commit dbf94e19e6
7 changed files with 54 additions and 20 deletions

View File

@ -8,3 +8,5 @@
.eric4project .eric4project
list list
openlp.org 2.0.e4* openlp.org 2.0.e4*
documentation/build/html
documentation/build/doctrees

View File

@ -116,6 +116,7 @@ class CWExtract(BibleCommon):
## Strip Verse Data from Page and build an array ## Strip Verse Data from Page and build an array
## ##
#log.debug(u'bible data %s', xml_string) #log.debug(u'bible data %s', xml_string)
#print xml_string
i= xml_string.find(u'NavCurrentChapter') i= xml_string.find(u'NavCurrentChapter')
xml_string = xml_string[i:len(xml_string)] xml_string = xml_string[i:len(xml_string)]
i= xml_string.find(u'<TABLE') i= xml_string.find(u'<TABLE')
@ -136,11 +137,10 @@ class CWExtract(BibleCommon):
i = xml_string.find(u'</I></B>', versePos) i = xml_string.find(u'</I></B>', versePos)
#log.debug( versePos, i) #log.debug( versePos, i)
verse= xml_string[versePos:i] # Got the Chapter verse= xml_string[versePos:i] # Got the Chapter
#verse = int(temp)
#log.debug( 'Chapter = %s', verse) #log.debug( 'Chapter = %s', verse)
# move the starting position to begining of the text # move the starting position to begining of the text
versePos = i + 8 versePos = i + 8
# fined the start of the next verse # find the start of the next verse
i = xml_string.find(u'<B><I>', versePos) i = xml_string.find(u'<B><I>', versePos)
if i == -1: if i == -1:
i = xml_string.find(u'</BLOCKQUOTE>',versePos) i = xml_string.find(u'</BLOCKQUOTE>',versePos)
@ -150,6 +150,7 @@ class CWExtract(BibleCommon):
#log.debug( i, versePos) #log.debug( i, versePos)
verseText = xml_string[versePos: i] verseText = xml_string[versePos: i]
versePos = i versePos = i
#print verseText
bible[verse] = self._clean_text(verseText) bible[verse] = self._clean_text(verseText)
#bible[verse] = verseText #bible[verse] = verseText

View File

@ -132,6 +132,11 @@ class BibleCommon(object):
end_tag = text.find(u'</sup>') end_tag = text.find(u'</sup>')
text = text[:start_tag] + text[end_tag + 6:len(text)] text = text[:start_tag] + text[end_tag + 6:len(text)]
start_tag = text.find(u'<sup>') start_tag = text.find(u'<sup>')
start_tag = text.find(u'<SUP>')
while start_tag > -1:
end_tag = text.find(u'</SUP>')
text = text[:start_tag] + text[end_tag + 6:len(text)]
start_tag = text.find(u'<SUP>')
# Static Clean ups # Static Clean ups
text = text.replace(u'\n', u'') text = text.replace(u'\n', u'')
text = text.replace(u'\r', u'') text = text.replace(u'\r', u'')

View File

@ -350,7 +350,8 @@ class BibleMediaItem(MediaManagerItem):
chapter = unicode(self.search_results[0][1]) chapter = unicode(self.search_results[0][1])
verse = unicode(self.search_results[0][2]) verse = unicode(self.search_results[0][2])
text = self.search_results[0][3] text = self.search_results[0][3]
if self.parent.bibles_tab.paragraph_style: #Paragraph #Paragraph style force new line per verse
if self.parent.bibles_tab.paragraph_style:
text = text + u'\n\n' text = text + u'\n\n'
if self.parent.bibles_tab.display_style == 1: if self.parent.bibles_tab.display_style == 1:
loc = self.formatVerse(old_chapter, chapter, verse, u'(u', u')') loc = self.formatVerse(old_chapter, chapter, verse, u'(u', u')')
@ -363,8 +364,11 @@ class BibleMediaItem(MediaManagerItem):
old_chapter = chapter old_chapter = chapter
bible_text = bible_text + u' '+ loc + u' '+ text bible_text = bible_text + u' '+ loc + u' '+ text
service_item.title = book + u' ' + loc service_item.title = book + u' ' + loc
if len(raw_footer) <= 1: footer = book + u' (' + self.version + u' ' + self.copyright +u')'
raw_footer.append(book) try:
raw_footer.index(footer)
except:
raw_footer.append(footer)
if len(self.parent.bibles_tab.bible_theme) == 0: if len(self.parent.bibles_tab.bible_theme) == 0:
service_item.theme = None service_item.theme = None
else: else:
@ -503,6 +507,9 @@ class BibleMediaItem(MediaManagerItem):
self.search_results = self.parent.biblemanager.get_verse_text(bible, book, self.search_results = self.parent.biblemanager.get_verse_text(bible, book,
int(start_chapter), int(end_chapter), int(start_verse), int(start_chapter), int(end_chapter), int(start_verse),
int(end_verse)) int(end_verse))
self.copyright = unicode(self.parent.biblemanager.get_meta_data(bible, u'Copyright').value)
self.permissions = unicode(self.parent.biblemanager.get_meta_data(bible, u'Permissions').value)
self.version = unicode(self.parent.biblemanager.get_meta_data(bible, u'Version').value)
else: else:
reply = QtGui.QMessageBox.information(self, reply = QtGui.QMessageBox.information(self,
translate(u'BibleMediaItem', u'Information'), translate(u'BibleMediaItem', u'Information'),

View File

@ -139,6 +139,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.AuthorsListView.clear() self.AuthorsListView.clear()
self.TopicsListView.clear() self.TopicsListView.clear()
self.title_change = False self.title_change = False
self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
def loadSong(self, id): def loadSong(self, id):
log.debug(u'Load Song') log.debug(u'Load Song')
@ -161,16 +162,19 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.SongbookCombo.setCurrentIndex(id) self.SongbookCombo.setCurrentIndex(id)
if len(title) > 1: if len(title) > 1:
self.AlternativeEdit.setText(title[1]) self.AlternativeEdit.setText(title[1])
self.CopyrightEditItem.setText(self.song.copyright) if self.song.copyright is not None:
self.CopyrightEditItem.setText(self.song.copyright)
else:
self.CopyrightEditItem.setText(u'')
self.VerseListWidget.clear() self.VerseListWidget.clear()
if self.song.verse_order is not None: if self.song.verse_order is not None:
self.VerseOrderEdit.setText(self.song.verse_order) self.VerseOrderEdit.setText(self.song.verse_order)
else: else:
self.VerseOrderEdit.setText(u'') self.VerseOrderEdit.setText(u'')
if self.song.comments is not None: if self.song.comments is not None:
self.CommentsEdit.setText(self.song.comments) self.CommentsEdit.setPlainText(self.song.comments)
else: else:
self.CommentsEdit.setText(u'') self.CommentsEdit.setPlainText(u'')
if self.song.ccli_number is not None: if self.song.ccli_number is not None:
self.CCLNumberEdit.setText(self.song.ccli_number) self.CCLNumberEdit.setText(self.song.ccli_number)
else: else:
@ -199,6 +203,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.TopicsListView.addItem(topic_name) self.TopicsListView.addItem(topic_name)
self._validate_song() self._validate_song()
self.title_change = False self.title_change = False
self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
def onAuthorAddtoSongItemClicked(self): def onAuthorAddtoSongItemClicked(self):
item = int(self.AuthorsSelectionComboItem.currentIndex()) item = int(self.AuthorsSelectionComboItem.currentIndex())
@ -296,6 +301,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.verse_form.setVerse(item.text()) self.verse_form.setVerse(item.text())
self.verse_form.exec_() self.verse_form.exec_()
item.setText(self.verse_form.getVerse()) item.setText(self.verse_form.getVerse())
self.VerseListWidget.update()
self.EditButton.setEnabled(False) self.EditButton.setEnabled(False)
self.DeleteButton.setEnabled(False) self.DeleteButton.setEnabled(False)
@ -356,7 +362,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
return return
self.song.title = unicode(self.TitleEditItem.displayText()) self.song.title = unicode(self.TitleEditItem.displayText())
self.song.copyright = unicode(self.CopyrightEditItem.displayText()) self.song.copyright = unicode(self.CopyrightEditItem.displayText())
self.song.search_title = self.TitleEditItem.displayText() + u'@'+ self.AlternativeEdit.displayText() self.song.search_title = unicode(self.TitleEditItem.displayText()) + u'@'+ unicode(self.AlternativeEdit.displayText())
self.song.comments = unicode(self.CommentsEdit.toPlainText())
self.song.ccli_number = unicode(self.CCLNumberEdit.displayText())
self.processLyrics() self.processLyrics()
self.processTitle() self.processTitle()
self.song.song_book_id = 0 self.song.song_book_id = 0
@ -380,7 +388,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
count += 1 count += 1
if self.song.verse_order is None: if self.song.verse_order is None:
self.song.verse_order = verse_order self.song.verse_order = verse_order
text = text.replace("'", u'') text = text.replace(u'\'', u'')
text = text.replace(u',', u'') text = text.replace(u',', u'')
text = text.replace(u';', u'') text = text.replace(u';', u'')
text = text.replace(u':', u'') text = text.replace(u':', u'')
@ -394,7 +402,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
def processTitle(self): def processTitle(self):
log.debug(u'processTitle') log.debug(u'processTitle')
self.song.search_title = self.song.search_title.replace("'", 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'')
self.song.search_title = self.song.search_title.replace(u':', u'') self.song.search_title = self.song.search_title.replace(u':', u'')

View File

@ -1,12 +1,22 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
"""
OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
# Form implementation generated from reading ui file '/home/raoul/Projects/openlp-2/resources/forms/editversedialog.ui' 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
# Created: Sat Mar 7 11:11:49 2009 Foundation; version 2 of the License.
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
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 PyQt4 import QtCore, QtGui
from openlp.core.lib import translate from openlp.core.lib import translate
@ -28,11 +38,11 @@ class Ui_EditVerseDialog(object):
self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save)
self.ButtonBox.setObjectName(u'ButtonBox') self.ButtonBox.setObjectName(u'ButtonBox')
self.DialogLayout.addWidget(self.ButtonBox) self.DialogLayout.addWidget(self.ButtonBox)
self.retranslateUi(EditVerseDialog) self.retranslateUi(EditVerseDialog)
QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'accepted()'), EditVerseDialog.accept) QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'accepted()'), EditVerseDialog.accept)
QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'rejected()'), EditVerseDialog.reject) QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'rejected()'), EditVerseDialog.reject)
QtCore.QMetaObject.connectSlotsByName(EditVerseDialog) QtCore.QMetaObject.connectSlotsByName(EditVerseDialog)
self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason)
def retranslateUi(self, EditVerseDialog): def retranslateUi(self, EditVerseDialog):
EditVerseDialog.setWindowTitle(translate(u'EditVerseDialog', u'Dialog')) EditVerseDialog.setWindowTitle(translate(u'EditVerseDialog', u'Song Verse Edit Dialog'))

View File

@ -3,7 +3,7 @@
""" """
OpenLP - Open Source Lyrics Projection OpenLP - Open Source Lyrics Projection
Copyright (c) 2008 Raoul Snyman Copyright (c) 2008 Raoul Snyman
Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
@ -35,6 +35,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
def setVerse(self, verse): def setVerse(self, verse):
self.VerseTextEdit.setPlainText(verse) self.VerseTextEdit.setPlainText(verse)
self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason)
def getVerse(self): def getVerse(self):
return self.VerseTextEdit.toPlainText() return self.VerseTextEdit.toPlainText()