diff --git a/ChangeLog b/ChangeLog index e3503d73b..369c63a46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-05-31 Don Allingham + * src/DataViews/_PersonView.py: call FilterEditor + * src/FilterEditor/__init__.py: added + * src/FilterEditor/_FilterEditor.py: moved from plugins + * src/glade/rule.glade: filter editor changes + * src/Makefile.am: change subdirs + * src/FilterEditor/Makefile.am: added + 2006-05-31 Alex Roitman * src/PluginUtils/_PluginMgr.py: Import MODE_CLI. * src/ReportBase/_BookFormatComboBox.py: Adapt to changes. diff --git a/src/DataViews/_PersonView.py b/src/DataViews/_PersonView.py index 252f8685e..51fb417f0 100644 --- a/src/DataViews/_PersonView.py +++ b/src/DataViews/_PersonView.py @@ -136,6 +136,9 @@ class PersonView(PageView.PersonNavView): self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, _('_Column Editor'), callback=self.column_editor,) + self.add_action('FilterEdit', None, + _('Filter Editor'), callback=self.filter_editor,) + self.add_action('CmpMerge', None, _('_Compare and merge'), callback=self.cmp_merge) self.add_action('FastMerge', None, _('_Fast merge'), @@ -199,6 +202,14 @@ class PersonView(PageView.PersonNavView): column_names, self.set_column_order) + def filter_editor(self,obj): + from FilterEditor import FilterEditor + + FilterEditor( + const.custom_filters, + self.dbstate.db, + self.uistate) + def set_column_order(self, column_list): self.dbstate.db.set_person_column_order(column_list) self.build_columns() @@ -307,6 +318,7 @@ class PersonView(PageView.PersonNavView): + diff --git a/src/plugins/FilterEditor.py b/src/FilterEditor/FilterEditor.py similarity index 100% rename from src/plugins/FilterEditor.py rename to src/FilterEditor/FilterEditor.py diff --git a/src/FilterEditor/Makefile.am b/src/FilterEditor/Makefile.am new file mode 100644 index 000000000..66c530c7a --- /dev/null +++ b/src/FilterEditor/Makefile.am @@ -0,0 +1,19 @@ +# This is the src/DisplayTabs level Makefile for Gramps + +pkgdatadir = $(datadir)/@PACKAGE@/FilterEditor + +pkgdata_PYTHON = \ + __init__.py \ + _FilterEditor.py + +pkgpyexecdir = @pkgpyexecdir@/FilterEditor +pkgpythondir = @pkgpythondir@/FilterEditor + +# Clean up all the byte-compiled files +MOSTLYCLEANFILES = *pyc *pyo + +GRAMPS_PY_MODPATH = "../" + +pycheck: + (export PYTHONPATH=$(GRAMPS_PY_MODPATH); \ + pychecker $(pkgdata_PYTHON)); diff --git a/src/FilterEditor/__init__.py b/src/FilterEditor/__init__.py new file mode 100644 index 000000000..6887e1491 --- /dev/null +++ b/src/FilterEditor/__init__.py @@ -0,0 +1,23 @@ +# +# Gramps - a GTK+/GNOME based genealogy program +# +# Copyright (C) 2000-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: FilterEditor.py 6835 2006-06-01 03:24:44Z dallingham $ + +from _FilterEditor import FilterEditor diff --git a/src/Makefile.am b/src/Makefile.am index 934d3cb0e..2b04808ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -6,6 +6,7 @@ SUBDIRS = \ DataViews \ Editors \ Filters \ + FilterEditor \ GrampsDb \ Merge \ DisplayTabs \ diff --git a/src/glade/rule.glade b/src/glade/rule.glade index 4976f7300..3c82fd9cd 100644 --- a/src/glade/rule.glade +++ b/src/glade/rule.glade @@ -9,6 +9,7 @@ GTK_WINDOW_TOPLEVEL GTK_WIN_POS_NONE False + 500 True False True @@ -16,6 +17,8 @@ False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_CENTER + True + False False @@ -100,6 +103,10 @@ 0.5 0 6 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -112,7 +119,7 @@ 12 True - 11 + 8 4 False 6 @@ -130,11 +137,21 @@ Add another rule to the filter True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -150,11 +167,21 @@ Edit the selected rule True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + gtk-edit + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -170,11 +197,21 @@ Delete the selected rule True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -200,7 +237,7 @@ True - <b>Rule options</b> + <b>Options</b> False True GTK_JUSTIFY_LEFT @@ -210,6 +247,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -234,6 +275,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -258,6 +303,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -283,6 +332,10 @@ 0 0 comment + PANGO_ELLIPSIZE_NONE + -1 + False + 0 1 @@ -310,6 +363,9 @@ False False True + False + False + False @@ -321,74 +377,6 @@ - - - True - True - All _rules must apply - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 1 - 3 - 6 - 7 - fill - - - - - - - True - True - At lea_st one rule must apply - True - GTK_RELIEF_NORMAL - True - False - False - True - logical_and - - - 1 - 3 - 7 - 8 - fill - - - - - - - True - True - E_xactly one rule must apply - True - GTK_RELIEF_NORMAL - True - False - False - True - logical_and - - - 1 - 3 - 8 - 9 - fill - - - - True @@ -403,13 +391,58 @@ 0 0 filter_name + PANGO_ELLIPSIZE_NONE + -1 + False + 0 1 2 1 2 - shrink|fill + fill + + + + + + + True + True + Return values that do no_t match the filter rules + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 1 + 4 + 7 + 8 + fill + + + + + + + True + All rules must apply +At least one rule must apply +Exactly one rule must apply + False + True + + + 1 + 3 + 6 + 7 + fill @@ -457,52 +490,6 @@ - - - - True - True - Return values that do no_t match the filter rules - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 3 - 10 - 11 - fill - - - - - - - True - <b>Filter inversion</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - - - 0 - 4 - 9 - 10 - fill - - - 0 @@ -536,6 +523,8 @@ False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_CENTER + True + False False @@ -608,6 +597,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -663,6 +656,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 5 @@ -694,6 +691,9 @@ False False True + False + False + False @@ -716,11 +716,21 @@ Add a new filter True True - _Add... - True GTK_RELIEF_NORMAL True + + + + True + gtk-add + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -736,11 +746,21 @@ Edit the selected filter True True - _Edit... - True GTK_RELIEF_NORMAL True + + + + True + gtk-edit + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -754,11 +774,21 @@ True Test the selected filter True - _Test... - True GTK_RELIEF_NORMAL True + + + + True + gtk-execute + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -774,11 +804,21 @@ Delete the selected filter True True - _Delete - True GTK_RELIEF_NORMAL True + + + + True + gtk-remove + 4 + 0.5 + 0.5 + 0 + 0 + + 0 @@ -818,6 +858,10 @@ 0.5 6 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -851,6 +895,8 @@ False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_CENTER + True + False False @@ -900,6 +946,10 @@ 0.5 0 6 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -959,6 +1009,8 @@ False GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_CENTER + True + False False @@ -1043,6 +1095,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 6 @@ -1076,6 +1132,9 @@ False False False + False + False + False @@ -1104,6 +1163,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1125,6 +1188,10 @@ 0.5 12 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 6 @@ -1146,6 +1213,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0 @@ -1167,6 +1238,10 @@ 0 12 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 6 @@ -1188,6 +1263,10 @@ 0.5 0 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 0