forked from openlp/openlp
Fix bug #788084, modified code to use object id instead of title.
bzr-revno: 1580
This commit is contained in:
commit
35e6d2f97e
@ -116,7 +116,7 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
|
||||
log.debug(u'accept')
|
||||
if self.saveCustom():
|
||||
Receiver.send_message(u'custom_set_autoselect_item',
|
||||
self.customSlide.title)
|
||||
self.customSlide.id)
|
||||
Receiver.send_message(u'custom_load_list')
|
||||
QtGui.QDialog.accept(self)
|
||||
|
||||
|
@ -147,7 +147,7 @@ class CustomMediaItem(MediaManagerItem):
|
||||
QtCore.Qt.UserRole, QtCore.QVariant(custom_slide.id))
|
||||
self.listView.addItem(custom_name)
|
||||
# Auto-select the item if name has been set
|
||||
if custom_slide.title == self.autoSelectItem:
|
||||
if custom_slide.id == self.autoSelectItem:
|
||||
self.listView.setCurrentItem(custom_name)
|
||||
|
||||
def onNewClick(self):
|
||||
|
@ -696,9 +696,9 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.clearCaches()
|
||||
if self._validate_song():
|
||||
self.saveSong()
|
||||
Receiver.send_message(u'songs_set_autoselect_item',
|
||||
unicode(self.titleEdit.text()))
|
||||
Receiver.send_message(u'songs_set_autoselect_item',self.song.id)
|
||||
Receiver.send_message(u'songs_load_list')
|
||||
self.song = None
|
||||
QtGui.QDialog.accept(self)
|
||||
|
||||
def saveSong(self, preview=False):
|
||||
@ -756,8 +756,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
||||
self.song.topics.append(self.manager.get_object(Topic, topicId))
|
||||
clean_song(self.manager, self.song)
|
||||
self.manager.save_object(self.song)
|
||||
if not preview:
|
||||
self.song = None
|
||||
|
||||
def _processLyrics(self):
|
||||
"""
|
||||
|
@ -245,7 +245,7 @@ class SongMediaItem(MediaManagerItem):
|
||||
song_name.setData(QtCore.Qt.UserRole, QtCore.QVariant(song.id))
|
||||
self.listView.addItem(song_name)
|
||||
# Auto-select the item if name has been set
|
||||
if song.title == self.autoSelectItem :
|
||||
if song.id == self.autoSelectItem :
|
||||
self.listView.setCurrentItem(song_name)
|
||||
|
||||
def displayResultsAuthor(self, searchresults):
|
||||
|
Loading…
Reference in New Issue
Block a user