diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index 58488a6e9..21958d403 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -547,14 +547,11 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): if self.AuthorsListView.count() == 0: self.SongTabWidget.setCurrentIndex(1) self.AuthorsListView.setFocus() - answer = QtGui.QMessageBox.warning(self, + QtGui.QMessageBox.critical(self, translate('SongsPlugin.EditSongForm', 'Warning'), translate('SongsPlugin.EditSongForm', - 'You have not added any authors for this song. Do you ' - 'want to add an author now?'), - QtGui.QMessageBox.Yes | QtGui.QMessageBox.No) - if answer == QtGui.QMessageBox.Yes: - return False + 'You need to have an author for this song.')) + return False if self.song.verse_order: order = [] order_names = self.song.verse_order.split() diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index d954bfb1f..8f5f04194 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -29,7 +29,7 @@ import logging from PyQt4 import QtCore, QtGui -from openlp.plugins.songs.lib import VerseType +from openlp.plugins.songs.lib import VerseType, translate from editversedialog import Ui_EditVerseDialog @@ -131,6 +131,7 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): def setVerse(self, text, single=False, tag=u'%s:1' % VerseType.to_string(VerseType.Verse)): + self.hasSingleVerse = single if single: verse_type, verse_number = tag.split(u':') verse_type_index = VerseType.from_string(verse_type) @@ -159,3 +160,16 @@ class EditVerseForm(QtGui.QDialog, Ui_EditVerseDialog): text = u'---[%s:1]---\n%s' % (VerseType.to_string(VerseType.Verse), text) return text + + def accept(self): + if self.hasSingleVerse: + value = unicode(self.getVerse()[0]) + else: + value = self.getVerse()[0].split(u'\n')[1] + if len(value) == 0: + QtGui.QMessageBox.critical(self, + translate('SongsPlugin.EditSongForm', 'Error'), + translate('SongsPlugin.EditSongForm', + 'You need to type some text in to the verse.')) + return False + QtGui.QDialog.accept(self)