bug reports #2176, #2177, #2178; various Graphviz issues, merged up from gramps30

svn: r10758
This commit is contained in:
Stéphane Charette 2008-05-24 08:59:32 +00:00
parent 04a7358fb8
commit 0774bf2a8e
2 changed files with 26 additions and 25 deletions

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2007-2008 Brian G. Matherly # Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2007-2008 Stephane Charette
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -200,14 +201,23 @@ class GVDocBase(BaseDoc.BaseDoc, BaseDoc.GVDoc):
actually generate a file. actually generate a file.
""" """
if self.note: if self.note:
self.write( 'labelloc="%s";\n' % self.noteloc ) # build up the label
self.write( 'label="' ) label = u''
for line in self.note: for line in self.note: # for every line in the note...
self.write( '%s\\n' % line.replace('"', '\\\"') ) line = line.strip() # ...strip whitespace from this line...
self.write( '";\n') if line != '': # ...and if we still have a line...
self.write( 'fontsize="%d";\n' % self.notesize ) if label != '': # ...see if we need to insert a newline...
label += '\\n'
label += line.replace('"', '\\\"')
self.write( '}' ) # after all that, see if we have a label to display
if label != '':
self.write( '\n')
self.write( ' label="%s";\n' % label )
self.write( ' labelloc="%s";\n' % self.noteloc )
self.write( ' fontsize="%d";\n' % self.notesize )
self.write( '}\n\n' )
def add_node(self, node_id, label, shape="", color="", def add_node(self, node_id, label, shape="", color="",
style="", fillcolor="", url="", htmloutput=False): style="", fillcolor="", url="", htmloutput=False):
@ -292,6 +302,7 @@ class GVDocBase(BaseDoc.BaseDoc, BaseDoc.GVDoc):
""" Implement BaseDoc.GVDoc.start_subgraph() """ """ Implement BaseDoc.GVDoc.start_subgraph() """
self.write(' subgraph cluster_%s\n' % graph_id) self.write(' subgraph cluster_%s\n' % graph_id)
self.write(' {\n') self.write(' {\n')
self.write(' style="invis";\n') # no border around subgraph (#0002176)
def end_subgraph(self): def end_subgraph(self):
""" Implement BaseDoc.GVDoc.end_subgraph() """ """ Implement BaseDoc.GVDoc.end_subgraph() """

View File

@ -235,13 +235,6 @@ class FamilyLinesOptions(MenuReportOptions):
'than 1 child.')) 'than 1 child.'))
menu.add_option(category, 'incchildcnt', include_num_children) menu.add_option(category, 'incchildcnt', include_num_children)
include_researcher = BooleanOption(
_('Include researcher and date'), True)
include_researcher.set_help(_('Whether to include at the bottom the ' \
'researcher''s name, e-mail, and the ' \
'date the graph was generated.'))
menu.add_option(category, 'incresearcher', include_researcher)
include_private = BooleanOption(_('Include private records'), False) include_private = BooleanOption(_('Include private records'), False)
include_private.set_help(_('Whether to include names, dates, and ' \ include_private.set_help(_('Whether to include names, dates, and ' \
'families that are marked as private.')) 'families that are marked as private.'))
@ -357,9 +350,6 @@ class FamilyLinesReport(Report):
_opt = menu.get_option_by_name('incchildcnt') _opt = menu.get_option_by_name('incchildcnt')
self._incchildcount = _opt.get_value() self._incchildcount = _opt.get_value()
_opt = menu.get_option_by_name('incresearcher')
self._incresearcher = _opt.get_value()
_opt = menu.get_option_by_name('incprivate') _opt = menu.get_option_by_name('incprivate')
self._incprivate = _opt.get_value() self._incprivate = _opt.get_value()
@ -376,7 +366,7 @@ class FamilyLinesReport(Report):
_opt = menu.get_option_by_name('surnamecolors') _opt = menu.get_option_by_name('surnamecolors')
tmp = _opt.get_value().split() tmp = _opt.get_value().split()
while len(tmp) > 1: while len(tmp) > 1:
surname = tmp.pop(0).encode('iso-8859-1','xmlcharrefreplace') surname = tmp.pop(0).encode('iso-8859-1', 'xmlcharrefreplace')
colour = tmp.pop(0) colour = tmp.pop(0)
self._surnamecolors[surname] = colour self._surnamecolors[surname] = colour
@ -995,11 +985,11 @@ class FamilyLinesReport(Report):
father_handle = family.get_father_handle() father_handle = family.get_father_handle()
mother_handle = family.get_mother_handle() mother_handle = family.get_mother_handle()
self.doc.add_comment('')
if self._usesubgraphs and father_handle and mother_handle: if self._usesubgraphs and father_handle and mother_handle:
self.doc.start_subgraph(fgid) self.doc.start_subgraph(fgid)
self.doc.add_comment('')
# see if we have a father to link to this family # see if we have a father to link to this family
if father_handle: if father_handle:
if father_handle in self._people: if father_handle in self._people: