2008-01-15 Douglas S. Blank <dblank@cs.brynmawr.edu>

* 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
	


svn: r9830
This commit is contained in:
Doug Blank 2008-01-15 21:08:32 +00:00
parent 646ad2a772
commit e304069be8
4 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2008-01-15 Douglas S. Blank <dblank@cs.brynmawr.edu>
* 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 <benny.malengier@gramps-project.org>
* src/GrampsDbUtils/_GrampsDbWriteXML.py: import gzip

View File

@ -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

View File

@ -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)

View File

@ -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)