forked from openlp/openlp
Fix none for new authors
Fix focus bugs in Song child windows
This commit is contained in:
parent
66b6836406
commit
6fdd5d028f
@ -154,6 +154,8 @@ class MigrateSongs():
|
||||
author = Author()
|
||||
authors_temp = self.session.query(TAuthor).get(a)
|
||||
author.display_name = authors_temp.authorname
|
||||
author.first_name = u''
|
||||
author.last_name = u''
|
||||
song.authors.append(author)
|
||||
try:
|
||||
self.session.add(song)
|
||||
|
@ -97,6 +97,7 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
||||
self.DeleteButton.setEnabled(False)
|
||||
self.author = None
|
||||
self._validate_form()
|
||||
self.DisplayEdit.setFocus()
|
||||
|
||||
def onAuthorListWidgetItemClicked(self, index):
|
||||
"""
|
||||
@ -108,7 +109,13 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
||||
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||
self.author = self.songmanager.get_author(item_id)
|
||||
self.DisplayEdit.setText(self.author.display_name)
|
||||
if self.author.first_name is None:
|
||||
self.FirstNameEdit.setText(u'')
|
||||
else:
|
||||
self.FirstNameEdit.setText(self.author.first_name)
|
||||
if self.author.last_name is None:
|
||||
self.LastNameEdit.setText(u'')
|
||||
else:
|
||||
self.LastNameEdit.setText(self.author.last_name)
|
||||
if len(self.author.songs) > 0:
|
||||
self.MessageLabel.setText(translate(u'AuthorForm', u'Author in use "Delete" is disabled'))
|
||||
@ -117,6 +124,7 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
||||
self.MessageLabel.setText(translate(u'AuthorForm', u'Author in not used'))
|
||||
self.DeleteButton.setEnabled(True)
|
||||
self._validate_form()
|
||||
self.DisplayEdit.setFocus()
|
||||
|
||||
def _validate_form(self):
|
||||
# We need at lease a display name
|
||||
|
@ -96,6 +96,7 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
|
||||
self.AddUpdateButton.setEnabled(True)
|
||||
self.Book = None
|
||||
self._validate_form()
|
||||
self.NameEdit.setFocus()
|
||||
|
||||
def onBooksListViewItemClicked(self, index):
|
||||
"""
|
||||
@ -115,6 +116,7 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
|
||||
self.MessageLabel.setText(translate(u'BookForm', u'Book in not used'))
|
||||
self.DeleteButton.setEnabled(True)
|
||||
self._validate_form()
|
||||
self.NameEdit.setFocus()
|
||||
|
||||
def _validate_form(self):
|
||||
# We need at lease a display name
|
||||
|
@ -95,6 +95,7 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
|
||||
self.DeleteButton.setEnabled(False)
|
||||
self.topic = None
|
||||
self._validate_form()
|
||||
self.TopicNameEdit.setFocus()
|
||||
|
||||
def onTopicsListWidgetItemClicked(self, index):
|
||||
"""
|
||||
@ -113,6 +114,7 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
|
||||
self.MessageLabel.setText(translate(u'TopicForm', u'Topic in not used'))
|
||||
self.DeleteButton.setEnabled(True)
|
||||
self._validate_form()
|
||||
self.TopicNameEdit.setFocus()
|
||||
|
||||
def _validate_form(self):
|
||||
# We need at lease a display name
|
||||
|
Loading…
Reference in New Issue
Block a user