Pass new place information from an EditPerson window to an EventEdit window.

svn: r494
This commit is contained in:
David Hampton 2001-10-19 04:43:55 +00:00
parent 380e6f8ebd
commit 0a53a166af
3 changed files with 19 additions and 7 deletions

View File

@ -321,7 +321,7 @@ class EditPerson:
"""Brings up the EventEditor for a new event"""
import EventEdit
pname = self.person.getPrimaryName().getName()
EventEdit.EventEditor(self,pname,const.personalEvents,const.save_fevent,None,0)
EventEdit.EventEditor(self,pname,const.personalEvents,const.save_fevent,None,None,0)
def on_edit_birth_clicked(self,obj):
"""Brings up the EventEditor for the birth record, event name cannot be changed"""
@ -332,8 +332,11 @@ class EditPerson:
p = utils.get_place_from_list(self.bpcombo)
if p != None:
event.setPlace(p)
def_placename = None
else:
def_placename = self.bpcombo.entry.get_text()
EventEdit.EventEditor(self,pname,const.personalEvents,\
const.save_fevent,event,1)
const.save_fevent,event,def_placename,1)
def on_edit_death_clicked(self,obj):
"""Brings up the EventEditor for the death record, event name cannot be changed"""
@ -344,7 +347,11 @@ class EditPerson:
p = utils.get_place_from_list(self.dpcombo)
if p != None:
event.setPlace(p)
EventEdit.EventEditor(self,pname,const.personalEvents,const.save_fevent,event,1)
def_placename = None
else:
def_placename = self.dpcombo.entry.get_text()
EventEdit.EventEditor(self,pname,const.personalEvents,\
const.save_fevent,event,def_placename,1)
def on_aka_delete_clicked(self,obj):
"""Deletes the selected name from the name list"""
@ -502,7 +509,7 @@ class EditPerson:
return
pname = self.person.getPrimaryName().getName()
event = obj.get_row_data(obj.selection[0])
EventEdit.EventEditor(self,pname,const.personalEvents,const.save_fevent,event,0)
EventEdit.EventEditor(self,pname,const.personalEvents,const.save_fevent,event,None,0)
def on_event_select_row(self,obj,row,b,c):
event = obj.get_row_data(row)

View File

@ -46,7 +46,7 @@ from RelLib import *
#-------------------------------------------------------------------------
class EventEditor:
def __init__(self,parent,name,list,trans,event,read_only):
def __init__(self,parent,name,list,trans,event,def_placename,read_only):
self.parent = parent
self.event = event
self.trans = trans
@ -71,6 +71,7 @@ class EventEditor:
self.event_menu.set_popdown_strings(list)
if read_only:
self.event_menu.set_sensitive(0)
self.date_field.grab_focus()
# Typing CR selects OK button
self.window.editable_enters(self.name_field);
@ -85,6 +86,8 @@ class EventEditor:
utils.attach_places(values,self.place_combo,event.getPlace())
self.place_field.set_text(event.getPlaceName())
if (def_placename):
self.place_field.set_text(def_placename)
self.date_field.set_text(event.getDate())
self.cause_field.set_text(event.getCause())
self.descr_field.set_text(event.getDescription())
@ -95,6 +98,8 @@ class EventEditor:
self.note_field.set_word_wrap(1)
else:
utils.attach_places(values,self.place_combo,None)
if (def_placename):
self.place_field.set_text(def_placename)
self.window.set_data("o",self)
self.top.signal_autoconnect({

View File

@ -253,7 +253,7 @@ class Marriage:
name = father.getPrimaryName().getName()
else:
name = mother.getPrimaryName().getName()
EventEdit.EventEditor(self,name,const.marriageEvents,const.save_pevent,None,0)
EventEdit.EventEditor(self,name,const.marriageEvents,const.save_pevent,None,None,0)
def on_update_clicked(self,obj):
import EventEdit
@ -270,7 +270,7 @@ class Marriage:
name = father.getPrimaryName().getName()
else:
name = mother.getPrimaryName().getName()
EventEdit.EventEditor(self,name,const.marriageEvents,const.save_pevent,event,0)
EventEdit.EventEditor(self,name,const.marriageEvents,const.save_pevent,event,None,0)
def on_delete_clicked(self,obj):
if utils.delete_selected(obj,self.elist):