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
1=== modified file 'openlp/plugins/bibles/lib/bibleHTTPimpl.py'
2--- openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-06-20 19:11:17 +0000
3+++ openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-07-12 15:11:57 +0000
4@@ -116,6 +116,7 @@
5 ## Strip Verse Data from Page and build an array
6 ##
7 #log.debug(u'bible data %s', xml_string)
8+ #print xml_string
9 i= xml_string.find(u'NavCurrentChapter')
10 xml_string = xml_string[i:len(xml_string)]
11 i= xml_string.find(u'<TABLE')
12@@ -136,11 +137,10 @@
13 i = xml_string.find(u'</I></B>', versePos)
14 #log.debug( versePos, i)
15 verse= xml_string[versePos:i] # Got the Chapter
16- #verse = int(temp)
17 #log.debug( 'Chapter = %s', verse)
18 # move the starting position to begining of the text
19 versePos = i + 8
20- # fined the start of the next verse
21+ # find the start of the next verse
22 i = xml_string.find(u'<B><I>', versePos)
23 if i == -1:
24 i = xml_string.find(u'</BLOCKQUOTE>',versePos)
25@@ -150,6 +150,7 @@
26 #log.debug( i, versePos)
27 verseText = xml_string[versePos: i]
28 versePos = i
29+ #print verseText
30 bible[verse] = self._clean_text(verseText)
31 #bible[verse] = verseText
32
33
34=== modified file 'openlp/plugins/bibles/lib/common.py'
35--- openlp/plugins/bibles/lib/common.py 2009-07-07 20:18:36 +0000
36+++ openlp/plugins/bibles/lib/common.py 2009-07-12 15:11:57 +0000
37@@ -132,6 +132,11 @@
38 end_tag = text.find(u'</sup>')
39 text = text[:start_tag] + text[end_tag + 6:len(text)]
40 start_tag = text.find(u'<sup>')
41+ start_tag = text.find(u'<SUP>')
42+ while start_tag > -1:
43+ end_tag = text.find(u'</SUP>')
44+ text = text[:start_tag] + text[end_tag + 6:len(text)]
45+ start_tag = text.find(u'<SUP>')
46 # Static Clean ups
47 text = text.replace(u'\n', u'')
48 text = text.replace(u'\r', u'')
49
50=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
51--- openlp/plugins/bibles/lib/mediaitem.py 2009-07-07 16:35:01 +0000
52+++ openlp/plugins/bibles/lib/mediaitem.py 2009-07-13 17:02:38 +0000
53@@ -350,7 +350,8 @@
54 chapter = unicode(self.search_results[0][1])
55 verse = unicode(self.search_results[0][2])
56 text = self.search_results[0][3]
57- if self.parent.bibles_tab.paragraph_style: #Paragraph
58+ #Paragraph style force new line per verse
59+ if self.parent.bibles_tab.paragraph_style:
60 text = text + u'\n\n'
61 if self.parent.bibles_tab.display_style == 1:
62 loc = self.formatVerse(old_chapter, chapter, verse, u'(u', u')')
63@@ -363,8 +364,11 @@
64 old_chapter = chapter
65 bible_text = bible_text + u' '+ loc + u' '+ text
66 service_item.title = book + u' ' + loc
67- if len(raw_footer) <= 1:
68- raw_footer.append(book)
69+ footer = book + u' (' + self.version + u' ' + self.copyright +u')'
70+ try:
71+ raw_footer.index(footer)
72+ except:
73+ raw_footer.append(footer)
74 if len(self.parent.bibles_tab.bible_theme) == 0:
75 service_item.theme = None
76 else:
77@@ -503,6 +507,9 @@
78 self.search_results = self.parent.biblemanager.get_verse_text(bible, book,
79 int(start_chapter), int(end_chapter), int(start_verse),
80 int(end_verse))
81+ self.copyright = unicode(self.parent.biblemanager.get_meta_data(bible, u'Copyright').value)
82+ self.permissions = unicode(self.parent.biblemanager.get_meta_data(bible, u'Permissions').value)
83+ self.version = unicode(self.parent.biblemanager.get_meta_data(bible, u'Version').value)
84 else:
85 reply = QtGui.QMessageBox.information(self,
86 translate(u'BibleMediaItem', u'Information'),
87
88=== modified file 'openlp/plugins/songs/forms/editsongform.py'
89--- openlp/plugins/songs/forms/editsongform.py 2009-06-27 19:55:55 +0000
90+++ openlp/plugins/songs/forms/editsongform.py 2009-07-13 17:02:38 +0000
91@@ -139,6 +139,7 @@
92 self.AuthorsListView.clear()
93 self.TopicsListView.clear()
94 self.title_change = False
95+ self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
96
97 def loadSong(self, id):
98 log.debug(u'Load Song')
99@@ -161,16 +162,19 @@
100 self.SongbookCombo.setCurrentIndex(id)
101 if len(title) > 1:
102 self.AlternativeEdit.setText(title[1])
103- self.CopyrightEditItem.setText(self.song.copyright)
104+ if self.song.copyright is not None:
105+ self.CopyrightEditItem.setText(self.song.copyright)
106+ else:
107+ self.CopyrightEditItem.setText(u'')
108 self.VerseListWidget.clear()
109 if self.song.verse_order is not None:
110 self.VerseOrderEdit.setText(self.song.verse_order)
111 else:
112 self.VerseOrderEdit.setText(u'')
113 if self.song.comments is not None:
114- self.CommentsEdit.setText(self.song.comments)
115+ self.CommentsEdit.setPlainText(self.song.comments)
116 else:
117- self.CommentsEdit.setText(u'')
118+ self.CommentsEdit.setPlainText(u'')
119 if self.song.ccli_number is not None:
120 self.CCLNumberEdit.setText(self.song.ccli_number)
121 else:
122@@ -199,6 +203,7 @@
123 self.TopicsListView.addItem(topic_name)
124 self._validate_song()
125 self.title_change = False
126+ self.TitleEditItem.setFocus(QtCore.Qt.OtherFocusReason)
127
128 def onAuthorAddtoSongItemClicked(self):
129 item = int(self.AuthorsSelectionComboItem.currentIndex())
130@@ -296,6 +301,7 @@
131 self.verse_form.setVerse(item.text())
132 self.verse_form.exec_()
133 item.setText(self.verse_form.getVerse())
134+ self.VerseListWidget.update()
135 self.EditButton.setEnabled(False)
136 self.DeleteButton.setEnabled(False)
137
138@@ -356,7 +362,9 @@
139 return
140 self.song.title = unicode(self.TitleEditItem.displayText())
141 self.song.copyright = unicode(self.CopyrightEditItem.displayText())
142- self.song.search_title = self.TitleEditItem.displayText() + u'@'+ self.AlternativeEdit.displayText()
143+ self.song.search_title = unicode(self.TitleEditItem.displayText()) + u'@'+ unicode(self.AlternativeEdit.displayText())
144+ self.song.comments = unicode(self.CommentsEdit.toPlainText())
145+ self.song.ccli_number = unicode(self.CCLNumberEdit.displayText())
146 self.processLyrics()
147 self.processTitle()
148 self.song.song_book_id = 0
149@@ -380,7 +388,7 @@
150 count += 1
151 if self.song.verse_order is None:
152 self.song.verse_order = verse_order
153- text = text.replace("'", u'')
154+ text = text.replace(u'\'', u'')
155 text = text.replace(u',', u'')
156 text = text.replace(u';', u'')
157 text = text.replace(u':', u'')
158@@ -394,7 +402,7 @@
159
160 def processTitle(self):
161 log.debug(u'processTitle')
162- self.song.search_title = self.song.search_title.replace("'", u'')
163+ self.song.search_title = self.song.search_title.replace(u'\'', u'')
164 self.song.search_title = self.song.search_title.replace(u',', u'')
165 self.song.search_title = self.song.search_title.replace(u';', u'')
166 self.song.search_title = self.song.search_title.replace(u':', u'')
167
168=== modified file 'openlp/plugins/songs/forms/editversedialog.py'
169--- openlp/plugins/songs/forms/editversedialog.py 2009-06-10 17:12:03 +0000
170+++ openlp/plugins/songs/forms/editversedialog.py 2009-07-12 14:56:06 +0000
171@@ -1,12 +1,22 @@
172 # -*- coding: utf-8 -*-
173-
174-# Form implementation generated from reading ui file '/home/raoul/Projects/openlp-2/resources/forms/editversedialog.ui'
175-#
176-# Created: Sat Mar 7 11:11:49 2009
177-# by: PyQt4 UI code generator 4.4.4
178-#
179-# WARNING! All changes made in this file will be lost!
180-
181+# vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4
182+"""
183+OpenLP - Open Source Lyrics Projection
184+Copyright (c) 2008 Raoul Snyman
185+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
186+
187+This program is free software; you can redistribute it and/or modify it under
188+the terms of the GNU General Public License as published by the Free Software
189+Foundation; version 2 of the License.
190+
191+This program is distributed in the hope that it will be useful, but WITHOUT ANY
192+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
193+PARTICULAR PURPOSE. See the GNU General Public License for more details.
194+
195+You should have received a copy of the GNU General Public License along with
196+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
197+Place, Suite 330, Boston, MA 02111-1307 USA
198+"""
199 from PyQt4 import QtCore, QtGui
200 from openlp.core.lib import translate
201
202@@ -28,11 +38,11 @@
203 self.ButtonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save)
204 self.ButtonBox.setObjectName(u'ButtonBox')
205 self.DialogLayout.addWidget(self.ButtonBox)
206-
207 self.retranslateUi(EditVerseDialog)
208 QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'accepted()'), EditVerseDialog.accept)
209 QtCore.QObject.connect(self.ButtonBox, QtCore.SIGNAL(u'rejected()'), EditVerseDialog.reject)
210 QtCore.QMetaObject.connectSlotsByName(EditVerseDialog)
211+ self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason)
212
213 def retranslateUi(self, EditVerseDialog):
214- EditVerseDialog.setWindowTitle(translate(u'EditVerseDialog', u'Dialog'))
215+ EditVerseDialog.setWindowTitle(translate(u'EditVerseDialog', u'Song Verse Edit Dialog'))
216
217=== modified file 'openlp/plugins/songs/forms/editverseform.py'
218--- openlp/plugins/songs/forms/editverseform.py 2009-03-07 21:38:59 +0000
219+++ openlp/plugins/songs/forms/editverseform.py 2009-07-12 14:56:06 +0000
220@@ -3,7 +3,7 @@
221 """
222 OpenLP - Open Source Lyrics Projection
223 Copyright (c) 2008 Raoul Snyman
224-Portions copyright (c) 2008 Martin Thompson, Tim Bentley,
225+Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley,
226
227 This program is free software; you can redistribute it and/or modify it under
228 the terms of the GNU General Public License as published by the Free Software
229@@ -35,6 +35,7 @@
230
231 def setVerse(self, verse):
232 self.VerseTextEdit.setPlainText(verse)
233+ self.VerseTextEdit.setFocus(QtCore.Qt.OtherFocusReason)
234
235 def getVerse(self):
236 return self.VerseTextEdit.toPlainText()