← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~phill-ridout/openlp/bug-1011286 into lp:openlp

 

phill has proposed merging lp:~phill-ridout/openlp/bug-1011286 into lp:openlp.

Requested reviews:
  Raoul Snyman (raoul-snyman)
  Jonathan Corwin (j-corwin)
  Tim Bentley (trb143)
Related bugs:
  Bug #1011286 in OpenLP: "Song Editor -> Edit All Crashes with out valid verse splitter"
  https://bugs.launchpad.net/openlp/+bug/1011286
  Bug #1023611 in OpenLP: "Empty verse tags in song editor->edit all are silently removed "
  https://bugs.launchpad.net/openlp/+bug/1023611

For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/bug-1011286/+merge/116149

I have actually fixed the entering of verses with no text! I would appreciate extended testing on this, as I have made a change in the renderer code. As far as my testing goes, I have not broken any thing. But you guys have a knack of finding flaws ;-)

The validation is no longer needed, as it was just checking that each verse had some text.


Changed the save button to OK as per the reasons in my email.
-- 
https://code.launchpad.net/~phill-ridout/openlp/bug-1011286/+merge/116149
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2012-07-02 18:45:03 +0000
+++ openlp/core/lib/renderer.py	2012-07-22 08:57:21 +0000
@@ -450,7 +450,7 @@
                 previous_html, previous_raw, html_lines, lines, separator, u'')
         else:
             previous_raw = separator.join(lines)
-        if previous_raw:
+        if previous_raw or previous_raw == u'':
             formatted.append(previous_raw)
         log.debug(u'_paginate_slide - End')
         return formatted

=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2012-07-07 14:54:14 +0000
+++ openlp/plugins/songs/forms/editsongform.py	2012-07-22 08:57:21 +0000
@@ -528,7 +528,7 @@
         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 and len(parts) <= 0:
                         continue
                     if count == 0:
                         # handling carefully user inputted versetags

=== modified file 'openlp/plugins/songs/forms/editversedialog.py'
--- openlp/plugins/songs/forms/editversedialog.py	2012-06-22 14:14:53 +0000
+++ openlp/plugins/songs/forms/editversedialog.py	2012-07-22 08:57:21 +0000
@@ -67,7 +67,7 @@
         self.verseTypeLayout.addStretch()
         self.dialogLayout.addLayout(self.verseTypeLayout)
         self.buttonBox = create_button_box(editVerseDialog, u'buttonBox',
-            [u'cancel', u'save'])
+            [u'cancel', u'ok'])
         self.dialogLayout.addWidget(self.buttonBox)
         self.retranslateUi(editVerseDialog)
 

=== modified file 'openlp/plugins/songs/forms/editverseform.py'
--- openlp/plugins/songs/forms/editverseform.py	2012-06-22 14:14:53 +0000
+++ openlp/plugins/songs/forms/editverseform.py	2012-07-22 08:57:21 +0000
@@ -185,22 +185,3 @@
             text = u'---[%s:1]---\n%s' % \
                 (VerseType.TranslatedNames[VerseType.Verse], text)
         return text
-
-    def accept(self):
-        if self.hasSingleVerse:
-            value = unicode(self.getVerse()[0])
-        else:
-            log.debug(unicode(self.getVerse()[0]).split(u'\n'))
-            value = unicode(self.getVerse()[0]).split(u'\n')[1]
-            if not value:
-                lines = unicode(self.getVerse()[0]).split(u'\n')
-                index = 2
-                while index < len(lines) and not value:
-                    value = lines[index]
-                    index += 1
-        if not value:
-            critical_error_message_box(
-                message=translate('SongsPlugin.EditSongForm',
-                'You need to type some text in to the verse.'))
-            return False
-        QtGui.QDialog.accept(self)


Follow ups