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)
|
self.add_from_command(path, text_image)
|
||||||
elif self.service_item_type == ServiceItemType.Video:
|
elif self.service_item_type == ServiceItemType.Video:
|
||||||
pass
|
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()
|
sitem, count = self.findServiceItem()
|
||||||
item.render()
|
item.render()
|
||||||
if self.remoteEditTriggered:
|
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.serviceItems[sitem][u'data'] = item
|
||||||
self.remoteEditTriggered = False
|
self.remoteEditTriggered = False
|
||||||
self.repaintServiceList(sitem + 1, 0)
|
self.repaintServiceList(sitem + 1, 0)
|
||||||
|
@ -361,8 +361,7 @@ class SlideController(QtGui.QWidget):
|
|||||||
"""
|
"""
|
||||||
Replacement item following a remote edit
|
Replacement item following a remote edit
|
||||||
"""
|
"""
|
||||||
if self.commandItem and \
|
if item.__eq__(self.commandItem):
|
||||||
item.uuid == self.commandItem.uuid:
|
|
||||||
self.addServiceManagerItem(item, self.PreviewListWidget.currentRow())
|
self.addServiceManagerItem(item, self.PreviewListWidget.currentRow())
|
||||||
|
|
||||||
def addServiceManagerItem(self, item, slideno):
|
def addServiceManagerItem(self, item, slideno):
|
||||||
|
Loading…
Reference in New Issue
Block a user