name standardisation + reloads song list after author(s) have been edited/merged

This commit is contained in:
andreas 2010-07-17 18:03:59 +02:00
parent c7f32e280c
commit d0e914a681
4 changed files with 11 additions and 7 deletions

View File

@ -430,7 +430,7 @@ class Ui_EditSongDialog(object):
self.AuthorRemoveButton.setText( self.AuthorRemoveButton.setText(
translate('SongsPlugin.EditSongForm', '&Remove')) translate('SongsPlugin.EditSongForm', '&Remove'))
self.MaintenanceButton.setText(translate('SongsPlugin.EditSongForm', self.MaintenanceButton.setText(translate('SongsPlugin.EditSongForm',
'&Manage Authors, Topics, Books')) '&Manage Authors, Topics, Song Books'))
self.TopicGroupBox.setTitle( self.TopicGroupBox.setTitle(
translate('SongsPlugin.EditSongForm', 'Topic')) translate('SongsPlugin.EditSongForm', 'Topic'))
self.TopicAddButton.setText( self.TopicAddButton.setText(
@ -441,7 +441,7 @@ class Ui_EditSongDialog(object):
translate('SongsPlugin.EditSongForm', 'Song Book')) translate('SongsPlugin.EditSongForm', 'Song Book'))
self.SongTabWidget.setTabText( self.SongTabWidget.setTabText(
self.SongTabWidget.indexOf(self.AuthorsTab), self.SongTabWidget.indexOf(self.AuthorsTab),
translate('SongsPlugin.EditSongForm', 'Authors, Topics && Book')) translate('SongsPlugin.EditSongForm', 'Authors, Topics && Song Book'))
self.ThemeGroupBox.setTitle( self.ThemeGroupBox.setTitle(
translate('SongsPlugin.EditSongForm', 'Theme')) translate('SongsPlugin.EditSongForm', 'Theme'))
self.ThemeAddButton.setText( self.ThemeAddButton.setText(

View File

@ -68,7 +68,7 @@ class Ui_SongBookDialog(object):
def retranslateUi(self, SongBookDialog): def retranslateUi(self, SongBookDialog):
SongBookDialog.setWindowTitle( SongBookDialog.setWindowTitle(
translate('SongsPlugin.SongBookForm', 'Edit Book')) translate('SongsPlugin.SongBookForm', 'Song Book Maintenance'))
self.NameLabel.setText(translate('SongsPlugin.SongBookForm', '&Name:')) self.NameLabel.setText(translate('SongsPlugin.SongBookForm', '&Name:'))
self.PublisherLabel.setText( self.PublisherLabel.setText(
translate('SongsPlugin.SongBookForm', '&Publisher:')) translate('SongsPlugin.SongBookForm', '&Publisher:'))

View File

@ -217,7 +217,7 @@ class Ui_SongMaintenanceDialog(object):
self.TypeListWidget.item(1).setText( self.TypeListWidget.item(1).setText(
translate('SongsPlugin.SongMaintenanceForm', 'Topics')) translate('SongsPlugin.SongMaintenanceForm', 'Topics'))
self.TypeListWidget.item(2).setText( self.TypeListWidget.item(2).setText(
translate('SongsPlugin.SongMaintenanceForm', 'Books/Hymnals')) translate('SongsPlugin.SongMaintenanceForm', 'Song Books'))
self.AuthorAddButton.setText( self.AuthorAddButton.setText(
translate('SongsPlugin.SongMaintenanceForm', '&Add')) translate('SongsPlugin.SongMaintenanceForm', '&Add'))
self.AuthorEditButton.setText( self.AuthorEditButton.setText(

View File

@ -26,7 +26,7 @@
from PyQt4 import QtGui, QtCore from PyQt4 import QtGui, QtCore
from sqlalchemy.sql import and_ from sqlalchemy.sql import and_
from openlp.core.lib import translate from openlp.core.lib import Receiver, translate
from openlp.plugins.songs.forms import AuthorsForm, TopicsForm, SongBookForm from openlp.plugins.songs.forms import AuthorsForm, TopicsForm, SongBookForm
from openlp.plugins.songs.lib.db import Author, Book, Topic, Song, \ from openlp.plugins.songs.lib.db import Author, Book, Topic, Song, \
SongsTopics, AuthorsSongs SongsTopics, AuthorsSongs
@ -278,9 +278,11 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
if self.checkAuthor(author, True): if self.checkAuthor(author, True):
if self.songmanager.save_object(author): if self.songmanager.save_object(author):
self.resetAuthors() self.resetAuthors()
Receiver.send_message(u'songs_load_list')
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate('SongsPlugin.SongMaintenanceForm', 'Error'), translate('SongsPlugin.SongMaintenanceForm',
'Error'),
translate('SongsPlugin.SongMaintenanceForm', translate('SongsPlugin.SongMaintenanceForm',
'Could not save your changes.')) 'Could not save your changes.'))
elif QtGui.QMessageBox.critical(self, elif QtGui.QMessageBox.critical(self,
@ -293,6 +295,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.Yes: QtGui.QMessageBox.Yes)) == QtGui.QMessageBox.Yes:
self.mergeAuthors(author) self.mergeAuthors(author)
self.resetAuthors() self.resetAuthors()
Receiver.send_message(u'songs_load_list')
else: else:
# We restore the author's old first and last name as well as # We restore the author's old first and last name as well as
# his display name. # his display name.
@ -319,7 +322,8 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
self.resetTopics() self.resetTopics()
else: else:
QtGui.QMessageBox.critical(self, QtGui.QMessageBox.critical(self,
translate('SongsPlugin.SongMaintenanceForm', 'Error'), translate('SongsPlugin.SongMaintenanceForm',
'Error'),
translate('SongsPlugin.SongMaintenanceForm', translate('SongsPlugin.SongMaintenanceForm',
'Could not save your changes.')) 'Could not save your changes.'))
elif QtGui.QMessageBox.critical(self, elif QtGui.QMessageBox.critical(self,