diff --git a/ChangeLog b/ChangeLog index f83832ce3..1f8b5dbb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-01-15 Douglas S. Blank + * src/PluginUtils/_Tool.py (Tool.__init__): pass in dbstate + * src/PluginUtils/__init__.py (MenuToolOptions.__init__): + pass in dbstate + * src/plugins/Calendar.py (CalendarOptions.add_menu_options): + standard defaults + 2008-01-15 Benny Malengier * src/GrampsDbUtils/_GrampsDbWriteXML.py: import gzip diff --git a/src/PluginUtils/_Tool.py b/src/PluginUtils/_Tool.py index 6d46ed811..a9664dfb6 100644 --- a/src/PluginUtils/_Tool.py +++ b/src/PluginUtils/_Tool.py @@ -86,9 +86,13 @@ class Tool: """ def __init__(self, dbstate, options_class, name): + from PluginUtils import MenuToolOptions self.db = dbstate.db self.person = dbstate.active - if type(options_class) == ClassType: + if issubclass(options_class, MenuToolOptions): + # FIXME: pass in person_id + self.options = options_class(name, None, dbstate) + elif type(options_class) == ClassType: self.options = options_class(name) elif type(options_class) == InstanceType: self.options = options_class diff --git a/src/PluginUtils/__init__.py b/src/PluginUtils/__init__.py index 52515aa74..dcae67e4c 100644 --- a/src/PluginUtils/__init__.py +++ b/src/PluginUtils/__init__.py @@ -58,8 +58,8 @@ class MenuToolOptions(MenuOptions,Tool.ToolOptions): add_menu_options function. The user can add options to the menu and the MenuToolOptions class will worry about setting up the GUI. """ - def __init__(self,name,person_id=None): + def __init__(self, name, person_id=None, dbstate=None): Tool.ToolOptions.__init__(self,name, person_id) - MenuOptions.__init__(self,None) + MenuOptions.__init__(self, dbstate) diff --git a/src/plugins/CalculateEstimatedDates.py b/src/plugins/CalculateEstimatedDates.py index 59948d22e..9701fea33 100644 --- a/src/plugins/CalculateEstimatedDates.py +++ b/src/plugins/CalculateEstimatedDates.py @@ -55,7 +55,7 @@ class CalcEstDateOptions(MenuToolOptions): """ Adds the options """ category_name = _("Options") - filter = PersonFilterOption(_("Filter"), dbstate, 3) + filter = PersonFilterOption(_("Filter"), dbstate, 0, False) filter.set_help(_("Select filter to restrict people")) menu.add_option(category_name,"filter", filter)