Refactoring the report system: reports no longer require dbstate.

svn: r9924
This commit is contained in:
Brian Matherly
2008-01-24 12:50:33 +00:00
parent c43c200c5d
commit 77af7ed092
25 changed files with 126 additions and 104 deletions

View File

@@ -48,7 +48,8 @@ class CommandLineReport:
noopt=False):
self.database = database
self.category = category
self.option_class = option_class(name)
self.option_class = option_class(name, database)
self.option_class.load_previous_values()
self.show = options_str_dict.pop('show',None)
self.options_str_dict = options_str_dict
self.init_options(noopt)

View File

@@ -782,13 +782,9 @@ class MenuReportOptions(GuiMenuOptions,ReportOptions):
MenuReportOptions class will worry about setting up the GUI.
"""
def __init__(self,name,dbstate=None):
if dbstate:
active_person = dbstate.get_active_person().get_gramps_id()
else:
active_person = None
ReportOptions.__init__(self,name,active_person)
GuiMenuOptions.__init__(self,dbstate)
def __init__(self, name, dbase):
ReportOptions.__init__(self, name, None)
GuiMenuOptions.__init__(self, dbase)
def load_previous_values(self):
ReportOptions.load_previous_values(self)