diff --git a/src/Filters/Rules/Event/_HasGallery.py b/src/Filters/Rules/Event/_HasGallery.py new file mode 100755 index 000000000..5bd040460 --- /dev/null +++ b/src/Filters/Rules/Event/_HasGallery.py @@ -0,0 +1,44 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2008 Brian G. Matherly +# Copyright (C) 2008 Jerome Rapinat +# Copyright (C) 2008 Benny Malengier +# +# 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 +# + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasGalleryBase import HasGalleryBase + +#------------------------------------------------------------------------- +# "Events who have images" +#------------------------------------------------------------------------- +class HasGallery(HasGalleryBase): + """Rule that checks for events who have Media object reference""" + + name = _('Event with images') + description = _("Matches event with image in the gallery") diff --git a/src/Filters/Rules/Event/__init__.py b/src/Filters/Rules/Event/__init__.py index 0b7160820..b232f87e0 100644 --- a/src/Filters/Rules/Event/__init__.py +++ b/src/Filters/Rules/Event/__init__.py @@ -2,7 +2,7 @@ # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham -# Copyright (C) 2007 Brian G. Matherly +# Copyright (C) 2007-2008 Brian G. Matherly # # 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 @@ -30,6 +30,7 @@ from Filters.Rules._HasEventBase import HasEventBase as HasEvent from _HasType import HasType from _HasMarkerOf import HasMarkerOf from _AllEvents import AllEvents +from _HasGallery import HasGallery from _HasIdOf import HasIdOf from _RegExpIdOf import RegExpIdOf from _HasNoteRegexp import HasNoteRegexp @@ -46,7 +47,8 @@ editor_rule_list = [ AllEvents, HasType, HasIdOf, -# TODO: At the time of this writing, the GRAMPS UI does not allow setting markers for events. + HasGallery +# TODO: At the time of this writing, the GRAMPS UI does not allow setting markers for events. 1197 bug-report # HasMarkerOf, RegExpIdOf, HasNoteRegexp, diff --git a/src/Filters/Rules/Family/__init__.py b/src/Filters/Rules/Family/__init__.py index c523246b7..227c76981 100644 --- a/src/Filters/Rules/Family/__init__.py +++ b/src/Filters/Rules/Family/__init__.py @@ -57,7 +57,7 @@ from _ChildHasIdOf import ChildHasIdOf editor_rule_list = [ AllFamilies, HasRelType, - HasGallery + HasGallery, HasIdOf, HasLDS, RegExpIdOf, diff --git a/src/Filters/Rules/Place/_HasGallery.py b/src/Filters/Rules/Place/_HasGallery.py new file mode 100755 index 000000000..de79f6372 --- /dev/null +++ b/src/Filters/Rules/Place/_HasGallery.py @@ -0,0 +1,44 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2008 Brian G. Matherly +# Copyright (C) 2008 Jerome Rapinat +# Copyright (C) 2008 Benny Malengier +# +# 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 +# + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasGalleryBase import HasGalleryBase + +#------------------------------------------------------------------------- +# "Places who have images" +#------------------------------------------------------------------------- +class HasGallery(HasGalleryBase): + """Rule that checks for places who have Media object reference""" + + name = _('Place with images') + description = _("Matches place with image in the gallery") diff --git a/src/Filters/Rules/Place/__init__.py b/src/Filters/Rules/Place/__init__.py index 944dbf2fc..564cfd2ae 100644 --- a/src/Filters/Rules/Place/__init__.py +++ b/src/Filters/Rules/Place/__init__.py @@ -1,7 +1,8 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2002-2006 Donald N. Allingham +# Copyright (C) 2002-2007 Donald N. Allingham +# Copyright (C) 2007-2008 Brian G. Matherly # # 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 @@ -25,6 +26,7 @@ Package providing filter rules for GRAMPS. """ from _AllPlaces import AllPlaces +from _HasGallery import HasGallery from _HasIdOf import HasIdOf from _RegExpIdOf import RegExpIdOf from _HasNoteRegexp import HasNoteRegexp @@ -39,6 +41,7 @@ from _MatchesEventFilter import MatchesEventFilter editor_rule_list = [ AllPlaces, + HasGallery, HasIdOf, RegExpIdOf, HasNoteRegexp, diff --git a/src/Filters/Rules/Source/_HasGallery.py b/src/Filters/Rules/Source/_HasGallery.py new file mode 100755 index 000000000..d72a0a502 --- /dev/null +++ b/src/Filters/Rules/Source/_HasGallery.py @@ -0,0 +1,44 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2008 Brian G. Matherly +# Copyright (C) 2008 Jerome Rapinat +# Copyright (C) 2008 Benny Malengier +# +# 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 +# + +#------------------------------------------------------------------------- +# +# Standard Python modules +# +#------------------------------------------------------------------------- +from gettext import gettext as _ + +#------------------------------------------------------------------------- +# +# GRAMPS modules +# +#------------------------------------------------------------------------- +from Filters.Rules._HasGalleryBase import HasGalleryBase + +#------------------------------------------------------------------------- +# "Sources who have images" +#------------------------------------------------------------------------- +class HasGallery(HasGalleryBase): + """Rule that checks for sources who have Media object reference""" + + name = _('Source with images') + description = _("Matches source with image in the gallery") diff --git a/src/Filters/Rules/Source/__init__.py b/src/Filters/Rules/Source/__init__.py index 2d8b609d3..bb2071eb0 100644 --- a/src/Filters/Rules/Source/__init__.py +++ b/src/Filters/Rules/Source/__init__.py @@ -1,7 +1,8 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2002-2006 Donald N. Allingham +# Copyright (C) 2002-2007 Donald N. Allingham +# Copyright (C) 2007-2008 Brian G. Matherly # # 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 @@ -25,6 +26,7 @@ Package providing filter rules for GRAMPS. """ from _AllSources import AllSources +from _HasGallery import HasGallery from _HasIdOf import HasIdOf from _RegExpIdOf import RegExpIdOf from _HasNoteRegexp import HasNoteRegexp @@ -36,6 +38,7 @@ from _HasSource import HasSource editor_rule_list = [ AllSources, + HasGallery, HasIdOf, RegExpIdOf, HasNoteRegexp,