* src/DateEdit.py (update_after_editor): Add method.

* src/EditPerson.py: Always have birth/death events (never None);
Use new update method for dates; Only commit death/birth if changed;
Only add new birth/death if non-empty.
* src/EventEdit.py: Translate stored event names before including in
menu; Exclude birth/death from menu; Do not add birth/death to the
custom event types; Only detect type change for non-birth/death.
* src/GrampsDbBase.py: Do not commit objects with empty handles.
* src/GrampsInMemDB.py: Do not commit objects with empty handles.
* src/Utils.py (family_name): Add clause for unknown parents.


svn: r4172
This commit is contained in:
Alex Roitman
2005-03-13 22:10:40 +00:00
parent a40629dbbc
commit 35bc979e8e
7 changed files with 80 additions and 58 deletions

View File

@ -88,8 +88,10 @@ class EventEditor:
values = {}
for v in elist:
values[v] = 1
for v in self.db.get_person_event_type_list():
values[v] = 1
for vv in self.db.get_person_event_type_list():
if vv not in ("Birth","Death"):
v = _(vv)
values[v] = 1
self.elist = values.keys()
self.elist.sort()
@ -108,8 +110,8 @@ class EventEditor:
# add the name to the list if it is not already there. This
# tends to occur in translated languages with the 'Death'
# event, which is a partial match to other events
if not transname in elist:
elist.append(transname)
#if not transname in elist:
# elist.append(transname)
else:
self.srcreflist = []
self.witnesslist = []
@ -321,7 +323,7 @@ class EventEditor:
edesc = unicode(self.descr_field.get_text())
epriv = self.priv.get_active()
if not ename in self.elist:
if ename not in self.elist + [_("Birth") , _("Death")]:
WarningDialog(
_('New event type created'),
_('The "%s" event type has been added to this database.\n'
@ -353,7 +355,8 @@ class EventEditor:
self.event.set_place_handle("")
self.parent.lists_changed = 1
if self.event.get_name() != self.trans.find_key(name):
if self.event.get_name() not in [self.trans.find_key(name),
"Birth","Death"]:
self.event.set_name(self.trans.find_key(name))
self.parent.lists_changed = 1