forked from openlp/openlp
bug-789102, moved mediaitem list updates out of editforms into mediaitems
This commit is contained in:
parent
6c870f7f7f
commit
729fe2cfa3
@ -453,7 +453,8 @@ class MediaManagerItem(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
if QtCore.QSettings().value(u'advanced/single click preview',
|
if QtCore.QSettings().value(u'advanced/single click preview',
|
||||||
QtCore.QVariant(False)).toBool() and self.quickPreviewAllowed \
|
QtCore.QVariant(False)).toBool() and self.quickPreviewAllowed \
|
||||||
and self.listView.selectedIndexes():
|
and self.listView.selectedIndexes() \
|
||||||
|
and self.auto_select_id == -1:
|
||||||
self.onPreviewClick(True)
|
self.onPreviewClick(True)
|
||||||
|
|
||||||
def onPreviewClick(self, keepFocus=False):
|
def onPreviewClick(self, keepFocus=False):
|
||||||
|
@ -115,7 +115,6 @@ class EditCustomForm(QtGui.QDialog, Ui_CustomEditDialog):
|
|||||||
def accept(self):
|
def accept(self):
|
||||||
log.debug(u'accept')
|
log.debug(u'accept')
|
||||||
if self.saveCustom():
|
if self.saveCustom():
|
||||||
Receiver.send_message(u'custom_load_list')
|
|
||||||
QtGui.QDialog.accept(self)
|
QtGui.QDialog.accept(self)
|
||||||
|
|
||||||
def saveCustom(self):
|
def saveCustom(self):
|
||||||
|
@ -131,7 +131,7 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
QtCore.QVariant(CustomSearch.Titles)).toInt()[0])
|
QtCore.QVariant(CustomSearch.Titles)).toInt()[0])
|
||||||
# Called to redisplay the custom list screen edith from a search
|
# Called to redisplay the custom list screen edith from a search
|
||||||
# or from the exit of the Custom edit dialog. If remote editing is
|
# 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':
|
if self.remoteTriggered == u'L':
|
||||||
self.onAddClick()
|
self.onAddClick()
|
||||||
if self.remoteTriggered == u'P':
|
if self.remoteTriggered == u'P':
|
||||||
@ -160,6 +160,7 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
self.edit_custom_form.loadCustom(0)
|
self.edit_custom_form.loadCustom(0)
|
||||||
self.edit_custom_form.exec_()
|
self.edit_custom_form.exec_()
|
||||||
self.initialise()
|
self.initialise()
|
||||||
|
self.onSelectionChange()
|
||||||
|
|
||||||
def onRemoteEditClear(self):
|
def onRemoteEditClear(self):
|
||||||
self.remoteTriggered = None
|
self.remoteTriggered = None
|
||||||
@ -179,6 +180,8 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
self.remoteTriggered = remote_type
|
self.remoteTriggered = remote_type
|
||||||
self.edit_custom_form.loadCustom(custom_id, (remote_type == u'P'))
|
self.edit_custom_form.loadCustom(custom_id, (remote_type == u'P'))
|
||||||
self.edit_custom_form.exec_()
|
self.edit_custom_form.exec_()
|
||||||
|
self.auto_select_id = -1
|
||||||
|
self.initialise()
|
||||||
|
|
||||||
def onEditClick(self):
|
def onEditClick(self):
|
||||||
"""
|
"""
|
||||||
@ -189,6 +192,7 @@ class CustomMediaItem(MediaManagerItem):
|
|||||||
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
item_id = (item.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||||
self.edit_custom_form.loadCustom(item_id, False)
|
self.edit_custom_form.loadCustom(item_id, False)
|
||||||
self.edit_custom_form.exec_()
|
self.edit_custom_form.exec_()
|
||||||
|
self.auto_select_id = -1
|
||||||
self.initialise()
|
self.initialise()
|
||||||
|
|
||||||
def onDeleteClick(self):
|
def onDeleteClick(self):
|
||||||
|
@ -696,7 +696,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
|
|||||||
self.clearCaches()
|
self.clearCaches()
|
||||||
if self._validate_song():
|
if self._validate_song():
|
||||||
self.saveSong()
|
self.saveSong()
|
||||||
Receiver.send_message(u'songs_load_list')
|
|
||||||
self.song = None
|
self.song = None
|
||||||
QtGui.QDialog.accept(self)
|
QtGui.QDialog.accept(self)
|
||||||
|
|
||||||
|
@ -214,6 +214,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
Handle the exit from the edit dialog and trigger remote updates
|
Handle the exit from the edit dialog and trigger remote updates
|
||||||
of songs
|
of songs
|
||||||
"""
|
"""
|
||||||
|
print "reload list"
|
||||||
log.debug(u'onSongListLoad - start')
|
log.debug(u'onSongListLoad - start')
|
||||||
# Called to redisplay the song list screen edit from a search
|
# 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
|
# 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)
|
self.listView.addItem(song_name)
|
||||||
# Auto-select the item if name has been set
|
# Auto-select the item if name has been set
|
||||||
if song.id == self.auto_select_id:
|
if song.id == self.auto_select_id:
|
||||||
|
print "have match" , song.id
|
||||||
self.listView.setCurrentItem(song_name)
|
self.listView.setCurrentItem(song_name)
|
||||||
self.auto_select_id = -1
|
self.auto_select_id = -1
|
||||||
|
|
||||||
@ -297,8 +299,12 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
|
|
||||||
def onNewClick(self):
|
def onNewClick(self):
|
||||||
log.debug(u'onNewClick')
|
log.debug(u'onNewClick')
|
||||||
|
print "New"
|
||||||
self.edit_song_form.newSong()
|
self.edit_song_form.newSong()
|
||||||
self.edit_song_form.exec_()
|
self.edit_song_form.exec_()
|
||||||
|
print "back from edit"
|
||||||
|
self.onSongListLoad()
|
||||||
|
self.onSelectionChange()
|
||||||
|
|
||||||
def onSongMaintenanceClick(self):
|
def onSongMaintenanceClick(self):
|
||||||
self.song_maintenance_form.exec_()
|
self.song_maintenance_form.exec_()
|
||||||
@ -323,6 +329,8 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
self.remoteTriggered = remote_type
|
self.remoteTriggered = remote_type
|
||||||
self.edit_song_form.loadSong(song_id, (remote_type == u'P'))
|
self.edit_song_form.loadSong(song_id, (remote_type == u'P'))
|
||||||
self.edit_song_form.exec_()
|
self.edit_song_form.exec_()
|
||||||
|
self.auto_select_id = -1
|
||||||
|
self.onSongListLoad()
|
||||||
|
|
||||||
def onEditClick(self):
|
def onEditClick(self):
|
||||||
"""
|
"""
|
||||||
@ -334,6 +342,8 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0]
|
item_id = (self.editItem.data(QtCore.Qt.UserRole)).toInt()[0]
|
||||||
self.edit_song_form.loadSong(item_id, False)
|
self.edit_song_form.loadSong(item_id, False)
|
||||||
self.edit_song_form.exec_()
|
self.edit_song_form.exec_()
|
||||||
|
self.auto_select_id = -1
|
||||||
|
self.onSongListLoad()
|
||||||
self.editItem = None
|
self.editItem = None
|
||||||
|
|
||||||
def onDeleteClick(self):
|
def onDeleteClick(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user