diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index e566a7506..cd109b9dd 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -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) diff --git a/gramps/src/EventEdit.py b/gramps/src/EventEdit.py index b9a510707..98ac92b7d 100644 --- a/gramps/src/EventEdit.py +++ b/gramps/src/EventEdit.py @@ -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({ diff --git a/gramps/src/Marriage.py b/gramps/src/Marriage.py index ba1d9b8f8..c5bd52e64 100644 --- a/gramps/src/Marriage.py +++ b/gramps/src/Marriage.py @@ -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):