SongStrings

This commit is contained in:
Jon Tibble 2011-02-13 16:02:12 +00:00
parent d129085d87
commit 365072c05c
2 changed files with 13 additions and 19 deletions

View File

@ -215,13 +215,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
if self.manager.save_object(author): if self.manager.save_object(author):
self.resetAuthors() self.resetAuthors()
else: else:
critical_error_message_box( critical_error_message_box(SongStrings.CouldNotAdd %
message=translate('SongsPlugin.SongMaintenanceForm', SongStrings.Author.toLower())
'Could not add your author.'))
else: else:
critical_error_message_box( critical_error_message_box(
message=translate('SongsPlugin.SongMaintenanceForm', SongStrings.ThisTypeExists % SongStrings.Author.toLower())
'This author already exists.'))
def onTopicAddButtonClick(self): def onTopicAddButtonClick(self):
if self.topicform.exec_(): if self.topicform.exec_():
@ -230,13 +228,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
if self.manager.save_object(topic): if self.manager.save_object(topic):
self.resetTopics() self.resetTopics()
else: else:
critical_error_message_box( critical_error_message_box(SongStrings.CouldNotAdd %
message=translate('SongsPlugin.SongMaintenanceForm', SongStrings.Topic.toLower())
'Could not add your topic.'))
else: else:
critical_error_message_box( critical_error_message_box(
message=translate('SongsPlugin.SongMaintenanceForm', SongStrings.ThisTypeExists % SongStrings.Topic.toLower())
'This topic already exists.'))
def onBookAddButtonClick(self): def onBookAddButtonClick(self):
if self.bookform.exec_(): if self.bookform.exec_():
@ -246,13 +242,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
if self.manager.save_object(book): if self.manager.save_object(book):
self.resetBooks() self.resetBooks()
else: else:
critical_error_message_box( critical_error_message_box(SongStrings.CouldNotAdd %
message=translate('SongsPlugin.SongMaintenanceForm', SongStrings.SongBook.toLower())
'Could not add your book.'))
else: else:
critical_error_message_box( critical_error_message_box(
message=translate('SongsPlugin.SongMaintenanceForm', SongStrings.ThisTypeExists % SongStrings.SongBook.toLower())
'This book already exists.'))
def onAuthorEditButtonClick(self): def onAuthorEditButtonClick(self):
author_id = self._getCurrentItemId(self.authorsListWidget) author_id = self._getCurrentItemId(self.authorsListWidget)
@ -269,11 +263,9 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
temp_last_name = author.last_name temp_last_name = author.last_name
temp_display_name = author.display_name temp_display_name = author.display_name
if self.authorform.exec_(False): if self.authorform.exec_(False):
author.first_name = unicode( author.first_name = unicode(self.authorform.firstNameEdit.text())
self.authorform.firstNameEdit.text())
author.last_name = unicode(self.authorform.lastNameEdit.text()) author.last_name = unicode(self.authorform.lastNameEdit.text())
author.display_name = unicode( author.display_name = unicode(self.authorform.displayEdit.text())
self.authorform.displayEdit.text())
if self.checkAuthor(author, True): if self.checkAuthor(author, True):
if self.manager.save_object(author): if self.manager.save_object(author):
self.resetAuthors() self.resetAuthors()

View File

@ -38,8 +38,10 @@ class SongStrings(object):
Authors = translate('OpenLP.Ui', 'Authors', 'Plural') Authors = translate('OpenLP.Ui', 'Authors', 'Plural')
AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI. AuthorUnknown = translate('OpenLP.Ui', 'Author Unknown') # Used in the UI.
AuthorUnknownUnT = u'Author Unknown' # Used to populate the database. AuthorUnknownUnT = u'Author Unknown' # Used to populate the database.
CouldNotAdd = unicode(translate('OpenLP.Ui', 'Could not add your %s.'))
SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular') SongBook = translate('OpenLP.Ui', 'Song Book', 'Singular')
SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural') SongBooks = translate('OpenLP.Ui', 'Song Books', 'Plural')
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')
TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance')) TypeMaintenance = unicode(translate('OpenLP.Ui', '%s Maintenance'))