* src/EventEdit.py: Add new places to the database.

svn: r4334
This commit is contained in:
Don Allingham 2005-04-10 22:08:11 +00:00
parent f8fd8d36da
commit 5bff9681c9
2 changed files with 18 additions and 10 deletions

View File

@ -1,4 +1,5 @@
2005-04-10 Don Allingham <don@gramps-project.org>
* src/EventEdit.py: Add new places to the database.
* src/Check.py: repair family types of "None" in the database
* src/Makefile.am: add MergePeople.py

View File

@ -296,10 +296,17 @@ class EventEditor:
"""Display the relevant portion of GRAMPS manual"""
gnome.help_display('gramps-manual','gramps-edit-complete')
def get_place(self,field):
text = unicode(field.get_text()).strip()
if text and self.pmap.has_key(text):
return self.parent.db.get_place_from_handle(self.pmap[text])
def get_place(self,field,trans):
text = unicode(field.get_text().strip())
if text:
if self.pmap.has_key(text):
return self.pdmap[text]
else:
place = RelLib.Place()
place.set_title(text)
self.db.add_place(place,trans)
self.pmap[text] = place.get_handle()
return place
else:
return None
@ -316,7 +323,7 @@ class EventEditor:
trans = self.db.transaction_begin()
#self.date = self.dp.parse(unicode(self.date_field.get_text()))
ecause = unicode(self.cause_field.get_text())
eplace_obj = self.get_place(self.place_field)
eplace_obj = self.get_place(self.place_field,trans)
buf = self.note_field.get_buffer()
start = buf.get_start_iter()