diff --git a/ChangeLog b/ChangeLog index d04ac1fbd..4afa96843 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-04-27 Don Allingham + * src/DbPrompter.py: remove unused functions + * src/DisplayModels.py: filtering support + * src/GenericFilter.py: filtering support + * src/PeopleModel.py: support for filtering + * src/PeopleView.py: support for filtering + * src/RelLib.py: filtering support + * src/Utils.py: filtering support + * src/gramps.glade: remove invert for filters + * src/gramps_main.py: filtering support + 2004-04-25 Alex Roitman * src/plugins/IndivComplete.py: Convert to db interface. * src/plugins/DescendReport.py: Convert to db interface. diff --git a/Makefile.in b/Makefile.in index 1c319441e..2aee6afc1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -109,7 +109,10 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_LIBS = @PYGTK_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/aclocal.m4 b/aclocal.m4 index 36d5bcafb..a00e81ef2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -11,6 +11,64 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. + +dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) +dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page +dnl also defines GSTUFF_PKG_ERRORS on error +AC_DEFUN(PKG_CHECK_MODULES, [ + succeeded=no + + if test -z "$PKG_CONFIG"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + fi + + if test "$PKG_CONFIG" = "no" ; then + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + AC_MSG_CHECKING(for $2) + + if $PKG_CONFIG --exists "$2" ; then + AC_MSG_RESULT(yes) + succeeded=yes + + AC_MSG_CHECKING($1_CFLAGS) + $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` + AC_MSG_RESULT($$1_CFLAGS) + + AC_MSG_CHECKING($1_LIBS) + $1_LIBS=`$PKG_CONFIG --libs "$2"` + AC_MSG_RESULT($$1_LIBS) + else + $1_CFLAGS="" + $1_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + ifelse([$4], ,echo $$1_PKG_ERRORS,) + fi + + AC_SUBST($1_CFLAGS) + AC_SUBST($1_LIBS) + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + ifelse([$3], , :, [$3]) + else + ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) + fi +]) + + + # -*- Autoconf -*- # Copyright (C) 2002, 2003 Free Software Foundation, Inc. # Generated from amversion.in; do not edit by hand. diff --git a/configure b/configure index aab9c1f48..c75d9927a 100755 --- a/configure +++ b/configure @@ -274,7 +274,7 @@ PACKAGE_STRING='gramps 1.1.0' PACKAGE_BUGREPORT='gramps-bugs@lists.sourceforge.net' ac_unique_file="src/gramps.py" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot RELEASE VERSIONSTRING MSGFMT MSGCONV ICONV LANGUAGES POFILES MOFILES PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir BINSH SK_CONFIG SCROLLKEEPER_BUILD_REQUIRED GNOMEHELP GPREFIX LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot RELEASE VERSIONSTRING MSGFMT MSGCONV ICONV LANGUAGES POFILES MOFILES PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir BINSH PKG_CONFIG PYGTK_CFLAGS PYGTK_LIBS SK_CONFIG SCROLLKEEPER_BUILD_REQUIRED GNOMEHELP GPREFIX LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -2042,31 +2042,103 @@ def out(str): " -echo "$as_me:$LINENO: checking Python bindings for gtk" >&5 -echo $ECHO_N "checking Python bindings for gtk... $ECHO_C" >&6 -cat > conftest.py <&5 -echo "$as_me: error: + if test -z "$PKG_CONFIG"; then + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -**** The python bindings for gtk 2.0 (pygtk2) could not be found." >&2;} - { (exit 1); exit 1; }; } + test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" + ;; +esac fi -echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + fi + + if test "$PKG_CONFIG" = "no" ; then + echo "*** The pkg-config script could not be found. Make sure it is" + echo "*** in your path, or set the PKG_CONFIG environment variable" + echo "*** to the full path to pkg-config." + echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." + else + PKG_CONFIG_MIN_VERSION=0.9.0 + if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then + echo "$as_me:$LINENO: checking for pygtk-2.0 >= 2.3.4" >&5 +echo $ECHO_N "checking for pygtk-2.0 >= 2.3.4... $ECHO_C" >&6 + + if $PKG_CONFIG --exists "pygtk-2.0 >= 2.3.4" ; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + succeeded=yes + + echo "$as_me:$LINENO: checking PYGTK_CFLAGS" >&5 +echo $ECHO_N "checking PYGTK_CFLAGS... $ECHO_C" >&6 + PYGTK_CFLAGS=`$PKG_CONFIG --cflags "pygtk-2.0 >= 2.3.4"` + echo "$as_me:$LINENO: result: $PYGTK_CFLAGS" >&5 +echo "${ECHO_T}$PYGTK_CFLAGS" >&6 + + echo "$as_me:$LINENO: checking PYGTK_LIBS" >&5 +echo $ECHO_N "checking PYGTK_LIBS... $ECHO_C" >&6 + PYGTK_LIBS=`$PKG_CONFIG --libs "pygtk-2.0 >= 2.3.4"` + echo "$as_me:$LINENO: result: $PYGTK_LIBS" >&5 +echo "${ECHO_T}$PYGTK_LIBS" >&6 + else + PYGTK_CFLAGS="" + PYGTK_LIBS="" + ## If we have a custom action on failure, don't print errors, but + ## do set a variable so people can do so. + PYGTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "pygtk-2.0 >= 2.3.4"` + echo $PYGTK_PKG_ERRORS + fi + + + + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + : + else + { { echo "$as_me:$LINENO: error: Library requirements (pygtk-2.0 >= 2.3.4) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (pygtk-2.0 >= 2.3.4) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } + fi + echo "$as_me:$LINENO: checking Python bindings for gnome" >&5 echo $ECHO_N "checking Python bindings for gnome... $ECHO_C" >&6 @@ -2962,6 +3034,9 @@ s,@pkgpythondir@,$pkgpythondir,;t t s,@pyexecdir@,$pyexecdir,;t t s,@pkgpyexecdir@,$pkgpyexecdir,;t t s,@BINSH@,$BINSH,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@PYGTK_CFLAGS@,$PYGTK_CFLAGS,;t t +s,@PYGTK_LIBS@,$PYGTK_LIBS,;t t s,@SK_CONFIG@,$SK_CONFIG,;t t s,@SCROLLKEEPER_BUILD_REQUIRED@,$SCROLLKEEPER_BUILD_REQUIRED,;t t s,@GNOMEHELP@,$GNOMEHELP,;t t diff --git a/configure.in b/configure.in index c82d04972..2d8361fa8 100644 --- a/configure.in +++ b/configure.in @@ -54,26 +54,7 @@ def out(str): " dnl Check if python bindings for gtk are installed - -AC_MSG_CHECKING(Python bindings for gtk) -cat > conftest.py <= 2.3.4) AC_MSG_CHECKING(Python bindings for gnome) cat > conftest.py < 0 + if len(self.top_iter2path) > 0: + return gtk.TRUE + else: + return gtk.FALSE if self.sname_sub.has_key(node) and len(self.sname_sub[node]) > 0: - return 1 - return 0 + return gtk.TRUE + return gtk.FALSE def on_iter_n_children(self,node): if node == None: @@ -178,6 +285,8 @@ class PeopleModel(gtk.GenericTreeModel): return 0 def on_iter_nth_child(self,node,n): + if node == None: + return self.top_path2iter.get(n) path = self.top_iter2path.get(node) if path: return self.path2iter.get((node,n)) @@ -233,4 +342,4 @@ class PeopleModel(gtk.GenericTreeModel): return self.db.find_place_from_id(place_id).get_title() return u"" -_GENDER = [ _('female'), _('male'), _('unknown') ] +_GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ] diff --git a/src/PeopleView.py b/src/PeopleView.py index a2f24a4c8..b05decb31 100644 --- a/src/PeopleView.py +++ b/src/PeopleView.py @@ -48,6 +48,7 @@ _sel_mode = gtk.SELECTION_SINGLE #------------------------------------------------------------------------- import PeopleModel import Filter +import GenericFilter import const column_names = [ @@ -70,7 +71,11 @@ class PeopleView: def __init__(self,parent): self.parent = parent - self.DataFilter = Filter.Filter("") + all = GenericFilter.GenericFilter() + all.set_name(_("Entire Database")) + all.add_rule(GenericFilter.Everyone([])) + + self.DataFilter = all self.pscroll = self.parent.gtop.get_widget("pscroll") self.person_tree = self.parent.gtop.get_widget("person_tree") self.person_tree.set_rules_hint(gtk.TRUE) @@ -78,18 +83,27 @@ class PeopleView: self.columns = [] self.build_columns() - self.build_tree() + self.person_selection = self.person_tree.get_selection() + self.person_selection.connect('changed',self.row_changed) + self.person_tree.connect('row_activated', self.alpha_event) + self.person_tree.connect('button-press-event',self.on_plist_button_press) + + def get_maps(self): + return (self.person_model.top_iter2path, + self.person_model.top_path2iter, + self.person_model.iter2path, + self.person_model.path2iter, + self.person_model.sname_sub) def build_columns(self): for column in self.columns: self.person_tree.remove_column(column) - column = gtk.TreeViewColumn(_('Name'), self.renderer,text=0) + column = gtk.TreeViewColumn(_('Name'), self.renderer,text=0,weight=9) column.set_resizable(gtk.TRUE) column.set_min_width(225) - if not const.nosort_tree: - column.set_clickable(gtk.TRUE) - column.set_sort_column_id(PeopleModel.COLUMN_NAME_SORT) + column.set_clickable(gtk.TRUE) + column.set_sort_column_id(PeopleModel.COLUMN_NAME_SORT) self.person_tree.append_column(column) self.columns = [column] @@ -108,20 +122,14 @@ class PeopleView: index += 1 def build_tree(self): - self.person_tree.set_model(None) self.person_model = PeopleModel.PeopleModel(self.parent.db) - - if const.nosort_tree: - self.sort_model = self.person_model + if gtk.pygtk_version >= (2,3,92): + self.sort_model = gtk.TreeModelSort(self.person_model).filter_new() else: self.sort_model = gtk.TreeModelSort(self.person_model) + self.sort_model.set_visible_column(PeopleModel.COLUMN_VIEW) self.person_tree.set_model(self.sort_model) - self.person_selection = self.person_tree.get_selection() - self.person_selection.connect('changed',self.row_changed) - self.person_tree.connect('row_activated', self.alpha_event) - self.person_tree.connect('button-press-event',self.on_plist_button_press) - def blist(self,store,path,iter,id_list): id_list.append(self.sort_model.get_value(iter,1)) @@ -146,20 +154,31 @@ class PeopleView: def change_db(self,db): self.build_columns() - self.build_tree() - + maps = db.get_people_view_maps() + self.person_model = PeopleModel.PeopleModel(db) + if not maps[0]: + self.build_tree() + if gtk.pygtk_version >= (2,3,92): + self.sort_model = gtk.TreeModelSort(self.person_model).filter_new() + else: + self.sort_model = gtk.TreeModelSort(self.person_model) + self.sort_model.set_visible_column(PeopleModel.COLUMN_VIEW) + self.person_tree.set_model(self.sort_model) + def clear(self): pass def remove_from_person_list(self,person,old_id=None): """Remove the selected person from the list. A person object is expected, not an ID""" - self.build_tree() + if old_id == None: + old_id = person.get_id() + path = self.person_model.on_get_path(old_id) + self.person_model.row_deleted(path) - def remove_from_history(self,person,old_id=None): + def remove_from_history(self,person_id,old_id=None): """Removes a person from the history list""" - person_id = person.get_id() if old_id: del_id = old_id else: @@ -175,19 +194,14 @@ class PeopleView: self.parent.mhistory.remove(del_id) def apply_filter_clicked(self): - invert_filter = self.parent.filter_inv.get_active() qualifer = unicode(self.parent.filter_text.get_text()) mi = self.parent.filter_list.get_menu().get_active() - class_init = mi.get_data("function") - self.DataFilter = class_init(qualifer) - self.DataFilter.set_invert(invert_filter) - self.model_used = {} - self.clear_person_tabs() - self.apply_filter(self.person_tree) + self.DataFilter = mi.get_data("filter") + self.apply_filter() self.goto_active_person() def add_to_person_list(self,person,change=0): - self.build_tree() + path = self.person_model.add_person(person) def goto_active_person(self,first=0): if not self.parent.active_person: @@ -205,6 +219,13 @@ class PeopleView: def apply_filter(self,current_model=None): self.parent.status_text(_('Updating display...')) + + keys = self.DataFilter.apply(self.parent.db,self.parent.db.get_person_keys()) + self.person_model.reset_visible() + for person_id in keys: + self.person_model.set_visible(person_id,1) + + self.sort_model.refilter() self.parent.modify_statusbar() def on_plist_button_press(self,obj,event): @@ -253,9 +274,10 @@ class PeopleView: def redisplay_person_list(self,person): self.person_model = PeopleModel.PeopleModel(self.parent.db) - if const.nosort_tree: - self.sort_model = self.person_model + if gtk.pygtk_version >= (2,3,92): + self.sort_model = gtk.TreeModelSort(self.person_model).filter_new() else: self.sort_model = gtk.TreeModelSort(self.person_model) + self.sort_model.set_visible_column(PeopleModel.COLUMN_VIEW) self.person_tree.set_model(self.sort_model) diff --git a/src/RelLib.py b/src/RelLib.py index a569af7bd..8d30f6179 100644 --- a/src/RelLib.py +++ b/src/RelLib.py @@ -1789,7 +1789,6 @@ class Event(DataObj): return 1 elif not (witness_list and other_list): return 0 - other_list = other_list[:] for a in witness_list: if a in other_list: other_list.remove(a) @@ -2430,6 +2429,24 @@ class GrampsDB: self.bookmarks = [] return 1 + def get_people_view_maps(self): + if self.metadata: + return (self.metadata.get('tp_iter'), + self.metadata.get('tp_path'), + self.metadata.get('p_iter'), + self.metadata.get('p_path'), + self.metadata.get('sname')) + else: + return (None,None,None,None,None) + + def set_people_view_maps(self,maps): + if self.metadata: + self.metadata['tp_iter'] = maps[0] + self.metadata['tp_path'] = maps[1] + self.metadata['p_iter'] = maps[2] + self.metadata['p_path'] = maps[3] + self.metadata['sname'] = maps[4] + def close(self): self.person_map.close() self.family_map.close() @@ -2494,10 +2511,6 @@ class GrampsDB: return keys else: return [] -# keys = self.person_map.keys() -# if type(keys) == type([]): -# keys.sort(self.sort_by_name) -# return keys def get_person_display(self,key): data = self.person_map.get(str(key)) @@ -2515,8 +2528,6 @@ class GrampsDB: data[6], data[5], data[2].get_sort_name(), -# sort.build_sort_date(bday), -# sort.build_sort_date(dday), data[6], data[5], GrampsCfg.display_surname(data[2])] @@ -3142,7 +3153,7 @@ class GrampsDB: def add_place_as(self,place,trans=None): if trans != None: - trans.add(PLACE_KEY,index,None) + trans.add(PLACE_KEY,place.get_id(),None) self.place_map.put(str(place.get_id()),place.serialize()) return place.get_id() diff --git a/src/Utils.py b/src/Utils.py index 3bb133ce4..08868e074 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -209,7 +209,7 @@ def family_upper_name(family,db): def destroy_passed_object(obj): obj.destroy() while gtk.events_pending(): - gtk.mainiteration() + gtk.main_iteration() #------------------------------------------------------------------------- # diff --git a/src/calendars/Makefile.in b/src/calendars/Makefile.in index 6ca4d3f14..318b70b52 100644 --- a/src/calendars/Makefile.in +++ b/src/calendars/Makefile.in @@ -86,7 +86,10 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_LIBS = @PYGTK_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/src/data/Makefile.in b/src/data/Makefile.in index 96f522eed..33929e0dc 100644 --- a/src/data/Makefile.in +++ b/src/data/Makefile.in @@ -91,7 +91,10 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_LIBS = @PYGTK_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/src/data/templates/Makefile.in b/src/data/templates/Makefile.in index 1d36ee977..52ff06f64 100644 --- a/src/data/templates/Makefile.in +++ b/src/data/templates/Makefile.in @@ -82,7 +82,10 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_LIBS = @PYGTK_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/src/docgen/Makefile.in b/src/docgen/Makefile.in index 696390e0f..f6b38695b 100644 --- a/src/docgen/Makefile.in +++ b/src/docgen/Makefile.in @@ -86,7 +86,10 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_LIBS = @PYGTK_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/src/filters/Makefile.in b/src/filters/Makefile.in index 995331aff..cf4a8f87a 100644 --- a/src/filters/Makefile.in +++ b/src/filters/Makefile.in @@ -82,7 +82,10 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_LIBS = @PYGTK_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/src/gramps.glade b/src/gramps.glade index 3934a72e9..8d283d4c7 100644 --- a/src/gramps.glade +++ b/src/gramps.glade @@ -1365,27 +1365,6 @@ False 0 - - - 6 - True - Show people that do not match the filtering rule - True - _Invert - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - True diff --git a/src/gramps_main.py b/src/gramps_main.py index 15887922f..7e97cd789 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -58,6 +58,7 @@ import PlaceView import FamilyView import SourceView import PeopleView +import GenericFilter from QuestionDialog import * @@ -709,10 +710,28 @@ class Gramps: def init_filters(self): - Filter.load_filters(const.filtersDir) - Filter.load_filters(os.path.expanduser("~/.gramps/filters")) + #Filter.load_filters(const.filtersDir) + #Filter.load_filters(os.path.expanduser("~/.gramps/filters")) + #menu = Filter.build_filter_menu(self.on_filter_name_changed,self.filter_text) - menu = Filter.build_filter_menu(self.on_filter_name_changed,self.filter_text) + filter_list = [] + + all = GenericFilter.GenericFilter() + all.set_name(_("Females")) + all.add_rule(GenericFilter.IsFemale([])) + filter_list.append(all) + + all = GenericFilter.GenericFilter() + all.set_name(_("Males")) + all.add_rule(GenericFilter.IsMale([])) + filter_list.append(all) + + all = GenericFilter.GenericFilter() + all.set_name(_("Entire Database")) + all.add_rule(GenericFilter.Everyone([])) + filter_list.append(all) + + menu = GenericFilter.build_filter_menu(filter_list) self.filter_list.set_menu(menu) self.filter_text.set_sensitive(0) @@ -803,14 +822,14 @@ class Gramps: """Prompt to save on exit if needed""" self.delete_abandoned_photos() self.db.close() - gtk.mainquit() + gtk.main_quit() def save_query(self): """Catch the reponse to the save on exit question""" self.on_save_activate_quit() self.delete_abandoned_photos() self.db.close() - gtk.mainquit() + gtk.main_quit() def save_query_noquit(self): """Catch the reponse to the save question, no quitting""" @@ -822,7 +841,7 @@ class Gramps: """Catch the reponse to the save on exit question""" self.delete_abandoned_photos() self.db.close() - gtk.mainquit() + gtk.main_quit() def close_noquit(self): """Close database and delete abandoned photos, no quit""" @@ -835,7 +854,7 @@ class Gramps: can delete any thumbnail images. The thumbnails may or may not exist, depending on if the image was previewed. """ - pass + self.db.set_people_view_maps(self.people_view.get_maps()) def on_about_activate(self,obj): """Displays the about box. Called from Help menu""" @@ -1242,7 +1261,6 @@ class Gramps: self.update_display(0) def delete_person_response(self): - trans = self.db.start_transaction() if self.db.get_default_person() == self.active_person: @@ -1277,13 +1295,14 @@ class Gramps: family = self.db.find_family_from_id(family_id) family.remove_child_id(self.active_person.get_id()) self.db.commit_family(family,trans) - - self.people_view.remove_from_history(self.active_person) - self.db.remove_person_id(self.active_person.get_id(),trans) + + id = self.active_person.get_id() self.people_view.remove_from_person_list(self.active_person) + self.people_view.remove_from_history(id) + self.db.remove_person_id(id, trans) if self.hindex >= 0: - self.active_person = self.db.get_person(self.history[self.hindex]) + self.active_person = self.db.find_person_from_id(self.history[self.hindex]) else: self.change_active_person(None) self.db.add_transaction(trans) @@ -1537,12 +1556,12 @@ class Gramps: def load_progress(self,value): self.statusbar.set_progress_percentage(value) while gtk.events_pending(): - gtk.mainiteration() + gtk.main_iteration() def status_text(self,text): self.statusbar.set_status(text) while gtk.events_pending(): - gtk.mainiteration() + gtk.main_iteration() def post_load(self,name): self.db.set_save_path(name) @@ -1726,49 +1745,7 @@ class Gramps: # self.load_new_person(obj) def open_example(self,obj): - if Utils.wasModified(): - self.delobj = obj - SaveDialog(_('Save Changes Made to the Database?'), - _("Unsaved changes exist in the current database. If you " - "close without saving, the changes you have made will " - "be lost."), - self.close_noquit, - self.save_query_noquit) - - if not Utils.wasModified(): - import shutil - dest = os.path.expanduser("~/.gramps/example") - if not os.path.isdir(dest): - try: - os.mkdir(dest) - except IOError,msg: - ErrorDialog(_('Could not create database'), - _('The directory ~/.gramps/example could not ' - 'be created.') + '\n' + str(msg) ) - except OSError,msg: - ErrorDialog(_('Could not create database'), - _('The directory ~/.gramps/example could not ' - 'be created.') + '\n' + str(msg) ) - except: - ErrorDialog(_('Could not create database'), - _('The directory ~/.gramps/example could not ' - 'be created.')) - try: - dir = "%s/share/gramps/example" % const.prefixdir - for file in os.listdir(dir): - shutil.copyfile("%s/%s" % (dir,file), - "%s/%s" % (dest,file) ) - try: - shutil.copystat("%s/%s" % (dir,file), - "%s/%s" % (dest,file)) - except: - pass - except IOError,msg: - ErrorDialog(_('Example database not created'),str(msg)) - except OSError,msg: - ErrorDialog(_('Example database not created'),str(msg)) - - self.read_file(dest) + pass DARKEN = 1.4 diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in index b345b148f..f94fb33ae 100644 --- a/src/plugins/Makefile.in +++ b/src/plugins/Makefile.in @@ -85,7 +85,10 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_LIBS = @PYGTK_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ diff --git a/src/plugins/count_anc.py b/src/plugins/count_anc.py index e12a07ea3..d3680b633 100644 --- a/src/plugins/count_anc.py +++ b/src/plugins/count_anc.py @@ -63,9 +63,11 @@ class CountAncestors: text = text + _("Generation %d has %d individuals.\n") % (gen, thisgensize) temp = thisgen thisgen = [] - for person in temp: - family = person.get_main_parents_family_id() - if family != None: + for person_id in temp: + person = database.find_person_from_id(person_id) + family_id = person.get_main_parents_family_id() + if family_id: + family = database.find_family_from_id(family_id) father = family.get_father_id() mother = family.get_mother_id() if father != None: diff --git a/src/po/Makefile.in b/src/po/Makefile.in index b32a9a50f..7d7ce760e 100644 --- a/src/po/Makefile.in +++ b/src/po/Makefile.in @@ -78,7 +78,10 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ POFILES = @POFILES@ +PYGTK_CFLAGS = @PYGTK_CFLAGS@ +PYGTK_LIBS = @PYGTK_LIBS@ PYTHON = @PYTHON@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_PLATFORM = @PYTHON_PLATFORM@