From 8420e4a43820710d3186387ad5e1a7d4f09462c4 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 31 Oct 2009 20:38:57 +0000 Subject: [PATCH] Custom plugin fixes --- openlp/plugins/custom/forms/editcustomdialog.py | 2 +- openlp/plugins/custom/forms/editcustomform.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openlp/plugins/custom/forms/editcustomdialog.py b/openlp/plugins/custom/forms/editcustomdialog.py index 2b56dd78d..5a39f0c07 100644 --- a/openlp/plugins/custom/forms/editcustomdialog.py +++ b/openlp/plugins/custom/forms/editcustomdialog.py @@ -120,7 +120,7 @@ class Ui_customEditDialog(object): self.gridLayout.addLayout(self.horizontalLayout_2, 4, 0, 1, 1) self.buttonBox = QtGui.QDialogButtonBox(customEditDialog) self.buttonBox.setStandardButtons( - QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Save) self.buttonBox.setObjectName(u'buttonBox') self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 1) diff --git a/openlp/plugins/custom/forms/editcustomform.py b/openlp/plugins/custom/forms/editcustomform.py index caecda0cd..a4fc7a44a 100644 --- a/openlp/plugins/custom/forms/editcustomform.py +++ b/openlp/plugins/custom/forms/editcustomform.py @@ -101,7 +101,7 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): verseList = songXML.get_verses() for verse in verseList: self.VerseListView.addItem(verse[1]) - theme = unicode(self.customSlide.theme_name) + theme = self.customSlide.theme_name id = self.ThemeComboBox.findText(theme, QtCore.Qt.MatchExactly) if id == -1: id = 0 # Not Found @@ -224,9 +224,12 @@ class EditCustomForm(QtGui.QDialog, Ui_customEditDialog): def _validate(self): if len(self.TitleEdit.displayText()) == 0: self.TitleEdit.setFocus() - return False, self.trUtf8(u'You need to enter a title \n') + return False, self.trUtf8(u'You need to enter a title') # must have 1 slide if self.VerseListView.count() == 0: self.VerseTextEdit.setFocus() - return False, self.trUtf8(u'You need to enter a slide \n') + return False, self.trUtf8(u'You need to enter a slide') + if len(self.VerseTextEdit.toPlainText()) > 0: + self.VerseTextEdit.setFocus() + return False, self.trUtf8(u'You have unsaved data') return True, u''