~ubuntu-branches/ubuntu/utopic/gramps/utopic

« back to all changes in this revision

Viewing changes to src/gui/plug/report/_options.py

  • Committer: Package Import Robot
  • Author(s): James A. Treacy
  • Date: 2012-05-22 17:18:36 UTC
  • mfrom: (39.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20120522171836-35fi62lp4w7jnrd7
Tags: 3.4.0-1
* New upstream version
* Updated desktop file. Closes: #667472

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#
2
 
# Gramps - a GTK+/GNOME based genealogy program
3
 
#
4
 
# Copyright (C) 2004-2007  Donald N. Allingham
5
 
# Copyright (C) 2008       Gary Burton
6
 
# Copyright (C) 2010       Jakim Friant
7
 
#
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.
12
 
#
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.
17
 
#
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
21
 
#
22
 
# $Id: _options.py 15332 2010-05-06 03:40:30Z pez4brian $
23
 
 
24
 
# Written by Alex Roitman
25
 
 
26
 
"""
27
 
Report option handling, including saving and parsing.
28
 
"""
29
 
from gen.plug.report._options import ReportOptions
30
 
from gui.plug import GuiMenuOptions
31
 
 
32
 
#-------------------------------------------------------------------------
33
 
#
34
 
# MenuReportOptions
35
 
#
36
 
#-------------------------------------------------------------------------
37
 
class MenuReportOptions(GuiMenuOptions, ReportOptions):
38
 
    """
39
 
 
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.
43
 
 
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.
47
 
 
48
 
    """
49
 
    def __init__(self, name, dbase):
50
 
        ReportOptions.__init__(self, name, dbase)
51
 
        GuiMenuOptions.__init__(self)
52
 
 
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
56
 
        # properly.
57
 
        for optname in self.options_dict:
58
 
            menu_option = self.menu.get_option_by_name(optname)
59
 
            if menu_option:
60
 
                menu_option.set_value(self.options_dict[optname])
61