Merge lp:~trb143/openlp/bugfixes into lp:openlp

Proposed by Tim Bentley
Status: Merged
Merged at revision: not available
Proposed branch: lp:~trb143/openlp/bugfixes
Merge into: lp:openlp
Diff against target: None lines
To merge this branch: bzr merge lp:~trb143/openlp/bugfixes
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Review via email: mp+8710@code.launchpad.net

This proposal supersedes a proposal from 2009-07-13.

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) wrote : Posted in a previous version of this proposal

Bible and Song bug fixes

Revision history for this message
Raoul Snyman (raoul-snyman) wrote :

Can't see any glaring problems.

review: Approve
lp:~trb143/openlp/bugfixes updated
492. By Tim Bentley

Bug fixes from the wiki

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/plugins/bibles/lib/bibleHTTPimpl.py'
--- openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-06-20 19:11:17 +0000
+++ openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-07-12 15:11:57 +0000
@@ -116,6 +116,7 @@
116 ## Strip Verse Data from Page and build an array116 ## Strip Verse Data from Page and build an array
117 ##117 ##
118 #log.debug(u'bible data %s', xml_string)118 #log.debug(u'bible data %s', xml_string)
119 #print xml_string
119 i= xml_string.find(u'NavCurrentChapter')120 i= xml_string.find(u'NavCurrentChapter')
120 xml_string = xml_string[i:len(xml_string)]121 xml_string = xml_string[i:len(xml_string)]
121 i= xml_string.find(u'<TABLE')122 i= xml_string.find(u'<TABLE')
@@ -136,11 +137,10 @@
136 i = xml_string.find(u'</I></B>', versePos)137 i = xml_string.find(u'</I></B>', versePos)
137 #log.debug( versePos, i)138 #log.debug( versePos, i)
138 verse= xml_string[versePos:i] # Got the Chapter139 verse= xml_string[versePos:i] # Got the Chapter
139 #verse = int(temp)
140 #log.debug( 'Chapter = %s', verse)140 #log.debug( 'Chapter = %s', verse)
141 # move the starting position to begining of the text141 # move the starting position to begining of the text
142 versePos = i + 8142 versePos = i + 8
143 # fined the start of the next verse143 # find the start of the next verse
144 i = xml_string.find(u'<B><I>', versePos)144 i = xml_string.find(u'<B><I>', versePos)
145 if i == -1:145 if i == -1:
146 i = xml_string.find(u'</BLOCKQUOTE>',versePos)146 i = xml_string.find(u'</BLOCKQUOTE>',versePos)
@@ -150,6 +150,7 @@
150 #log.debug( i, versePos)150 #log.debug( i, versePos)
151 verseText = xml_string[versePos: i]151 verseText = xml_string[versePos: i]
152 versePos = i152 versePos = i
153 #print verseText
153 bible[verse] = self._clean_text(verseText)154 bible[verse] = self._clean_text(verseText)
154 #bible[verse] = verseText155 #bible[verse] = verseText
155156
156157
=== modified file 'openlp/plugins/bibles/lib/common.py'
--- openlp/plugins/bibles/lib/common.py 2009-07-07 20:18:36 +0000
+++ openlp/plugins/bibles/lib/common.py 2009-07-12 15:11:57 +0000
@@ -132,6 +132,11 @@
132 end_tag = text.find(u'</sup>')132 end_tag = text.find(u'</sup>')
133 text = text[:start_tag] + text[end_tag + 6:len(text)]133 text = text[:start_tag] + text[end_tag + 6:len(text)]
134 start_tag = text.find(u'<sup>')134 start_tag = text.find(u'<sup>')
135 start_tag = text.find(u'<SUP>')
136 while start_tag > -1:
137 end_tag = text.find(u'</SUP>')
138 text = text[:start_tag] + text[end_tag + 6:len(text)]
139 start_tag = text.find(u'<SUP>')
135 # Static Clean ups140 # Static Clean ups
136 text = text.replace(u'\n', u'')141 text = text.replace(u'\n', u'')
137 text = text.replace(u'\r', u'')142 text = text.replace(u'\r', u'')
138143
=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py 2009-07-07 16:35:01 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py 2009-07-13 17:02:38 +0000
@@ -350,7 +350,8 @@
350 chapter = unicode(self.search_results[0][1])350 chapter = unicode(self.search_results[0][1])
351 verse = unicode(self.search_results[0][2])351 verse = unicode(self.search_results[0][2])
352 text = self.search_results[0][3]352 text = self.search_results[0][3]
353 if self.parent.bibles_tab.paragraph_style: #Paragraph353 #Paragraph style force new line per verse
354 if self.parent.bibles_tab.paragraph_style:
354 text = text + u'\n\n'355 text = text + u'\n\n'
355 if self.parent.bibles_tab.display_style == 1:356 if self.parent.bibles_tab.display_style == 1:
356 loc = self.formatVerse(old_chapter, chapter, verse, u'(u', u')')357 loc = self.formatVerse(old_chapter, chapter, verse, u'(u', u')')
@@ -363,8 +364,11 @@
363 old_chapter = chapter364 old_chapter = chapter
364 bible_text = bible_text + u' '+ loc + u' '+ text365 bible_text = bible_text + u' '+ loc + u' '+ text
365 service_item.title = book + u' ' + loc366 service_item.title = book + u' ' + loc
366 if len(raw_footer) <= 1:367 footer = book + u' (' + self.version + u' ' + self.copyright +u')'
367 raw_footer.append(book)368 try:
369 raw_footer.index(footer)
370 except:
371 raw_footer.append(footer)
368 if len(self.parent.bibles_tab.bible_theme) == 0:372 if len(self.parent.bibles_tab.bible_theme) == 0:
369 service_item.theme = None373 service_item.theme = None
370 else:374 else:
@@ -503,6 +507,9 @@
503 self.search_results = self.parent.biblemanager.get_verse_text(bible, book,507 self.search_results = self.parent.biblemanager.get_verse_text(bible, book,
504 int(start_chapter), int(end_chapter), int(start_verse),508 int(start_chapter), int(end_chapter), int(start_verse),
505 int(end_verse))509 int(end_verse))
510 self.copyright = unicode(self.parent.biblemanager.get_meta_data(bible, u'Copyright').value)
511 self.permissions = unicode(self.parent.biblemanager.get_meta_data(bible, u'Permissions').value)
512 self.version = unicode(self.parent.biblemanager.get_meta_data(bible, u'Version').value)
506 else:513 else:
507 reply = QtGui.QMessageBox.information(self,514 reply = QtGui.QMessageBox.information(self,
508 translate(u'BibleMediaItem', u'Information'),515 translate(u'BibleMediaItem', u'Information'),
509516
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py 2009-06-27 19:55:55 +0000
+++ openlp/plugins/songs/forms/editsongform.py 2009-07-13 17:02:38 +0000
@@ -139,6 +139,7 @@
139 self.AuthorsListView.clear()139 self.AuthorsListView.clear()
140 self.TopicsListView.clear()140 self.TopicsListView.clear()
141 self.title_change = False141 self.title_change = False
142 self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
142143
143 def loadSong(self, id):144 def loadSong(self, id):
144 log.debug(u'Load Song')145 log.debug(u'Load Song')
@@ -161,16 +162,19 @@
161 self.SongbookCombo.setCurrentIndex(id)162 self.SongbookCombo.setCurrentIndex(id)
162 if len(title) > 1:163 if len(title) > 1:
163 self.AlternativeEdit.setText(title[1])164 self.AlternativeEdit.setText(title[1])
164 self.CopyrightEditItem.setText(self.song.copyright)165 if self.song.copyright is not None:
166 self.CopyrightEditItem.setText(self.song.copyright)
167 else:
168 self.CopyrightEditItem.setText(u'')
165 self.VerseListWidget.clear()169 self.VerseListWidget.clear()
166 if self.song.verse_order is not None:170 if self.song.verse_order is not None:
167 self.VerseOrderEdit.setText(self.song.verse_order)171 self.VerseOrderEdit.setText(self.song.verse_order)
168 else:172 else:
169 self.VerseOrderEdit.setText(u'')173 self.VerseOrderEdit.setText(u'')
170 if self.song.comments is not None:174 if self.song.comments is not None:
171 self.CommentsEdit.setText(self.song.comments)175 self.CommentsEdit.setPlainText(self.song.comments)
172 else:176 else:
173 self.CommentsEdit.setText(u'')177 self.CommentsEdit.setPlainText(u'')
174 if self.song.ccli_number is not None:178 if self.song.ccli_number is not None:
175 self.CCLNumberEdit.setText(self.song.ccli_number)179 self.CCLNumberEdit.setText(self.song.ccli_number)
176 else:180 else:
@@ -199,6 +203,7 @@
199 self.TopicsListView.addItem(topic_name)203 self.TopicsListView.addItem(topic_name)
200 self._validate_song()204 self._validate_song()
201 self.title_change = False205 self.title_change = False
206 self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
202207
203 def onAuthorAddtoSongItemClicked(self):208 def onAuthorAddtoSongItemClicked(self):
204 item = int(self.AuthorsSelectionComboItem.currentIndex())209 item = int(self.AuthorsSelectionComboItem.currentIndex())
@@ -296,6 +301,7 @@
296 self.verse_form.setVerse(item.text())301 self.verse_form.setVerse(item.text())
297 self.verse_form.exec_()302 self.verse_form.exec_()
298 item.setText(self.verse_form.getVerse())303 item.setText(self.verse_form.getVerse())
304 self.VerseListWidget.update()
299 self.EditButton.setEnabled(False)305 self.EditButton.setEnabled(False)
300 self.DeleteButton.setEnabled(False)306 self.DeleteButton.setEnabled(False)
301307
@@ -356,7 +362,9 @@
356 return362 return
357 self.song.title = unicode(self.TitleEditItem.displayText())363 self.song.title = unicode(self.TitleEditItem.displayText())
358 self.song.copyright = unicode(self.CopyrightEditItem.displayText())364 self.song.copyright = unicode(self.CopyrightEditItem.displayText())
359 self.song.search_title = self.TitleEditItem.displayText() + u'@'+ self.AlternativeEdit.displayText()365 self.song.search_title = unicode(self.TitleEditItem.displayText()) + u'@'+ unicode(self.AlternativeEdit.displayText())
366 self.song.comments = unicode(self.CommentsEdit.toPlainText())
367 self.song.ccli_number = unicode(self.CCLNumberEdit.displayText())
360 self.processLyrics()368 self.processLyrics()
361 self.processTitle()369 self.processTitle()
362 self.song.song_book_id = 0370 self.song.song_book_id = 0
@@ -380,7 +388,7 @@
380 count += 1388 count += 1
381 if self.song.verse_order is None:389 if self.song.verse_order is None:
382 self.song.verse_order = verse_order390 self.song.verse_order = verse_order
383 text = text.replace("'", u'')391 text = text.replace(u'\'', u'')
384 text = text.replace(u',', u'')392 text = text.replace(u',', u'')
385 text = text.replace(u';', u'')393 text = text.replace(u';', u'')
386 text = text.replace(u':', u'')394 text = text.replace(u':', u'')
@@ -394,7 +402,7 @@
394402
395 def processTitle(self):403 def processTitle(self):
396 log.debug(u'processTitle')404 log.debug(u'processTitle')
397 self.song.search_title = self.song.search_title.replace("'", u'')405 self.song.search_title = self.song.search_title.replace(u'\'', u'')
398 self.song.search_title = self.song.search_title.replace(u',', u'')406 self.song.search_title = self.song.search_title.replace(u',', u'')
399 self.song.search_title = self.song.search_title.replace(u';', u'')407 self.song.search_title = self.song.search_title.replace(u';', u'')
400 self.song.search_title = self.song.search_title.replace(u':', u'')408 self.song.search_title = self.song.search_title.replace(u':', u'')
401409
=== modified file 'openlp/plugins/songs/forms/editversedialog.py'
--- openlp/plugins/songs/forms/editversedialog.py 2009-06-10 17:12:03 +0000
+++ openlp/plugins/songs/forms/editversedialog.py 2009-07-12 14:56:06 +0000
@@ -1,12 +1,22 @@
1# -*- coding: utf-8 -*-1# -*- coding: utf-8 -*-
22# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
3# Form implementation generated from reading ui file '/home/raoul/Projects/openlp-2/resources/forms/editversedialog.ui'3"""
4#4OpenLP - Open Source Lyrics Projection
5# Created: Sat Mar 7 11:11:49 20095Copyright (c) 2008 Raoul Snyman
6# by: PyQt4 UI code generator 4.4.46Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
7#7
8# WARNING! All changes made in this file will be lost!8This program is free software; you can redistribute it and/or modify it under
99the terms of the GNU General Public License as published by the Free Software
10Foundation; version 2 of the License.
11
12This program is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14PARTICULAR PURPOSE. See the GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License along with
17this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18Place, Suite 330, Boston, MA 02111-1307 USA
19"""
10from PyQt4 import QtCore, QtGui20from PyQt4 import QtCore, QtGui
11from openlp.core.lib import translate21from openlp.core.lib import translate
1222
@@ -28,11 +38,11 @@
28 self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save)38 self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save)
29 self.ButtonBox.setObjectName(u'ButtonBox')39 self.ButtonBox.setObjectName(u'ButtonBox')
30 self.DialogLayout.addWidget(self.ButtonBox)40 self.DialogLayout.addWidget(self.ButtonBox)
31
32 self.retranslateUi(EditVerseDialog)41 self.retranslateUi(EditVerseDialog)
33 QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'accepted()'), EditVerseDialog.accept)42 QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'accepted()'), EditVerseDialog.accept)
34 QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'rejected()'), EditVerseDialog.reject)43 QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'rejected()'), EditVerseDialog.reject)
35 QtCore.QMetaObject.connectSlotsByName(EditVerseDialog)44 QtCore.QMetaObject.connectSlotsByName(EditVerseDialog)
45 self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason)
3646
37 def retranslateUi(self, EditVerseDialog):47 def retranslateUi(self, EditVerseDialog):
38 EditVerseDialog.setWindowTitle(translate(u'EditVerseDialog', u'Dialog'))48 EditVerseDialog.setWindowTitle(translate(u'EditVerseDialog', u'Song Verse Edit Dialog'))
3949
=== modified file 'openlp/plugins/songs/forms/editverseform.py'
--- openlp/plugins/songs/forms/editverseform.py 2009-03-07 21:38:59 +0000
+++ openlp/plugins/songs/forms/editverseform.py 2009-07-12 14:56:06 +0000
@@ -3,7 +3,7 @@
3"""3"""
4OpenLP - Open Source Lyrics Projection4OpenLP - Open Source Lyrics Projection
5Copyright (c) 2008 Raoul Snyman5Copyright (c) 2008 Raoul Snyman
6Portions copyright (c) 2008 Martin Thompson, Tim Bentley,6Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
77
8This program is free software; you can redistribute it and/or modify it under8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU General Public License as published by the Free Software9the terms of the GNU General Public License as published by the Free Software
@@ -35,6 +35,7 @@
3535
36 def setVerse(self, verse):36 def setVerse(self, verse):
37 self.VerseTextEdit.setPlainText(verse)37 self.VerseTextEdit.setPlainText(verse)
38 self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason)
3839
39 def getVerse(self):40 def getVerse(self):
40 return self.VerseTextEdit.toPlainText()41 return self.VerseTextEdit.toPlainText()