forked from openlp/openlp
Added the rest of the validation and tested that it all works.
This commit is contained in:
parent
7eac26d98a
commit
1915f93b6e
@ -74,11 +74,12 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
|||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||||
self.FirstNameEdit.setFocus()
|
self.FirstNameEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
if self.LastNameEdit.text() == u'':
|
elif self.LastNameEdit.text() == u'':
|
||||||
QtGui.QMessageBox.critical(self,
|
QtGui.QMessageBox.critical(self,
|
||||||
translate(u'AuthorsDialog', u'Error'),
|
translate(u'AuthorsDialog', u'Error'),
|
||||||
translate(u'AuthorsDialog', u'You need to type in the last name of the author.'),
|
translate(u'AuthorsDialog', u'You need to type in the last name of the author.'),
|
||||||
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||||
self.LastNameEdit.setFocus()
|
self.LastNameEdit.setFocus()
|
||||||
return False
|
return False
|
||||||
|
else:
|
||||||
|
return QtGui.QDialog.accept(self)
|
||||||
|
@ -39,3 +39,13 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
|
|||||||
self.NameEdit.setFocus()
|
self.NameEdit.setFocus()
|
||||||
return QtGui.QDialog.exec_(self)
|
return QtGui.QDialog.exec_(self)
|
||||||
|
|
||||||
|
def accept(self):
|
||||||
|
if self.NameEdit.text() == u'':
|
||||||
|
QtGui.QMessageBox.critical(self,
|
||||||
|
translate(u'SongBookDialog', u'Error'),
|
||||||
|
translate(u'SongBookDialog', u'You need to type in a book name!'),
|
||||||
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||||
|
self.NameEdit.setFocus()
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return QtGui.QDialog.accept(self)
|
||||||
|
@ -37,3 +37,13 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
|
|||||||
self.NameEdit.setFocus()
|
self.NameEdit.setFocus()
|
||||||
return QtGui.QDialog.exec_(self)
|
return QtGui.QDialog.exec_(self)
|
||||||
|
|
||||||
|
def accept(self):
|
||||||
|
if self.NameEdit.text() == u'':
|
||||||
|
QtGui.QMessageBox.critical(self,
|
||||||
|
translate(u'SongBookDialog', u'Error'),
|
||||||
|
translate(u'SongBookDialog', u'You need to type in a topic name!'),
|
||||||
|
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
|
||||||
|
self.NameEdit.setFocus()
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return QtGui.QDialog.accept(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user