0003968: [NarWeb] Save/Restore settings for Narrated Website Generation. Change report_options file to be in the database directory, and implement different default report file and directory names based on the Family Tree Name. N.B. On upgrading, if you want to preserve your report_options, copy the report_option.xml file from the .gramps directory to the applicable .gramps.grampsdb.<number> directory. Also don't forget that the default options are to EXCLUDE private and living data.

svn: r21305
This commit is contained in:
Tim G L Lyons
2013-02-05 18:07:03 +00:00
parent 43c49238f5
commit 3ee843917e
4 changed files with 28 additions and 14 deletions

View File

@@ -601,13 +601,14 @@ class OptionHandler(_options.OptionHandler):
"""
Implements handling of the options for the plugins.
"""
def __init__(self, module_name, options_dict):
def __init__(self, module_name, options_dict, filename):
self.default_filename = filename
_options.OptionHandler.__init__(self, module_name, options_dict, None)
def init_subclass(self):
self.collection_class = OptionListCollection
self.list_class = OptionList
self.filename = REPORT_OPTIONS
self.filename = self.default_filename
def init_common(self):
"""
@@ -777,9 +778,12 @@ class ReportOptions(_options.Options):
self.options_dict = {}
self.options_help = {}
self.handler = None
self.default_report_options_file = os.path.join(dbase.full_name,
"report_options.xml")
def load_previous_values(self):
self.handler = OptionHandler(self.name, self.options_dict)
self.handler = OptionHandler(self.name, self.options_dict,
self.default_report_options_file)
def make_default_style(self, default_style):
"""