From fd48e98598ac4a739cc3c61525b5dd5af70f0a4e Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Thu, 18 Apr 2013 19:53:01 +0200 Subject: [PATCH 1/2] fixed bug-1170435 Fixes: https://launchpad.net/bugs/1170435 --- openlp/plugins/songs/forms/editsongform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index b9dbd2c03..d94df45fa 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -608,7 +608,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for verse in verses: if not verse in order: verses_not_used.append(verse) - self.warningLabel.setVisible(len(verses_not_used) > 0) + self.warningLabel.setVisible(len(verses_not_used) > 0 and bool(text)) def __extractVerseOrder(self, verse_order): order = [] From 1b7d5f2f0e12bf92e3ab9174681446cab1887630 Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Sun, 16 Jun 2013 19:19:32 +0200 Subject: [PATCH 2/2] added second warning --- openlp/plugins/songs/forms/editsongdialog.py | 8 ++++---- openlp/plugins/songs/forms/editsongform.py | 9 ++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/openlp/plugins/songs/forms/editsongdialog.py b/openlp/plugins/songs/forms/editsongdialog.py index 8f8954c44..3c8a7f175 100644 --- a/openlp/plugins/songs/forms/editsongdialog.py +++ b/openlp/plugins/songs/forms/editsongdialog.py @@ -283,7 +283,6 @@ class Ui_EditSongDialog(object): self.bottomLayout.setObjectName(u'bottomLayout') self.warningLabel = QtGui.QLabel(editSongDialog) self.warningLabel.setObjectName(u'warningLabel') - self.warningLabel.setVisible(False) self.bottomLayout.addWidget(self.warningLabel) self.buttonBox = create_button_box(editSongDialog, u'buttonBox', [u'cancel', u'save']) @@ -355,9 +354,10 @@ class Ui_EditSongDialog(object): translate('SongsPlugin.EditSongForm', '&Remove')) self.audioRemoveAllButton.setText( translate('SongsPlugin.EditSongForm', 'Remove &All')) - self.warningLabel.setText( - translate('SongsPlugin.EditSongForm', 'Warning:' - ' Not all of the verses are in use.')) + self.notAlllVersesUsed = translate('SongsPlugin.EditSongForm', 'Warning:' + ' Not all of the verses are in use.') + self.noVerseOrder = translate('SongsPlugin.EditSongForm', 'Warning:' + ' You have not entered a verse order.') def editSongDialogComboBox(parent, name): """ diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index d94df45fa..7593e4a95 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -349,6 +349,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): self.titleEdit.setFocus(QtCore.Qt.OtherFocusReason) # Hide or show the preview button. self.previewButton.setVisible(preview) + # Check if all verse tags are used. + self.onVerseOrderTextChanged(self.verseOrderEdit.text()) def tagRows(self): """ @@ -608,7 +610,12 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): for verse in verses: if not verse in order: verses_not_used.append(verse) - self.warningLabel.setVisible(len(verses_not_used) > 0 and bool(text)) + label_text = u'' + if not self.verseOrderEdit.text(): + label_text = self.noVerseOrder + elif verses_not_used: + label_text = self.notAlllVersesUsed + self.warningLabel.setText(label_text) def __extractVerseOrder(self, verse_order): order = []