← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~sam92/openlp/bug-1094809 into lp:openlp

 

Samuel Mehrbrodt has proposed merging lp:~sam92/openlp/bug-1094809 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #1094809 in OpenLP: "Song Editor - improve usability of Verse Order field"
  https://bugs.launchpad.net/openlp/+bug/1094809

For more details, see:
https://code.launchpad.net/~sam92/openlp/bug-1094809/+merge/175894

I improved the error message to mention that the delimiter has to be a space.

I also gave names to the place holders (%s) in the strings. That is for translation, in case they need to be swapped in another language.
-- 
https://code.launchpad.net/~sam92/openlp/bug-1094809/+merge/175894
Your team OpenLP Core is requested to review the proposed merge of lp:~sam92/openlp/bug-1094809 into lp:openlp.
=== modified file 'openlp/plugins/songs/forms/editsongform.py'
--- openlp/plugins/songs/forms/editsongform.py	2013-06-21 18:13:59 +0000
+++ openlp/plugins/songs/forms/editsongform.py	2013-07-19 16:58:28 +0000
@@ -170,14 +170,17 @@
                 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):


Follow ups