2006-09-09 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadXML.py: remove commented out code * src/Editors/_EditEvent.py: handle overwriting of date text * src/RelLib/_DateBase.py: allow optional dropping of date text on serialization * src/RelLib/_Date.py: allow optional dropping of date text on serialization * src/RelLib/_Event.py: allow optional dropping of date text on serialization svn: r7306
This commit is contained in:
@@ -224,6 +224,30 @@ class EditEvent(EditPrimary):
|
||||
self.callback(self.obj)
|
||||
self.close()
|
||||
|
||||
def data_has_changed(self):
|
||||
"""
|
||||
A date comparison can fail incorrectly because we have made the
|
||||
decision to store entered text in the date. However, there is no
|
||||
entered date when importing from a XML file, so we can get an
|
||||
incorrect fail.
|
||||
"""
|
||||
|
||||
if self.db.readonly:
|
||||
return False
|
||||
elif self.obj.handle:
|
||||
orig = self.get_from_handle(self.obj.handle)
|
||||
if orig:
|
||||
cmp_obj = orig
|
||||
else:
|
||||
cmp_obj = self.empty_object()
|
||||
return cmp(cmp_obj.serialize(True)[1:],
|
||||
self.obj.serialize(True)[1:]) != 0
|
||||
else:
|
||||
cmp_obj = self.empty_object()
|
||||
return cmp(cmp_obj.serialize(True)[1:],
|
||||
self.obj.serialize()[1:]) != 0
|
||||
|
||||
|
||||
class EditPersonEvent(EditEvent):
|
||||
|
||||
def __init__(self, event, dbstate, uistate, track=[], callback=None):
|
||||
|
Reference in New Issue
Block a user