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
This commit is contained in:
parent
d6dd1dc221
commit
9cc6e3a05e
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user