2
# Gramps - a GTK+/GNOME based genealogy program
4
# Copyright (C) 2004-2007 Donald N. Allingham
5
# Copyright (C) 2008 Gary Burton
6
# Copyright (C) 2010 Jakim Friant
8
# This program is free software; you can redistribute it and/or modify
9
# it under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 2 of the License, or
11
# (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
18
# You should have received a copy of the GNU General Public License
19
# along with this program; if not, write to the Free Software
20
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
# $Id: _options.py 15332 2010-05-06 03:40:30Z pez4brian $
24
# Written by Alex Roitman
27
Report option handling, including saving and parsing.
29
from gen.plug.report._options import ReportOptions
30
from gui.plug import GuiMenuOptions
32
#-------------------------------------------------------------------------
36
#-------------------------------------------------------------------------
37
class MenuReportOptions(GuiMenuOptions, ReportOptions):
40
The MenuReportOptions class implements the ReportOptions
41
functionality in a generic way so that the user does not need to
42
be concerned with the graphical representation of the options.
44
The user should inherit the MenuReportOptions class and override the
45
add_menu_options function. The user can add options to the menu and the
46
MenuReportOptions class will worry about setting up the GUI.
49
def __init__(self, name, dbase):
50
ReportOptions.__init__(self, name, dbase)
51
GuiMenuOptions.__init__(self)
53
def load_previous_values(self):
54
ReportOptions.load_previous_values(self)
55
# Pass the loaded values to the menu options so they will be displayed
57
for optname in self.options_dict:
58
menu_option = self.menu.get_option_by_name(optname)
60
menu_option.set_value(self.options_dict[optname])