Improve message when an invalid order was entered

It mentions that the delimiter has to be a space.

Fixes: https://launchpad.net/bugs/1094809
This commit is contained in:
s.mehrbrodt@gmail.com 2013-07-19 18:52:16 +02:00
parent 53d5cda91a
commit 4894ad6dc2

View File

@ -170,14 +170,17 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
invalid_verses.append(order_names[count])
if invalid_verses:
valid = create_separated_list(verse_names)
invalid = u', '.join(invalid_verses) if len(invalid_verses) > 1 else invalid_verses[0]
if len(invalid_verses) > 1:
critical_error_message_box(message=translate('SongsPlugin.EditSongForm',
'The verse order is invalid. There are no verses corresponding to %s. Valid entries are %s.') %
(u', '.join(invalid_verses), valid))
msg = translate('SongsPlugin.EditSongForm', 'There are no verses corresponding to "%(invalid)s".\
Valid entries are %(valid)s.\nPlease enter the verses seperated by spaces.') %{'invalid' : u', '.join(invalid_verses),
'valid' : valid}
else:
critical_error_message_box(message=translate('SongsPlugin.EditSongForm',
'The verse order is invalid. There is no verse corresponding to %s. Valid entries are %s.') %
(invalid_verses[0], valid))
msg = translate('SongsPlugin.EditSongForm', 'There is no verse corresponding to "%(invalid)s".\
Valid entries are %(valid)s.\nPlease enter the verses seperated by spaces.') %{'invalid' : invalid_verses[0],
'valid' : valid}
critical_error_message_box(title=translate('SongsPlugin.EditSongForm', 'Invalid Verse Order'),
message=msg)
return len(invalid_verses) == 0
def _validate_song(self):