More song items

This commit is contained in:
Jon Tibble 2011-02-14 03:19:30 +00:00
parent 2316ab4ed4
commit 910df1cfde
2 changed files with 11 additions and 10 deletions

View File

@ -310,8 +310,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if item == 0 and text: if item == 0 and text:
if QtGui.QMessageBox.question(self, if QtGui.QMessageBox.question(self,
UiStrings.AddType % SongStrings.Author, UiStrings.AddType % SongStrings.Author,
translate('SongsPlugin.EditSongForm', 'This author does not ' SongStrings.TypeNotExistAdd % SongStrings.Author.toLower(),
'exist, do you want to add them?'),
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
if text.find(u' ') == -1: if text.find(u' ') == -1:
@ -332,8 +331,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if self.authorsListView.findItems(unicode(author.display_name), if self.authorsListView.findItems(unicode(author.display_name),
QtCore.Qt.MatchExactly): QtCore.Qt.MatchExactly):
critical_error_message_box( critical_error_message_box(
message=translate('SongsPlugin.EditSongForm', message=SongStrings.TypeInList %
'This author is already in the list.')) SongStrings.Author.toLower())
else: else:
self.__addAuthorToList(author) self.__addAuthorToList(author)
self.authorsComboBox.setCurrentIndex(0) self.authorsComboBox.setCurrentIndex(0)
@ -368,8 +367,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if item == 0 and text: if item == 0 and text:
if QtGui.QMessageBox.question(self, if QtGui.QMessageBox.question(self,
UiStrings.AddType % SongStrings.Topic, UiStrings.AddType % SongStrings.Topic,
translate('SongsPlugin.EditSongForm', 'This topic does not ' SongStrings.TypeNotExistAdd % SongStrings.Topic.toLower(),
'exist, do you want to add it?'),
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
topic = Topic.populate(name=text) topic = Topic.populate(name=text)
@ -388,8 +386,8 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if self.topicsListView.findItems(unicode(topic.name), if self.topicsListView.findItems(unicode(topic.name),
QtCore.Qt.MatchExactly): QtCore.Qt.MatchExactly):
critical_error_message_box( critical_error_message_box(
message=translate('SongsPlugin.EditSongForm', message=SongStrings.TypeInList %
'This topic is already in the list.')) SongStrings.Topic.toLower())
else: else:
topic_item = QtGui.QListWidgetItem(unicode(topic.name)) topic_item = QtGui.QListWidgetItem(unicode(topic.name))
topic_item.setData(QtCore.Qt.UserRole, topic_item.setData(QtCore.Qt.UserRole,
@ -585,8 +583,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0: if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0:
if QtGui.QMessageBox.question(self, if QtGui.QMessageBox.question(self,
UiStrings.AddType % SongStrings.SongBook, UiStrings.AddType % SongStrings.SongBook,
translate('SongsPlugin.EditSongForm', 'This song book does ' SongStrings.TypeNotExistAdd % SongStrings.SongBook.toLower(),
'not exist, do you want to add it?'),
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No, QtGui.QMessageBox.Yes | QtGui.QMessageBox.No,
QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes: QtGui.QMessageBox.Yes) == QtGui.QMessageBox.Yes:
book = Book.populate(name=text, publisher=u'') book = Book.populate(name=text, publisher=u'')

View File

@ -48,4 +48,8 @@ class SongStrings(object):
ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.')) ThisTypeExists = unicode(translate('OpenLP.Ui', 'This %s already exists.'))
Topic = translate('OpenLP.Ui', 'Topic', 'Singular') Topic = translate('OpenLP.Ui', 'Topic', 'Singular')
Topics = translate('OpenLP.Ui', 'Topics', 'Plural') Topics = translate('OpenLP.Ui', 'Topics', 'Plural')
TypeInList = unicode(translate('OpenLP.Ui',
'This %s is already in the list.'))
TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance'))
TypeNotExistAdd = unicode(translate('OpenLP.Ui',
'This %s does not exist, do you want to add it?'))