bug-789102, moved mediaitem list updates out of editforms into mediaitems

This commit is contained in:
Stevan Pettit 2011-05-30 23:52:17 -04:00
parent 6c870f7f7f
commit 729fe2cfa3
5 changed files with 17 additions and 4 deletions

View File

@ -453,7 +453,8 @@ class MediaManagerItem(QtGui.QWidget):
"""
if QtCore.QSettings().value(u'advanced/single click preview',
QtCore.QVariant(False)).toBool() and self.quickPreviewAllowed \
and self.listView.selectedIndexes():
and self.listView.selectedIndexes() \
and self.auto_select_id == -1:
self.onPreviewClick(True)
def onPreviewClick(self, keepFocus=False):

View File

@ -115,7 +115,6 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
def accept(self):
log.debug(u'accept')
if self.saveCustom():
Receiver.send_message(u'custom_load_list')
QtGui.QDialog.accept(self)
def saveCustom(self):

View File

@ -131,7 +131,7 @@ class CustomMediaItem(MediaManagerItem):
QtCore.QVariant(CustomSearch.Titles)).toInt()[0])
# Called to redisplay the custom list screen edith from a search
# or from the exit of the Custom edit dialog. If remote editing is
# active trigger it and clean up so it will not update again.
# active trigger it and clean up so it will not update again.
if self.remoteTriggered == u'L':
self.onAddClick()
if self.remoteTriggered == u'P':
@ -160,6 +160,7 @@ class CustomMediaItem(MediaManagerItem):
self.edit_custom_form.loadCustom(0)
self.edit_custom_form.exec_()
self.initialise()
self.onSelectionChange()
def onRemoteEditClear(self):
self.remoteTriggered = None
@ -179,6 +180,8 @@ class CustomMediaItem(MediaManagerItem):
self.remoteTriggered = remote_type
self.edit_custom_form.loadCustom(custom_id, (remote_type == u'P'))
self.edit_custom_form.exec_()
self.auto_select_id = -1
self.initialise()
def onEditClick(self):
"""
@ -189,6 +192,7 @@ class CustomMediaItem(MediaManagerItem):
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
self.edit_custom_form.loadCustom(item_id, False)
self.edit_custom_form.exec_()
self.auto_select_id = -1
self.initialise()
def onDeleteClick(self):

View File

@ -696,7 +696,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.clearCaches()
if self._validate_song():
self.saveSong()
Receiver.send_message(u'songs_load_list')
self.song = None
QtGui.QDialog.accept(self)

View File

@ -214,6 +214,7 @@ class SongMediaItem(MediaManagerItem):
Handle the exit from the edit dialog and trigger remote updates
of songs
"""
print "reload list"
log.debug(u'onSongListLoad - start')
# Called to redisplay the song list screen edit from a search
# or from the exit of the Song edit dialog. If remote editing is active
@ -248,6 +249,7 @@ class SongMediaItem(MediaManagerItem):
self.listView.addItem(song_name)
# Auto-select the item if name has been set
if song.id == self.auto_select_id:
print "have match" , song.id
self.listView.setCurrentItem(song_name)
self.auto_select_id = -1
@ -297,8 +299,12 @@ class SongMediaItem(MediaManagerItem):
def onNewClick(self):
log.debug(u'onNewClick')
print "New"
self.edit_song_form.newSong()
self.edit_song_form.exec_()
print "back from edit"
self.onSongListLoad()
self.onSelectionChange()
def onSongMaintenanceClick(self):
self.song_maintenance_form.exec_()
@ -323,6 +329,8 @@ class SongMediaItem(MediaManagerItem):
self.remoteTriggered = remote_type
self.edit_song_form.loadSong(song_id, (remote_type == u'P'))
self.edit_song_form.exec_()
self.auto_select_id = -1
self.onSongListLoad()
def onEditClick(self):
"""
@ -334,6 +342,8 @@ class SongMediaItem(MediaManagerItem):
item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0]
self.edit_song_form.loadSong(item_id, False)
self.edit_song_form.exec_()
self.auto_select_id = -1
self.onSongListLoad()
self.editItem = None
def onDeleteClick(self):