forked from openlp/openlp
Fix bug where empty lists fail to display dialogs
This commit is contained in:
parent
e788db767a
commit
8e0901ef67
@ -108,6 +108,7 @@ class AuthorsForm(QtGui.QDialog, Ui_AuthorsDialog):
|
||||
"""
|
||||
self.currentRow = self.AuthorListWidget.currentRow()
|
||||
item = self.AuthorListWidget.currentItem()
|
||||
if item is not None:
|
||||
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||
self.author = self.songmanager.get_author(item_id)
|
||||
self.DisplayEdit.setText(self.author.display_name)
|
||||
|
@ -106,6 +106,7 @@ class SongBookForm(QtGui.QDialog, Ui_SongBookDialog):
|
||||
"""
|
||||
self.currentRow = self.BookSongListWidget.currentRow()
|
||||
item = self.BookSongListWidget.currentItem()
|
||||
if item is not None:
|
||||
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||
self.Book = self.songmanager.get_book(item_id)
|
||||
self.NameEdit.setText(self.Book.name)
|
||||
|
@ -105,6 +105,7 @@ class TopicsForm(QtGui.QDialog, Ui_TopicsDialog):
|
||||
"""
|
||||
self.currentRow = self.TopicsListWidget.currentRow()
|
||||
item = self.TopicsListWidget.currentItem()
|
||||
if item is not None:
|
||||
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||
self.topic = self.songmanager.get_topic(item_id)
|
||||
self.TopicNameEdit.setText(self.topic.name)
|
||||
|
Loading…
Reference in New Issue
Block a user