From bb2350ce9a527fe813f31861c594c95edb6b083e Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 26 Sep 2007 07:39:09 +0000 Subject: [PATCH] 2007-09-26 Benny Malengier * src/Selectors/_SelectNote.py:a note selector for the reports * src/Selectors/Makefile.am: add selectNote * po/POTFILES.in: add selectNote svn: r9009 --- ChangeLog | 5 +++ po/POTFILES.in | 1 + src/Selectors/Makefile.am | 1 + src/Selectors/_SelectNote.py | 85 ++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 src/Selectors/_SelectNote.py diff --git a/ChangeLog b/ChangeLog index 9932d4f24..8a79e8141 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-09-26 Benny Malengier + * src/Selectors/_SelectNote.py:a note selector for the reports + * src/Selectors/Makefile.am: add selectNote + * po/POTFILES.in: add selectNote + 2007-09-26 Benny Malengier * src/Selectors/_BaseSelector.py: add column sorting * src/Selectors/_SelectEvent.py:remove whitespace diff --git a/po/POTFILES.in b/po/POTFILES.in index 3a285e7fc..033908c6d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -274,6 +274,7 @@ src/Mime/_PythonMime.py src/Selectors/_BaseSelector.py src/Selectors/_SelectEvent.py src/Selectors/_SelectFamily.py +src/Selectors/_SelectNote.py src/Selectors/_SelectObject.py src/Selectors/_SelectPerson.py src/Selectors/_SelectPlace.py diff --git a/src/Selectors/Makefile.am b/src/Selectors/Makefile.am index ae90c7e81..df178b4e9 100644 --- a/src/Selectors/Makefile.am +++ b/src/Selectors/Makefile.am @@ -10,6 +10,7 @@ pkgdata_PYTHON = \ _BaseSelector.py \ _SelectEvent.py \ _SelectFamily.py \ + _SelectNote.py \ _SelectObject.py \ _SelectPerson.py \ _SelectRepository.py \ diff --git a/src/Selectors/_SelectNote.py b/src/Selectors/_SelectNote.py new file mode 100644 index 000000000..6e200161c --- /dev/null +++ b/src/Selectors/_SelectNote.py @@ -0,0 +1,85 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2003-2006 Donald N. Allingham +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +# $Id: _SelectNote.py $ + +"""Handling of selection dialog for selecting notes +""" + +__author__ = "Benny Malengier" +__revision__ = "$Revision$" + +#------------------------------------------------------------------------- +# +# Python Modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS Modules +# +#------------------------------------------------------------------------- +from DisplayModels import NoteModel +from _BaseSelector import BaseSelector + +#------------------------------------------------------------------------- +# +# SelectNote +# +#------------------------------------------------------------------------- +class SelectNote(BaseSelector): + """ Class that handles the selection of a note + """ + + def get_window_title(self): + return _("Select General Note") + + def get_model_class(self): + return NoteModel + + def get_column_titles(self): + return [ + (_('ID'), 75, BaseSelector.TEXT), + (_('Type'), 0, BaseSelector.NONE), + (_('Marker'), 0, BaseSelector.NONE), + (_('Preview'), 350, BaseSelector.TEXT) + ] + + def get_from_handle_func(self): + return self.db.get_note_from_handle + + def get_handle_column(self): + return 4 + + def column_order(self): + """ + returns a tuple indicating the column order + """ + return self.db.get_note_column_order() + + def column_view_names(self): + """ + Get correct column view names on which model is based + """ + import DataViews + return DataViews.NoteView.COLUMN_NAMES + \ No newline at end of file