diff --git a/gramps/src/EditPerson.glade b/gramps/src/EditPerson.glade index 929f57a8d..7a781bbea 100644 --- a/gramps/src/EditPerson.glade +++ b/gramps/src/EditPerson.glade @@ -2306,58 +2306,6 @@ - - GtkLabel - label164 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 3 - - 0 - 1 - 4 - 5 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - event_details - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 0 - - 2 - 3 - 4 - 5 - 3 - 3 - True - False - False - False - True - False - - - GtkLabel label232 @@ -2436,32 +2384,6 @@ - - GtkLabel - label235 - - GTK_JUSTIFY_CENTER - False - 0 - 0.5 - 0 - 3 - - 1 - 2 - 4 - 5 - 0 - 0 - False - False - False - False - True - False - - - GtkLabel label241 @@ -2539,6 +2461,84 @@ False + + + GtkLabel + label273 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 3 + + 1 + 2 + 4 + 5 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label274 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 3 + + 0 + 1 + 4 + 5 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + event_srcinfo + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 2 + 3 + 4 + 5 + 0 + 0 + False + False + False + False + True + False + + diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index 94cacccce..8994868df 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -173,7 +173,7 @@ class EditPerson: self.event_cause_field = self.get_widget("eventCause") self.event_date_field = self.get_widget("eventDate") self.event_descr_field = self.get_widget("eventDescription") - self.event_details_field = self.get_widget("event_details") + self.event_src_field = self.get_widget("event_srcinfo") self.attr_details_field = self.get_widget("attr_details") self.name_details_field = self.get_widget("name_details") self.addr_details_field = self.get_widget("addr_details") @@ -225,16 +225,16 @@ class EditPerson: self.name_source = self.get_widget("name_source") self.gid = self.get_widget("gid") + self.death = Event(person.getDeath()) + self.birth = Event(person.getBirth()) + self.pname = Name(person.getPrimaryName()) + self.elist = person.getEventList()[:] self.nlist = person.getAlternateNames()[:] self.alist = person.getAttributeList()[:] self.ulist = person.getUrlList()[:] self.plist = person.getAddressList()[:] - self.death = Event(person.getDeath()) - self.birth = Event(person.getBirth()) - self.pname = Name(person.getPrimaryName()) - # Typing CR selects OK button self.window.editable_enters(self.notes_field); self.window.editable_enters(self.given); @@ -614,16 +614,14 @@ class EditPerson: # Update birth with new values, make sure death values don't change if self.update_birth: self.update_birth = 0 - self.bdate.set_text(self.birth.getDate()) - self.bplace.set_text(self.birth.getPlaceName()) + self.update_birth_info() self.dplace.set_text(prev_dtext) self.bdate_check = DateEdit(self.bdate,self.get_widget("birth_stat")) # Update death with new values, make sure birth values don't change if self.update_death: self.update_death = 0 - self.ddate.set_text(self.death.getDate()) - self.dplace.set_text(self.death.getPlaceName()) + self.update_death_info() self.bplace.set_text(prev_btext) self.ddate_check = DateEdit(self.ddate,self.get_widget("death_stat")) @@ -906,7 +904,6 @@ class EditPerson: ord.getStatus() != self.seal_stat or \ ord.getFamily() != self.ldsfam: return 1 - return 0 def on_event_delete_clicked(self,obj): @@ -979,7 +976,14 @@ class EditPerson: self.event_name_field.set_label(const.display_pevent(event.getName())) self.event_cause_field.set_text(event.getCause()) self.event_descr_field.set_text(event.getDescription()) - self.event_details_field.set_text(Utils.get_detail_text(event)) + if len(event.getSourceRefList()) > 0: + psrc = event.getSourceRefList()[0] + n = _("%(source_title)s; Confidence - %(confidence)s") % { + 'source_title' : psrc.getBase().getTitle(), + 'confidence' : const.confidence[psrc.getConfidence()]} + self.event_src_field.set_text(n) + else: + self.event_src_field.set_text('') def on_event_unselect_row(self,obj,a,b,c): enable = len(obj.selection) > 0 @@ -1388,10 +1392,22 @@ class EditPerson: self.load_photo(None) else: self.load_photo(None) + + def update_birth_info(self): + self.bdate.set_text(self.birth.getDate()) + self.bplace.set_text(self.birth.getPlaceName()) + + def update_death_info(self): + self.ddate.set_text(self.death.getDate()) + self.dplace.set_text(self.death.getPlaceName()) def on_switch_page(self,obj,a,page): if page == 0: self.load_person_image() + self.update_death_info() + self.update_birth_info() + elif page == 2: + self.redraw_event_list() elif page == 6 and self.not_loaded: self.not_loaded = 0 self.gallery.load_images() diff --git a/gramps/src/EventEdit.py b/gramps/src/EventEdit.py index 882929872..549a7cb71 100644 --- a/gramps/src/EventEdit.py +++ b/gramps/src/EventEdit.py @@ -209,6 +209,8 @@ class EventEditor: dobj = self.event.getDateObj() + self.event.setSourceRefList(self.srcreflist) + if compare_dates(dobj,date) != 0: self.event.setDateObj(date) self.parent.lists_changed = 1 diff --git a/gramps/src/RelLib.py b/gramps/src/RelLib.py index 2af69fbca..30286542b 100644 --- a/gramps/src/RelLib.py +++ b/gramps/src/RelLib.py @@ -1327,6 +1327,16 @@ class Event(DataObj): self.name = "" self.cause = "" + def is_empty(self): + date = self.getDateObj() + place = self.getPlace() + description = self.getDescription() + if (not name or name == "Birth" or name == "Death") and \ + date.isEmpty() and not place and not description: + return 1 + else: + return 0 + def set(self,name,date,place,description): """sets the name, date, place, and description of an Event instance""" self.name = name diff --git a/gramps/src/Sources.py b/gramps/src/Sources.py index 0fef65706..ae022907c 100644 --- a/gramps/src/Sources.py +++ b/gramps/src/Sources.py @@ -31,19 +31,17 @@ import libglade # gramps modules # #------------------------------------------------------------------------- - import const import Utils from RelLib import * #------------------------------------------------------------------------- # -# constants +# SourceSelector # #------------------------------------------------------------------------- class SourceSelector: - def __init__(self,srclist,parent,update=None): self.db = parent.db self.parent = parent @@ -149,7 +147,6 @@ class SourceEditor: return self.showSource.get_widget(name) def draw(self): - if self.source_ref: self.get_widget("spage").set_text(self.source_ref.getPage()) date = self.source_ref.getDate() diff --git a/gramps/src/WriteXML.py b/gramps/src/WriteXML.py index b7b0e4643..acf55e6aa 100644 --- a/gramps/src/WriteXML.py +++ b/gramps/src/WriteXML.py @@ -355,22 +355,14 @@ class XmlWriter: self.dump_my_event(event.getName(),event,index) def dump_my_event(self,name,event,index=1): - if not event: + if not event or event.is_empty(): return - - date = event.getDateObj() - place = event.getPlace() - description = event.getDescription() - cause = event.getCause() - if (not name or name == "Birth" or name == "Death") and \ - date.isEmpty() and not place and not description: - return - + sp = " " * index self.g.write('%s\n' % (sp,self.fix(name),conf_priv(event))) self.write_date(event.getDateObj(),index+1) self.write_ref("place",place,index+1) - self.write_line("cause",cause,index+1) + self.write_line("cause",event.getCause(),index+1) self.write_line("description",description,index+1) if event.getNote(): self.write_note("note",event.getNote(),index+1)