1#
2# Gramps - a GTK+/GNOME based genealogy program
3#
4# Copyright (C) 2003-2006  Donald N. Allingham
5#               2009       Gary Burton
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20#
21
22#-------------------------------------------------------------------------
23#
24# internationalization
25#
26#-------------------------------------------------------------------------
27
28#-------------------------------------------------------------------------
29#
30# gramps modules
31#
32#-------------------------------------------------------------------------
33from gramps.gen.const import GRAMPS_LOCALE as glocale
34_ = glocale.translation.sgettext
35from ..views.treemodels import FamilyModel
36from .baseselector import BaseSelector
37from gramps.gen.const import URL_MANUAL_PAGE
38
39#-------------------------------------------------------------------------
40#
41# Constants
42#
43#-------------------------------------------------------------------------
44
45#-------------------------------------------------------------------------
46#
47# SelectFamily
48#
49#-------------------------------------------------------------------------
50class SelectFamily(BaseSelector):
51
52    def _local_init(self):
53        """
54        Perform local initialisation for this class
55        """
56        self.setup_configs('interface.family-sel', 600, 450)
57
58    def get_window_title(self):
59        return _("Select Family")
60
61    def get_model_class(self):
62        return FamilyModel
63
64    def get_column_titles(self):
65        return [
66            (_('ID'),      75, BaseSelector.TEXT, 0),
67            (_('Father'), 200, BaseSelector.TEXT, 1),
68            (_('Mother'), 200, BaseSelector.TEXT, 2),
69            (_('Last Change'), 150, BaseSelector.TEXT, 7),
70            ]
71
72    def get_from_handle_func(self):
73        return self.db.get_family_from_handle
74
75    WIKI_HELP_PAGE = '%s_-_Categories' % URL_MANUAL_PAGE
76    WIKI_HELP_SEC = _('manual|Select_Family_selector')
77