diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 49daeb4f0..08fdc3a72 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,8 @@ +2005-07-15 Don Allingham + * src/Reportutils.py: copy source information while sanitizing data + * src/plugins/NavWebPage.py: add source references instead of direct + links to sources + 2005-07-15 Alex Roitman * src/plugins/NavWebPage.py: Use researcher info from Gramps session, not from the database. diff --git a/gramps2/src/ReportUtils.py b/gramps2/src/ReportUtils.py index 2af67d4f9..a8d25287a 100644 --- a/gramps2/src/ReportUtils.py +++ b/gramps2/src/ReportUtils.py @@ -347,6 +347,11 @@ def sanitize_person(db,person): if not attribute.get_privacy(): new_person.add_attribute(RelLib.Attribute(attribute)) + # copy source references + for ref in person.get_source_references(): + if not ref.get_privacy(): + new_person.add_source_reference(RelLib.SourceRef(ref)) + # copy URL list for url in person.get_url_list(): if not url.get_privacy(): diff --git a/gramps2/src/plugins/NavWebPage.py b/gramps2/src/plugins/NavWebPage.py index 499f77ffd..9d2e272dd 100644 --- a/gramps2/src/plugins/NavWebPage.py +++ b/gramps2/src/plugins/NavWebPage.py @@ -903,6 +903,7 @@ class IndividualPage(BasePage): self.db = db self.ind_list = ind_list self.src_list = src_list + self.src_refs = [] self.place_list = place_list self.sort_name = _nd.sorted(self.person) self.name = _nd.sorted(self.person) @@ -922,10 +923,10 @@ class IndividualPage(BasePage): self.close_file(of) def display_ind_sources(self,of): - sreflist = self.person.get_source_references() + sreflist = self.src_refs + self.person.get_source_references() if not sreflist: return - of.write('

%s

\n' % _('Sources')) + of.write('

%s

\n' % _('Source Referencess')) of.write('
\n') of.write('\n') @@ -939,25 +940,22 @@ class IndividualPage(BasePage): else: self.src_list[sref.get_base_handle()] = [self.person.handle] - source = self.db.get_source_from_handle(sref.get_base_handle()) - author = source.get_author() title = source.get_title() - publisher = source.get_publication_info() - date = _dd.display(sref.get_date_object()) - of.write('\n') + of.write('' % (index,index)) + of.write('\n') + index += 1 of.write('
%d. ' % index) - of.write('' % (source.handle,self.ext)) - values = [] - if author: - values.append(author) - if title: - values.append(title) - if publisher: - values.append(publisher) - if date: - values.append(date) - of.write(', '.join(values)) - of.write('
%d.' % (source.handle,self.ext)) + of.write('%s [%s]' %(title,source.gramps_id)) + of.write('') + tmp = [] + for (label,data) in [(_('Page'),sref.page), + (_('Confidence'),const.confidence[sref.confidence]), + (_('Text'),sref.text)]: + if data: + tmp.append("%s: %s" % (label,data)) + if len(tmp) > 0: + of.write('
' + '
'.join(tmp)) + of.write('
\n') def display_ind_pedigree(self,of): @@ -1024,18 +1022,19 @@ class IndividualPage(BasePage): of.write('%s' % pname) nshl = [] for nsref in name.get_source_references(): + self.src_refs.append(nsref) nsh = nsref.get_base_handle() if self.src_list.has_key(nsh): if self.person.handle not in self.src_list[nsh]: self.src_list[nsh].append(self.person.handle) else: self.src_list[nsh] = [self.person.handle] - nshl.append(nsh) + nshl.append(nsref) if nshl: of.write( " ") for nsh in nshl: - src = self.db.get_source_from_handle(nsh) - of.write(' [%s]' % (nsh,self.ext,src.gramps_id)) + index = self.src_refs.index(nsh)+1 + of.write(' %d' % (index,index)) of.write( " ") of.write('\n\n') @@ -1231,13 +1230,14 @@ class IndividualPage(BasePage): gid_list = [] for sref in event.get_source_references(): handle = sref.get_base_handle() - gid_list.append(handle) + gid_list.append(sref) if self.src_list.has_key(handle): if self.person.handle not in self.src_list[handle]: self.src_list[handle].append(self.person.handle) else: self.src_list[handle] = [self.person.handle] + self.src_refs.append(sref) descr = event.get_description() place_handle = event.get_place_handle() @@ -1269,9 +1269,9 @@ class IndividualPage(BasePage): text = '\n' if len(gid_list) > 0: text = text + " " - for handle in gid_list: - src = self.db.get_source_from_handle(handle) - text = text + ' [%s]' % (handle,self.ext,src.gramps_id) + for ref in gid_list: + index = self.src_refs.index(ref)+1 + text = text + ' %d' % (index,index) text = text + "" return text @@ -1950,6 +1950,8 @@ class GrampsNoteComboBox(gtk.ComboBox): self.add_attribute(cell,'text',0) if node: self.set_active_iter(node) + else: + self.set_active(0) self.local_store = model def get_handle(self):