2007-12-05 Douglas S.Blank <dblank@cs.brynmawr.edu>
* src/plugins/CalculateEstimatedDates.py: set quality CALCULATED on added dates * src/PluginUtils/_PluginWindows.py: buttons are now Close and Apply * src/PluginUtils/_MenuOptions.py: 2 bugs: xml load; help/dict typo svn: r9447
This commit is contained in:
parent
c630199892
commit
69fff5654a
@ -1,3 +1,9 @@
|
|||||||
|
2007-12-05 Douglas S.Blank <dblank@cs.brynmawr.edu>
|
||||||
|
* src/plugins/CalculateEstimatedDates.py: set quality CALCULATED on
|
||||||
|
added dates
|
||||||
|
* src/PluginUtils/_PluginWindows.py: buttons are now Close and Apply
|
||||||
|
* src/PluginUtils/_MenuOptions.py: 2 bugs: xml load; help/dict typo
|
||||||
|
|
||||||
2007-12-05 Jim Sack <jgsack@san.rr.com>
|
2007-12-05 Jim Sack <jgsack@san.rr.com>
|
||||||
* src/GrampsDbUtils/_WriteGedcom.py : add omitted () to function call
|
* src/GrampsDbUtils/_WriteGedcom.py : add omitted () to function call
|
||||||
fixes type error 'instancemethod' object is not iterable
|
fixes type error 'instancemethod' object is not iterable
|
||||||
|
@ -575,13 +575,14 @@ class MenuOptions:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def set_new_options(self):
|
def set_new_options(self):
|
||||||
|
# Fill options_dict with report/tool defaults:
|
||||||
self.options_dict = {}
|
self.options_dict = {}
|
||||||
self.options_help = {}
|
self.options_help = {}
|
||||||
self.add_menu_options(self.menu)
|
self.add_menu_options(self.menu)
|
||||||
for name in self.menu.get_all_option_names():
|
for name in self.menu.get_all_option_names():
|
||||||
option = self.menu.get_option_by_name(name)
|
option = self.menu.get_option_by_name(name)
|
||||||
self.options_dict[name] = option.get_value()
|
self.options_dict[name] = option.get_value()
|
||||||
self.options_dict[name] = option.get_help()
|
self.options_help[name] = option.get_help()
|
||||||
|
|
||||||
def add_menu_options(self,menu):
|
def add_menu_options(self,menu):
|
||||||
"""
|
"""
|
||||||
@ -602,6 +603,9 @@ class MenuOptions:
|
|||||||
for category in self.menu.get_categories():
|
for category in self.menu.get_categories():
|
||||||
for name in self.menu.get_option_names(category):
|
for name in self.menu.get_option_names(category):
|
||||||
option = self.menu.get_option(category,name)
|
option = self.menu.get_option(category,name)
|
||||||
|
# override option default with xml-saved value:
|
||||||
|
if name in self.options_dict:
|
||||||
|
option.set_value(self.options_dict[name])
|
||||||
option.make_gui_obj(gtk, dialog)
|
option.make_gui_obj(gtk, dialog)
|
||||||
option.add_dialog_category(dialog, category)
|
option.add_dialog_category(dialog, category)
|
||||||
option.add_tooltip(self.tooltips)
|
option.add_tooltip(self.tooltips)
|
||||||
|
@ -181,10 +181,11 @@ class ToolManagedWindowBase(ManagedWindow.ManagedWindow):
|
|||||||
self.window.set_has_separator(False)
|
self.window.set_has_separator(False)
|
||||||
|
|
||||||
#self.window.connect('response', self.close)
|
#self.window.connect('response', self.close)
|
||||||
self.cancel = self.window.add_button(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL)
|
self.cancel = self.window.add_button(gtk.STOCK_CLOSE,
|
||||||
|
gtk.RESPONSE_CANCEL)
|
||||||
self.cancel.connect('clicked',self.close)
|
self.cancel.connect('clicked',self.close)
|
||||||
|
|
||||||
self.ok = self.window.add_button(gtk.STOCK_OK,gtk.RESPONSE_OK)
|
self.ok = self.window.add_button(gtk.STOCK_APPLY, gtk.RESPONSE_OK)
|
||||||
self.ok.connect('clicked',self.on_ok_clicked)
|
self.ok.connect('clicked',self.on_ok_clicked)
|
||||||
|
|
||||||
self.window.set_default_size(600,-1)
|
self.window.set_default_size(600,-1)
|
||||||
@ -226,8 +227,10 @@ class ToolManagedWindowBase(ManagedWindow.ManagedWindow):
|
|||||||
pass # cancel just closes
|
pass # cancel just closes
|
||||||
|
|
||||||
def on_ok_clicked(self, obj):
|
def on_ok_clicked(self, obj):
|
||||||
"""The user is satisfied with the dialog choices. Parse all options
|
"""
|
||||||
and close the window."""
|
The user is satisfied with the dialog choices. Parse all options
|
||||||
|
and run the tool.
|
||||||
|
"""
|
||||||
# Save options
|
# Save options
|
||||||
self.options.parse_user_options(self)
|
self.options.parse_user_options(self)
|
||||||
self.options.handler.save_options()
|
self.options.handler.save_options()
|
||||||
@ -419,9 +422,11 @@ class ToolManagedWindowBase(ManagedWindow.ManagedWindow):
|
|||||||
|
|
||||||
class ToolManagedWindowBatch(Tool.BatchTool, ToolManagedWindowBase):
|
class ToolManagedWindowBatch(Tool.BatchTool, ToolManagedWindowBase):
|
||||||
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
||||||
|
# This constructor will ask a question, set self.fail:
|
||||||
Tool.BatchTool.__init__(self,dbstate,options_class,name)
|
Tool.BatchTool.__init__(self,dbstate,options_class,name)
|
||||||
ToolManagedWindowBase.__init__(self, dbstate, uistate, options_class,
|
if not self.fail:
|
||||||
name, callback)
|
ToolManagedWindowBase.__init__(self, dbstate, uistate,
|
||||||
|
options_class, name, callback)
|
||||||
|
|
||||||
class ToolManagedWindow(Tool.Tool, ToolManagedWindowBase):
|
class ToolManagedWindow(Tool.Tool, ToolManagedWindowBase):
|
||||||
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
def __init__(self, dbstate, uistate, options_class, name, callback=None):
|
||||||
|
@ -222,6 +222,7 @@ class CalcToolManagedWindow(PluginWindows.ToolManagedWindowBatch):
|
|||||||
event.set_type(gen.lib.EventType(type))
|
event.set_type(gen.lib.EventType(type))
|
||||||
if date:
|
if date:
|
||||||
date.set_modifier(gen.lib.Date.MOD_ABOUT)
|
date.set_modifier(gen.lib.Date.MOD_ABOUT)
|
||||||
|
date.set_quality(gen.lib.Date.QUAL_ESTIMATED)
|
||||||
date.set_yr_mon_day(date.get_year(), 0, 0)
|
date.set_yr_mon_day(date.get_year(), 0, 0)
|
||||||
event.set_date_object(date)
|
event.set_date_object(date)
|
||||||
if source:
|
if source:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user