I have actually fixed the entering of verses with no text!

This commit is contained in:
Philip Ridout 2012-07-22 09:50:37 +01:00
parent 33510c3346
commit 1d4e5c9430
3 changed files with 2 additions and 13 deletions

View File

@ -450,7 +450,7 @@ class Renderer(object):
previous_html, previous_raw, html_lines, lines, separator, u'') previous_html, previous_raw, html_lines, lines, separator, u'')
else: else:
previous_raw = separator.join(lines) previous_raw = separator.join(lines)
if previous_raw: if previous_raw or previous_raw == u'':
formatted.append(previous_raw) formatted.append(previous_raw)
log.debug(u'_paginate_slide - End') log.debug(u'_paginate_slide - End')
return formatted return formatted

View File

@ -528,7 +528,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
for row in self.findVerseSplit.split(verse_list): for row in self.findVerseSplit.split(verse_list):
for match in row.split(u'---['): for match in row.split(u'---['):
for count, parts in enumerate(match.split(u']---\n')): for count, parts in enumerate(match.split(u']---\n')):
if len(parts) <= 1: if count == 0 and len(parts) <= 0:
continue continue
if count == 0: if count == 0:
# handling carefully user inputted versetags # handling carefully user inputted versetags

View File

@ -184,14 +184,3 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
text = u'---[%s:1]---\n%s' % \ text = u'---[%s:1]---\n%s' % \
(VerseType.TranslatedNames[VerseType.Verse], text) (VerseType.TranslatedNames[VerseType.Verse], text)
return text return text
def accept(self):
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 must enter text for each verse.'))
return False
QtGui.QDialog.accept(self)