Properly initialize Filter option.

svn: r9525
This commit is contained in:
Brian Matherly 2007-12-17 04:12:01 +00:00
parent c3471430b0
commit f5393d7d3a
3 changed files with 13 additions and 10 deletions

View File

@ -1,3 +1,7 @@
2007-12-16 Brian Matherly <brian@gramps-project.org>
* src/plugins/Calendar.py: Properly initialize Filter option.
* src/PluginUtils/_MenuOptions.py: Properly initialize Filter option.
2007-12-16 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/ReportBase/_PaperMenu.py: get margins in PaperFrame constructor
* src/ReportBase/_DocReportDialog.py: pass margins to PaperFrame constructor

View File

@ -393,7 +393,7 @@ class FilterListOption(Option):
@type label: string
@return: nothing
"""
Option.__init__(self,label,"")
Option.__init__(self,label,0)
self.__items = []
self.__filters = []
@ -459,8 +459,7 @@ class FilterListOption(Option):
for filter in filter_list:
self.combo.append_text(filter.get_name())
self.add_filter(filter)
# FIXME: set proper default
self.combo.set_active(0)
self.combo.set_active(self.get_value())
self.change_button = gtk.Button("%s..." % _('C_hange') )
self.change_button.connect('clicked',self.on_change_clicked)
self.gobj.pack_start(self.combo, False)
@ -493,17 +492,14 @@ class FilterListOption(Option):
for filter in filter_list:
self.combo.append_text(filter.get_name())
self.add_filter(filter)
# FIXME: set proper default
self.combo.set_active(0)
self.combo.set_active(self.get_value())
def parse(self):
"""
Parse the object and return.
"""
index = self.combo.get_active()
items = self.get_filters()
filter = items[index]
return filter
self.__value = int(self.combo.get_active())
return self.__value
#-------------------------------------------------------------------------
#

View File

@ -142,8 +142,11 @@ class Calendar(Report):
self.text1 = options_class.handler.options_dict['text1']
self.text2 = options_class.handler.options_dict['text2']
self.text3 = options_class.handler.options_dict['text3']
self.filter = options_class.handler.options_dict['filter']
self.filter_option = options_class.menu.get_option_by_name('filter')
filter_index = int(self.filter_option.get_value())
filters = self.filter_option.get_filters()
self.filter = filters[filter_index]
self.title = _("Calendar Report") #% name
def get_name(self, person, maiden_name = None):