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

Requested reviews:
  Raoul Snyman (raoul-snyman)
  Tim Bentley (trb143)
  Jonathan Corwin (j-corwin)
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/114992

Refactored validation of edit all form so that it does not crash on empty 
textedit, and so that it does not allow empty verses.

Ideally we would accept empty verses, but these are removed automatically else 
where.

Changed the save button to OK as per the reasons in my email.
-- 
https://code.launchpad.net/~phill-ridout/openlp/bug-1011286/+merge/114992
Your team OpenLP Core is subscribed to branch lp:openlp.
=== 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-14 18:04: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-14 18:04:21 +0000
@@ -187,20 +187,12 @@
         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
+        value = unicode(self.getVerse()[0])
+        if not self.hasSingleVerse:
+            value = not u'' in re.split(r'---\[[^\]]*\]---\n*', value)[1:]
         if not value:
             critical_error_message_box(
                 message=translate('SongsPlugin.EditSongForm',
-                'You need to type some text in to the verse.'))
+                'You must enter text for each verse.'))
             return False
         QtGui.QDialog.accept(self)

_______________________________________________
Mailing list: https://launchpad.net/~openlp-core
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openlp-core
More help   : https://help.launchpad.net/ListHelp

Reply via email to