* src/EditFamily.py: fix empty gramps_id for new families

* src/GrampsWidgets.py: fix empty gramps_id for new families


svn: r5913
This commit is contained in:
Don Allingham 2006-02-10 03:37:20 +00:00
parent 5cdd61e46b
commit d9dad03bea
3 changed files with 5 additions and 6 deletions

View File

@ -1,4 +1,6 @@
2006-02-09 Don Allingham <don@gramps-project.org>
* src/EditFamily.py: fix empty gramps_id for new families
* src/GrampsWidgets.py: fix empty gramps_id for new families
* src/DisplayTabs.py: fix editing of person events
* src/EditPerson.py: sort out birth/death references
* src/EventEdit.py: Handle event references properly

View File

@ -298,7 +298,7 @@ class EditFamily(DisplayState.ManagedWindow):
def _setup_monitored_values(self):
self.private= GrampsWidgets.PrivacyButton(self.top.get_widget('private'),
self.family)
self.gid = GrampsWidgets.MonitoredEntry(self.top.get_widget('gid'),
self.family.set_gramps_id,
self.family.get_gramps_id)
@ -537,7 +537,6 @@ class EditFamily(DisplayState.ManagedWindow):
original = None
if not original:
print self.family.serialize()
trans = self.dbstate.db.transaction_begin()
self.dbstate.db.add_family(self.family,trans)
self.dbstate.db.transaction_commit(trans,_("Edit Family"))
@ -556,10 +555,7 @@ class EditFamily(DisplayState.ManagedWindow):
# remove the family from children which have been removed
for handle in orig_set.difference(new_set):
person = self.dbstate.db.get_person_from_handle(handle)
print person.get_primary_name().get_name()
print person.get_parent_family_handle_list()
person.remove_parent_family_handle(self.family.handle)
print person.get_parent_family_handle_list()
self.dbstate.db.commit_person(person,trans)
# add the family from children which have been removed

View File

@ -227,6 +227,7 @@ class MonitoredEntry:
self.set_val = set_val
self.get_val = get_val
self.obj.set_text(get_val())
if get_val():
self.obj.set_text(get_val())
self.obj.connect('changed', lambda x: self.set_val(unicode(x.get_text())))
self.obj.set_editable(not read_only)