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> 2007-12-16 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/ReportBase/_PaperMenu.py: get margins in PaperFrame constructor * src/ReportBase/_PaperMenu.py: get margins in PaperFrame constructor
* src/ReportBase/_DocReportDialog.py: pass margins to PaperFrame constructor * src/ReportBase/_DocReportDialog.py: pass margins to PaperFrame constructor

View File

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

View File

@ -142,8 +142,11 @@ class Calendar(Report):
self.text1 = options_class.handler.options_dict['text1'] self.text1 = options_class.handler.options_dict['text1']
self.text2 = options_class.handler.options_dict['text2'] self.text2 = options_class.handler.options_dict['text2']
self.text3 = options_class.handler.options_dict['text3'] 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') 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 self.title = _("Calendar Report") #% name
def get_name(self, person, maiden_name = None): def get_name(self, person, maiden_name = None):