Custom plugin fixes

This commit is contained in:
Tim Bentley 2009-10-31 20:38:57 +00:00
parent 7a349c998e
commit 8420e4a438
2 changed files with 7 additions and 4 deletions

View File

@ -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)

View File

@ -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''