4011: "reports" should have a "no private information" button

This commit is contained in:
Paul Franklin 2014-07-26 09:52:31 -07:00
parent 06b063a5d5
commit 7f8b3e538c

View File

@ -48,6 +48,7 @@ from gramps.gen.plug.docgen import (IndexMark, FontStyle, ParagraphStyle,
from gramps.gen.sort import Sort from gramps.gen.sort import Sort
from gramps.gen.utils.location import get_main_location from gramps.gen.utils.location import get_main_location
from gramps.gen.lib import PlaceType from gramps.gen.lib import PlaceType
from gramps.gen.errors import ReportError
class PlaceReport(Report): class PlaceReport(Report):
""" """
@ -77,6 +78,9 @@ class PlaceReport(Report):
self._user = user self._user = user
menu = options.menu menu = options.menu
stdoptions.run_private_data_option(self, menu)
places = menu.get_option_by_name('places').get_value() places = menu.get_option_by_name('places').get_value()
self.center = menu.get_option_by_name('center').get_value() self.center = menu.get_option_by_name('center').get_value()
@ -85,10 +89,9 @@ class PlaceReport(Report):
stdoptions.run_name_format_option(self, menu) stdoptions.run_name_format_option(self, menu)
self._nd = self._name_display self._nd = self._name_display
stdoptions.run_private_data_option(self, menu)
filter_option = menu.get_option_by_name('filter') filter_option = menu.get_option_by_name('filter')
self.filter = filter_option.get_filter() self.filter = filter_option.get_filter()
self.sort = Sort(self.database) self.sort = Sort(self.database)
if self.filter.get_name() != '': if self.filter.get_name() != '':
@ -99,6 +102,10 @@ 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)
if not self.place_handles:
raise ReportError(_('Place Report'),
_('Please select at least one place before running this.'))
self.place_handles.sort(key=self.sort.by_place_title_key) self.place_handles.sort(key=self.sort.by_place_title_key)
def write_report(self): def write_report(self):