From 9cc6e3a05e0381afeb5d9eaef7ef817be9035e1c Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Tue, 27 Nov 2018 22:17:19 -0600 Subject: [PATCH] Fix Dashboard for multiple copies of a Gramplet (#718) * Fix Dashboard for multiple copies of a Gramplet Fixes #10650 * Fix Dashboard to recall minimized or undocked Gramplets --- gramps/gui/widgets/grampletpane.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gramps/gui/widgets/grampletpane.py b/gramps/gui/widgets/grampletpane.py index bc09d987f..52ceb2030 100644 --- a/gramps/gui/widgets/grampletpane.py +++ b/gramps/gui/widgets/grampletpane.py @@ -1152,7 +1152,7 @@ class GrampletPane(Gtk.ScrolledWindow): retval = [] filename = self.configfile if filename and os.path.exists(filename): - cp = configparser.ConfigParser() + cp = configparser.ConfigParser(strict=False) try: cp.read(filename, encoding='utf-8') except Exception as err: @@ -1216,12 +1216,10 @@ class GrampletPane(Gtk.ScrolledWindow): for key in base_opts: if key in gramplet.__dict__: base_opts[key] = gramplet.__dict__[key] - fp.write("[%s]\n" % gramplet.gname) + base_opts['state'] = gramplet.gstate + fp.write("[%s]\n" % gramplet.title) # section for key in base_opts: if key == "content": continue - elif key == "title": - if gramplet.title_override: - fp.write("title=%s\n" % base_opts[key]) elif key == "tname": continue elif key == "column": continue elif key == "row": continue @@ -1247,6 +1245,7 @@ class GrampletPane(Gtk.ScrolledWindow): for key in base_opts: if key in gramplet.__dict__: base_opts[key] = gramplet.__dict__[key] + base_opts['state'] = gramplet.gstate fp.write("[%s]\n" % gramplet.title) for key in base_opts: if key == "content": continue @@ -1266,7 +1265,7 @@ class GrampletPane(Gtk.ScrolledWindow): fp.write("data[%d]=%s\n" % (cnt, item)) cnt += 1 else: - fp.write("%s=%s\n\n" % (key, base_opts[key])) + fp.write("%s=%s\n" % (key, base_opts[key])) except IOError as err: LOG.warning("Failed to open %s because $s; gramplets not saved",