From 2b237bb488875cfad2f1fbac016c28456692d5d0 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 26 Jul 2009 15:51:32 +0200 Subject: [PATCH 1/2] Made relative imports absolute. Changed self.NameEdit.text() == u'' to not self.NameEdit.text() --- openlp/plugins/songs/forms/authorsform.py | 8 ++++---- openlp/plugins/songs/forms/songbookform.py | 4 ++-- openlp/plugins/songs/forms/topicsform.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openlp/plugins/songs/forms/authorsform.py b/openlp/plugins/songs/forms/authorsform.py index 7b5cddd3f..13e8123d5 100644 --- a/openlp/plugins/songs/forms/authorsform.py +++ b/openlp/plugins/songs/forms/authorsform.py @@ -18,7 +18,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA """ from PyQt4 import QtGui, QtCore 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): """ @@ -67,21 +67,21 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog): self.autoDisplayName = on def accept(self): - if self.FirstNameEdit.text() == u'': + if not self.FirstNameEdit.text(): QtGui.QMessageBox.critical(self, translate(u'AuthorsDialog', u'Error'), translate(u'AuthorsDialog', u'You need to type in the first name of the author.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.FirstNameEdit.setFocus() return False - elif self.LastNameEdit.text() == u'': + elif not self.LastNameEdit.text(): QtGui.QMessageBox.critical(self, translate(u'AuthorsDialog', u'Error'), translate(u'AuthorsDialog', u'You need to type in the last name of the author.'), QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) self.LastNameEdit.setFocus() return False - elif self.DisplayEdit.text() == u'': + elif not self.DisplayEdit.text(): if QtGui.QMessageBox.critical(self, 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?'), diff --git a/openlp/plugins/songs/forms/songbookform.py b/openlp/plugins/songs/forms/songbookform.py index 78e44cbad..736492e8f 100644 --- a/openlp/plugins/songs/forms/songbookform.py +++ b/openlp/plugins/songs/forms/songbookform.py @@ -19,7 +19,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA from PyQt4 import QtGui, QtCore 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): """ @@ -40,7 +40,7 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog): return QtGui.QDialog.exec_(self) def accept(self): - if self.NameEdit.text() == u'': + if not self.NameEdit.text(): QtGui.QMessageBox.critical(self, translate(u'SongBookDialog', u'Error'), translate(u'SongBookDialog', u'You need to type in a book name!'), diff --git a/openlp/plugins/songs/forms/topicsform.py b/openlp/plugins/songs/forms/topicsform.py index d86c2f464..6c6b01f20 100644 --- a/openlp/plugins/songs/forms/topicsform.py +++ b/openlp/plugins/songs/forms/topicsform.py @@ -18,7 +18,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA """ from PyQt4 import QtGui, QtCore 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): """ @@ -38,7 +38,7 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog): return QtGui.QDialog.exec_(self) def accept(self): - if self.NameEdit.text() == u'': + if not self.NameEdit.text(): QtGui.QMessageBox.critical(self, translate(u'SongBookDialog', u'Error'), translate(u'SongBookDialog', u'You need to type in a topic name!'), From 708a62ad472985c41f4cc32375d328fef564d7b1 Mon Sep 17 00:00:00 2001 From: Raoul Snyman Date: Sun, 2 Aug 2009 21:10:54 +0200 Subject: [PATCH 2/2] Switched around the order of some dialogs when deleting items in the Song Maintenance dialog. --- openlp/plugins/songs/forms/songmaintenanceform.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/openlp/plugins/songs/forms/songmaintenanceform.py b/openlp/plugins/songs/forms/songmaintenanceform.py index edf9af332..a319358cd 100644 --- a/openlp/plugins/songs/forms/songmaintenanceform.py +++ b/openlp/plugins/songs/forms/songmaintenanceform.py @@ -79,15 +79,15 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog): item_id = self._getCurrentItemId(list_widget) if item_id != -1: item = get_func(item_id) - if QtGui.QMessageBox.warning(self, dlg_title, del_text, - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.Yes) - ) == QtGui.QMessageBox.Yes: - if item is not None and len(item.songs) == 0: + if item is not None and len(item.songs) == 0: + if QtGui.QMessageBox.warning(self, dlg_title, del_text, + QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.No | QtGui.QMessageBox.Yes) + ) == QtGui.QMessageBox.Yes: del_func(item.id) reset_func() - else: - QtGui.QMessageBox.critical(self, dlg_title, err_text, - QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) + else: + QtGui.QMessageBox.critical(self, dlg_title, err_text, + QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) else: QtGui.QMessageBox.critical(self, dlg_title, sel_text, QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok))