forked from openlp/openlp
More remote editing cleanups
This commit is contained in:
parent
536d26f5db
commit
831281e293
@ -256,3 +256,26 @@ class ServiceItem(object):
|
||||
self.add_from_command(path, text_image)
|
||||
elif self.service_item_type == ServiceItemType.Video:
|
||||
pass
|
||||
|
||||
def merge(self, other):
|
||||
"""
|
||||
Updates the uuid with the value from the original one
|
||||
The uuid is unique for a give service item but this allows one to
|
||||
replace an original version.
|
||||
"""
|
||||
self.uuid = other.uuid
|
||||
|
||||
def __eq__(self, other):
|
||||
"""
|
||||
Confirms the service items are for the same instance
|
||||
"""
|
||||
if not other:
|
||||
return False
|
||||
return self.uuid == other.uuid
|
||||
|
||||
def __ne__(self, other):
|
||||
"""
|
||||
Confirms the service items are not for the same instance
|
||||
"""
|
||||
return self.uuid != other.uuid
|
||||
|
||||
|
@ -544,7 +544,7 @@ class ServiceManager(QtGui.QWidget):
|
||||
sitem, count = self.findServiceItem()
|
||||
item.render()
|
||||
if self.remoteEditTriggered:
|
||||
item.uuid = self.serviceItems[sitem][u'data'].uuid
|
||||
item.merge(self.serviceItems[sitem][u'data'])
|
||||
self.serviceItems[sitem][u'data'] = item
|
||||
self.remoteEditTriggered = False
|
||||
self.repaintServiceList(sitem + 1, 0)
|
||||
|
@ -361,8 +361,7 @@ class SlideController(QtGui.QWidget):
|
||||
"""
|
||||
Replacement item following a remote edit
|
||||
"""
|
||||
if self.commandItem and \
|
||||
item.uuid == self.commandItem.uuid:
|
||||
if item.__eq__(self.commandItem):
|
||||
self.addServiceManagerItem(item, self.PreviewListWidget.currentRow())
|
||||
|
||||
def addServiceManagerItem(self, item, slideno):
|
||||
|
Loading…
Reference in New Issue
Block a user