Properly initialize Filter option.
svn: r9525
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 | 
			
		||||
#-------------------------------------------------------------------------
 | 
			
		||||
#
 | 
			
		||||
 
 | 
			
		||||
@@ -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):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user