From ba3fc60e5118b22f8561d2b300f6598d8ab9b65e Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Sat, 27 May 2006 03:39:43 +0000 Subject: [PATCH] src/plugins/IndivComplete.py: Add event notes svn: r6796 --- ChangeLog | 3 +++ src/plugins/IndivComplete.py | 43 ++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 146595af1..90e6d0fd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2006-05-26 Brian Matherly + * src/plugins/IndivComplete.py: Add event notes. + 2006-05-26 Alex Roitman * src/BasicUtils.py (UpdateCallback.reset): Add method. * src/plugins/verify.glade: update interface. diff --git a/src/plugins/IndivComplete.py b/src/plugins/IndivComplete.py index 8d8b7fa67..4cc8c22aa 100644 --- a/src/plugins/IndivComplete.py +++ b/src/plugins/IndivComplete.py @@ -113,7 +113,9 @@ class IndivCompleteReport(Report.Report): def write_fact(self,event): if event == None: return + text = "" name = str(event.get_type()) + date = DateHandler.get_date(event) place_handle = event.get_place_handle() if place_handle: @@ -121,29 +123,38 @@ class IndivCompleteReport(Report.Report): place_handle).get_title() else: place = "" - description = event.get_description() - if not date: - if not place: - return - else: - text = '%s. %s' % (place,description) - else: - if not place: - text = '%s. %s' % (date,description) - else: - text = _('%(date)s in %(place)s.') % { 'date' : date, - 'place' : place } - text = '%s %s' % (text,description) + + if place and date: + text = _('%(date)s in %(place)s. ') % { 'date' : date, + 'place' : place } + elif place and not date: + text = '%s. ' % place + elif date and not place: + text = '%s. ' % date + + description = event.get_description() + text = '%s%s. ' % (text,description) - self.doc.start_row() - self.normal_cell(name) if self.use_srcs: for s in event.get_source_references(): src_handle = s.get_reference_handle() src = self.database.get_source_from_handle(src_handle) text = "%s [%s]" % (text,src.get_gramps_id()) self.slist.append(s) - self.normal_cell(text) + + self.doc.start_row() + self.normal_cell(name) + self.doc.start_cell('IDS-NormalCell') + self.doc.start_paragraph('IDS-Normal') + self.doc.write_text(text) + self.doc.end_paragraph() + + note = event.get_note() + if note: + format = event.get_note_format() + self.doc.write_note(note,format,'IDS-Normal') + + self.doc.end_cell() self.doc.end_row() def write_p_entry(self,label,parent,rel):