From 7d907c5d638996c8d314c74f0dd11155b6f0415a Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Sat, 18 Mar 2017 22:30:23 -0700 Subject: [PATCH] enable a report graphic style object to have a "description" --- gramps/gen/plug/docgen/graphicstyle.py | 14 ++++++++++++++ gramps/gui/plug/report/_styleeditor.py | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/gramps/gen/plug/docgen/graphicstyle.py b/gramps/gen/plug/docgen/graphicstyle.py index 225aa1452..787ea360e 100644 --- a/gramps/gen/plug/docgen/graphicstyle.py +++ b/gramps/gen/plug/docgen/graphicstyle.py @@ -95,6 +95,7 @@ class GraphicsStyle: self.fill_color = obj.fill_color self.lwidth = obj.lwidth self.lstyle = obj.lstyle + self.description = obj.description else: self.para_name = "" self.shadow = 0 @@ -103,6 +104,19 @@ class GraphicsStyle: self.color = (0, 0, 0) self.fill_color = (255, 255, 255) self.lstyle = SOLID + self.description = "" + + def set_description(self, text): + """ + Set the desciption of the graphics object + """ + self.description = text + + def get_description(self): + """ + Return the desciption of the graphics object + """ + return self.description def set_line_width(self, val): """ diff --git a/gramps/gui/plug/report/_styleeditor.py b/gramps/gui/plug/report/_styleeditor.py index 43da76edc..2ce403423 100644 --- a/gramps/gui/plug/report/_styleeditor.py +++ b/gramps/gui/plug/report/_styleeditor.py @@ -336,7 +336,9 @@ class StyleEditor(ManagedWindow): self.pname.set_text( '%s' % self.current_name) self.pname.set_use_markup(True) - self.pdescription.set_text(_("No description available") ) + + descr = g.get_description() + self.pdescription.set_text(descr or _("No description available")) self.top.get_object("line_style").set_active(g.get_line_style()) self.top.get_object("line_width").set_value(g.get_line_width())