Made relative imports absolute.

Changed self.NameEdit.text() == u'' to not self.NameEdit.text()
This commit is contained in:
Raoul Snyman 2009-07-26 15:51:32 +02:00
parent 67f4669df2
commit 2b237bb488
3 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from openlp.core.lib import translate from openlp.core.lib import translate
from authorsdialog import Ui_AuthorsDialog from openlp.plugins.songs.forms.authorsdialog import Ui_AuthorsDialog
class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
""" """
@ -67,21 +67,21 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
self.autoDisplayName = on self.autoDisplayName = on
def accept(self): def accept(self):
if self.FirstNameEdit.text() == u'': if not self.FirstNameEdit.text():
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 first name of the author.'), translate(u'AuthorsDialog', u'You need to type in the first name of the author.'),
QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))
self.FirstNameEdit.setFocus() self.FirstNameEdit.setFocus()
return False return False
elif self.LastNameEdit.text() == u'': elif not self.LastNameEdit.text():
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
elif self.DisplayEdit.text() == u'': elif not self.DisplayEdit.text():
if QtGui.QMessageBox.critical(self, if QtGui.QMessageBox.critical(self,
translate(u'AuthorsDialog', u'Error'), translate(u'AuthorsDialog', u'Error'),
translate(u'AuthorsDialog', u'You haven\'t set a display name for the author, would you like me to combine the first and last names for you?'), translate(u'AuthorsDialog', u'You haven\'t set a display name for the author, would you like me to combine the first and last names for you?'),

View File

@ -19,7 +19,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from openlp.core.lib import translate from openlp.core.lib import translate
from songbookdialog import Ui_SongBookDialog from openlp.plugins.songs.forms.songbookdialog import Ui_SongBookDialog
class SongBookForm(QtGui.QDialog, Ui_SongBookDialog): class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
""" """
@ -40,7 +40,7 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
return QtGui.QDialog.exec_(self) return QtGui.QDialog.exec_(self)
def accept(self): def accept(self):
if self.NameEdit.text() == u'': if not self.NameEdit.text():
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate(u'SongBookDialog', u'Error'), translate(u'SongBookDialog', u'Error'),
translate(u'SongBookDialog', u'You need to type in a book name!'), translate(u'SongBookDialog', u'You need to type in a book name!'),

View File

@ -18,7 +18,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
""" """
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from openlp.core.lib import translate from openlp.core.lib import translate
from topicsdialog import Ui_TopicsDialog from openlp.plugins.songs.forms.topicsdialog import Ui_TopicsDialog
class TopicsForm(QtGui.QDialog, Ui_TopicsDialog): class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
""" """
@ -38,7 +38,7 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
return QtGui.QDialog.exec_(self) return QtGui.QDialog.exec_(self)
def accept(self): def accept(self):
if self.NameEdit.text() == u'': if not self.NameEdit.text():
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate(u'SongBookDialog', u'Error'), translate(u'SongBookDialog', u'Error'),
translate(u'SongBookDialog', u'You need to type in a topic name!'), translate(u'SongBookDialog', u'You need to type in a topic name!'),