From 4894ad6dc24016345930fed911f8c65bf0f5b149 Mon Sep 17 00:00:00 2001 From: "s.mehrbrodt@gmail.com" Date: Fri, 19 Jul 2013 18:52:16 +0200 Subject: [PATCH 1/2] Improve message when an invalid order was entered It mentions that the delimiter has to be a space. Fixes: https://launchpad.net/bugs/1094809 --- openlp/plugins/songs/forms/editsongform.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 24d0d3024..b86606e1c 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -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): From a52ffdb48348fbb018cc4b4d1ea84f2eaf8b0c0d Mon Sep 17 00:00:00 2001 From: "s.mehrbrodt@gmail.com" Date: Mon, 22 Jul 2013 22:27:51 +0200 Subject: [PATCH 2/2] Fix indentation --- openlp/plugins/songs/forms/editsongform.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index b86606e1c..9492eba44 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -170,15 +170,14 @@ 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: - 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} + 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: - 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} + 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