Make sure new filters are found and sorting is applied when filters used in place report

svn: r11010
This commit is contained in:
Gary Burton 2008-09-02 19:48:38 +00:00
parent 10dd3278df
commit 534256792a

View File

@ -35,7 +35,6 @@ from gettext import gettext as _
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from PluginUtils import PluginManager, PlaceListOption, FilterOption from PluginUtils import PluginManager, PlaceListOption, FilterOption
from Filters import CustomFilters, GenericFilter
from ReportBase import Report, MenuReportOptions, \ from ReportBase import Report, MenuReportOptions, \
CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI CATEGORY_TEXT, MODE_GUI, MODE_BKI, MODE_CLI
import BaseDoc import BaseDoc
@ -80,6 +79,8 @@ class PlaceReport(Report):
# Use the place handles selected without a filter # Use the place handles selected without a filter
self.place_handles = self.__get_place_handles(places) self.place_handles = self.__get_place_handles(places)
self.place_handles.sort(self.sort.by_place_title)
def write_report(self): def write_report(self):
""" """
The routine the actually creates the report. At this point, the document The routine the actually creates the report. At this point, the document
@ -225,7 +226,7 @@ class PlaceReport(Report):
for place_gid in places.split(): for place_gid in places.split():
place = self.database.get_place_from_gramps_id(place_gid) place = self.database.get_place_from_gramps_id(place_gid)
place_handles.append(place.get_handle()) place_handles.append(place.get_handle())
place_handles.sort(self.sort.by_place_title)
return place_handles return place_handles
#------------------------------------------------------------------------ #------------------------------------------------------------------------
@ -248,6 +249,10 @@ class PlaceOptions(MenuReportOptions):
""" """
category_name = _("Report Options") category_name = _("Report Options")
# Reload filters to pick any new ones
CustomFilters = None
from Filters import CustomFilters, GenericFilter
opt = FilterOption(_("Select using filter"), 0) opt = FilterOption(_("Select using filter"), 0)
opt.set_help(_("Select places using a filter")) opt.set_help(_("Select places using a filter"))
filter_list = [] filter_list = []