From 1c8384ff20d77bfb0bab1686f6000158a83ee82f Mon Sep 17 00:00:00 2001 From: "Craig J. Anderson" Date: Thu, 17 Mar 2011 16:28:18 +0000 Subject: [PATCH] fixes for error: http://www.gramps-project.org/bugs/view.php?id=4751 Too much work was done inside of __init__. Moved it out. svn: r16842 --- src/plugins/drawreport/AncestorTree.py | 8 +++++--- src/plugins/drawreport/DescendTree.py | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/plugins/drawreport/AncestorTree.py b/src/plugins/drawreport/AncestorTree.py index f071d146a..e27d00453 100644 --- a/src/plugins/drawreport/AncestorTree.py +++ b/src/plugins/drawreport/AncestorTree.py @@ -671,10 +671,9 @@ class AncestorTree2(Report): """ Report.__init__(self, database, options_class) - self.database = database - self.connect = GUIConnect() - self.connect.set__opts(options_class.menu) + self.options_class = options_class + self.database = database #The canvas that we will put our report on and print off of self.canvas = Canvas(self.doc) @@ -700,6 +699,9 @@ class AncestorTree2(Report): database = self.database + self.connect = GUIConnect() + self.connect.set__opts(self.options_class.menu) + #Set up the canvas that we will print on. style_sheet = self.doc.get_style_sheet() font_normal = style_sheet.get_paragraph_style("AC2-Normal").get_font() diff --git a/src/plugins/drawreport/DescendTree.py b/src/plugins/drawreport/DescendTree.py index 5e5bb3a83..2c0bfdc2b 100644 --- a/src/plugins/drawreport/DescendTree.py +++ b/src/plugins/drawreport/DescendTree.py @@ -1270,11 +1270,9 @@ class Descend2Tree(Report): """ Report.__init__(self, database, options_class) + self.options_class = options_class self.database = database - self.Connect = GuiConnect() - self.Connect.set__opts(options_class.menu, options_class.name) - #The canvas that we will put our report on and print off of self.canvas = Canvas(self.doc) @@ -1285,6 +1283,9 @@ class Descend2Tree(Report): database = self.database + self.Connect = GuiConnect() + self.Connect.set__opts(self.options_class.menu, self.options_class.name) + style_sheet = self.doc.get_style_sheet() font_normal = style_sheet.get_paragraph_style("CG2-Normal").get_font() self.doc.report_opts = ReportOptions(self.doc, font_normal, "CG2-line")