forked from openlp/openlp
Fixes 1011286 Song Editor -> Edit All Crashes with out valid verse splitter.
Plus a small bit of refactoring
This commit is contained in:
parent
6124de5a51
commit
d41f69ce8c
@ -186,8 +186,21 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog):
|
|||||||
return text
|
return text
|
||||||
|
|
||||||
def accept(self):
|
def accept(self):
|
||||||
if self.hasSingleVerse:
|
value = unicode(self.getVerse()[0])
|
||||||
if not self.getVerse()[0]:
|
if not self.hasSingleVerse:
|
||||||
|
value = value.split(u'\n')
|
||||||
|
if len(value) <= 1:
|
||||||
|
critical_error_message_box(
|
||||||
|
message=translate('SongsPlugin.EditSongForm',
|
||||||
|
'Invalid entry, you need a verse splitter and some text.'))
|
||||||
|
return False
|
||||||
|
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(
|
critical_error_message_box(
|
||||||
message=translate('SongsPlugin.EditSongForm',
|
message=translate('SongsPlugin.EditSongForm',
|
||||||
'You need to type some text in to the verse.'))
|
'You need to type some text in to the verse.'))
|
||||||
|
Loading…
Reference in New Issue
Block a user