* src/gramps_main.py: dropped New Database message. After all, it should
be incredibly obvious. * src/Utils.py: create_id to generate random internal ID * src/RelLib.py: new internal ID support * src/AddSpouse.py: bug fixes * src/ChooseParents.py: bug fixes * src/PeopleModel.py: bug fixes * src/PeopleView.py: bug fixes * src/FamilyView.py: bug fixes * src/Bookmarks.py: support for new internal IDs * src/EditPerson.py: support for new internal IDs * src/plugins/ReadGedcom.py: handle new internal IDs svn: r3233
This commit is contained in:
parent
2faa14b1a7
commit
4c76be91dd
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
|||||||
|
2004-06-26 Don Allingham <dallingham@users.sourceforge.net>
|
||||||
|
* src/gramps_main.py: dropped New Database message. After all, it should
|
||||||
|
be incredibly obvious.
|
||||||
|
* src/Utils.py: create_id to generate random internal ID
|
||||||
|
* src/RelLib.py: new internal ID support
|
||||||
|
* src/AddSpouse.py: bug fixes
|
||||||
|
* src/ChooseParents.py: bug fixes
|
||||||
|
* src/PeopleModel.py: bug fixes
|
||||||
|
* src/PeopleView.py: bug fixes
|
||||||
|
* src/FamilyView.py: bug fixes
|
||||||
|
* src/Bookmarks.py: support for new internal IDs
|
||||||
|
* src/EditPerson.py: support for new internal IDs
|
||||||
|
* src/plugins/ReadGedcom.py: handle new internal IDs
|
||||||
|
|
||||||
2004-06-24 Alex Roitman <shura@alex.neuro.umn.edu>
|
2004-06-24 Alex Roitman <shura@alex.neuro.umn.edu>
|
||||||
* src/gramps_main.py (on_import_activate,on_export_activate):
|
* src/gramps_main.py (on_import_activate,on_export_activate):
|
||||||
Add methods.
|
Add methods.
|
||||||
|
22
configure
vendored
22
configure
vendored
@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.59 for gramps 1.1.0.
|
# Generated by GNU Autoconf 2.59 for gramps 1.1.1.
|
||||||
#
|
#
|
||||||
# Report bugs to <gramps-bugs@lists.sourceforge.net>.
|
# Report bugs to <gramps-bugs@lists.sourceforge.net>.
|
||||||
#
|
#
|
||||||
@ -269,8 +269,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='gramps'
|
PACKAGE_NAME='gramps'
|
||||||
PACKAGE_TARNAME='gramps'
|
PACKAGE_TARNAME='gramps'
|
||||||
PACKAGE_VERSION='1.1.0'
|
PACKAGE_VERSION='1.1.1'
|
||||||
PACKAGE_STRING='gramps 1.1.0'
|
PACKAGE_STRING='gramps 1.1.1'
|
||||||
PACKAGE_BUGREPORT='gramps-bugs@lists.sourceforge.net'
|
PACKAGE_BUGREPORT='gramps-bugs@lists.sourceforge.net'
|
||||||
|
|
||||||
ac_unique_file="src/gramps.py"
|
ac_unique_file="src/gramps.py"
|
||||||
@ -723,7 +723,7 @@ if test "$ac_init_help" = "long"; then
|
|||||||
# Omit some internal or obsolete options to make the list less imposing.
|
# Omit some internal or obsolete options to make the list less imposing.
|
||||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||||
cat <<_ACEOF
|
cat <<_ACEOF
|
||||||
\`configure' configures gramps 1.1.0 to adapt to many kinds of systems.
|
\`configure' configures gramps 1.1.1 to adapt to many kinds of systems.
|
||||||
|
|
||||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||||
|
|
||||||
@ -785,7 +785,7 @@ fi
|
|||||||
|
|
||||||
if test -n "$ac_init_help"; then
|
if test -n "$ac_init_help"; then
|
||||||
case $ac_init_help in
|
case $ac_init_help in
|
||||||
short | recursive ) echo "Configuration of gramps 1.1.0:";;
|
short | recursive ) echo "Configuration of gramps 1.1.1:";;
|
||||||
esac
|
esac
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
|
|
||||||
@ -885,7 +885,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit 0
|
test -n "$ac_init_help" && exit 0
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
gramps configure 1.1.0
|
gramps configure 1.1.1
|
||||||
generated by GNU Autoconf 2.59
|
generated by GNU Autoconf 2.59
|
||||||
|
|
||||||
Copyright (C) 2003 Free Software Foundation, Inc.
|
Copyright (C) 2003 Free Software Foundation, Inc.
|
||||||
@ -899,7 +899,7 @@ cat >&5 <<_ACEOF
|
|||||||
This file contains any messages produced by compilers while
|
This file contains any messages produced by compilers while
|
||||||
running configure, to aid debugging if configure makes a mistake.
|
running configure, to aid debugging if configure makes a mistake.
|
||||||
|
|
||||||
It was created by gramps $as_me 1.1.0, which was
|
It was created by gramps $as_me 1.1.1, which was
|
||||||
generated by GNU Autoconf 2.59. Invocation command line was
|
generated by GNU Autoconf 2.59. Invocation command line was
|
||||||
|
|
||||||
$ $0 $@
|
$ $0 $@
|
||||||
@ -1535,7 +1535,7 @@ fi
|
|||||||
|
|
||||||
# Define the identity of the package.
|
# Define the identity of the package.
|
||||||
PACKAGE='gramps'
|
PACKAGE='gramps'
|
||||||
VERSION='1.1.0'
|
VERSION='1.1.1'
|
||||||
|
|
||||||
|
|
||||||
cat >>confdefs.h <<_ACEOF
|
cat >>confdefs.h <<_ACEOF
|
||||||
@ -1661,7 +1661,7 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
RELEASE=1
|
RELEASE=0.CVS$(head -c 10 ${srcdir}/ChangeLog | tr -d '-')
|
||||||
|
|
||||||
VERSIONSTRING=$VERSION
|
VERSIONSTRING=$VERSION
|
||||||
if test x"$RELEASE" != "x"
|
if test x"$RELEASE" != "x"
|
||||||
@ -2736,7 +2736,7 @@ _ASBOX
|
|||||||
} >&5
|
} >&5
|
||||||
cat >&5 <<_CSEOF
|
cat >&5 <<_CSEOF
|
||||||
|
|
||||||
This file was extended by gramps $as_me 1.1.0, which was
|
This file was extended by gramps $as_me 1.1.1, which was
|
||||||
generated by GNU Autoconf 2.59. Invocation command line was
|
generated by GNU Autoconf 2.59. Invocation command line was
|
||||||
|
|
||||||
CONFIG_FILES = $CONFIG_FILES
|
CONFIG_FILES = $CONFIG_FILES
|
||||||
@ -2791,7 +2791,7 @@ _ACEOF
|
|||||||
|
|
||||||
cat >>$CONFIG_STATUS <<_ACEOF
|
cat >>$CONFIG_STATUS <<_ACEOF
|
||||||
ac_cs_version="\\
|
ac_cs_version="\\
|
||||||
gramps config.status 1.1.0
|
gramps config.status 1.1.1
|
||||||
configured by $0, generated by GNU Autoconf 2.59,
|
configured by $0, generated by GNU Autoconf 2.59,
|
||||||
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
%define ver 1.1.0
|
%define ver 1.1.1
|
||||||
%define rel 1
|
%define rel 0.CVS20040624
|
||||||
%define prefix /usr
|
%define prefix /usr
|
||||||
%define localstatedir /var/lib
|
%define localstatedir /var/lib
|
||||||
# Ensure that internal RPM macros for configure & makeinstall
|
# Ensure that internal RPM macros for configure & makeinstall
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
%define ver 1.1.0
|
%define ver 1.1.1
|
||||||
%define rel 1
|
%define rel 0.CVS20040624
|
||||||
%define prefix /usr
|
%define prefix /usr
|
||||||
%define localstatedir /var/lib
|
%define localstatedir /var/lib
|
||||||
# Ensure that internal RPM macros for configure & makeinstall
|
# Ensure that internal RPM macros for configure & makeinstall
|
||||||
|
@ -172,7 +172,7 @@ class AddSpouse:
|
|||||||
return mlist
|
return mlist
|
||||||
|
|
||||||
def select_function(self,store,path,iter,id_list):
|
def select_function(self,store,path,iter,id_list):
|
||||||
id_list.append(store.get_value(iter,1))
|
id_list.append(store.get_value(iter,PeopleModel.COLUMN_INT_ID))
|
||||||
|
|
||||||
def select_row(self,obj):
|
def select_row(self,obj):
|
||||||
"""
|
"""
|
||||||
@ -244,7 +244,7 @@ class AddSpouse:
|
|||||||
trans = self.db.start_transaction()
|
trans = self.db.start_transaction()
|
||||||
|
|
||||||
if not self.active_family:
|
if not self.active_family:
|
||||||
self.active_family = self.db.new_family()
|
self.active_family = self.db.new_family(trans)
|
||||||
self.person.add_family_id(self.active_family.get_id())
|
self.person.add_family_id(self.active_family.get_id())
|
||||||
self.db.commit_person(self.person,trans)
|
self.db.commit_person(self.person,trans)
|
||||||
spouse.add_family_id(self.active_family.get_id())
|
spouse.add_family_id(self.active_family.get_id())
|
||||||
|
@ -84,7 +84,7 @@ class Bookmarks :
|
|||||||
"""adds a person's name to the drop down menu"""
|
"""adds a person's name to the drop down menu"""
|
||||||
data = self.db.person_map.get(str(person_id))
|
data = self.db.person_map.get(str(person_id))
|
||||||
if data:
|
if data:
|
||||||
name = data[2].get_name()
|
name = data[3].get_name()
|
||||||
item = gtk.MenuItem(name)
|
item = gtk.MenuItem(name)
|
||||||
item.connect("activate", self.callback, person_id)
|
item.connect("activate", self.callback, person_id)
|
||||||
item.show()
|
item.show()
|
||||||
@ -144,7 +144,7 @@ class Bookmarks :
|
|||||||
index = 0
|
index = 0
|
||||||
for person_id in self.bookmarks:
|
for person_id in self.bookmarks:
|
||||||
data = self.db.person_map.get(str(person_id))
|
data = self.db.person_map.get(str(person_id))
|
||||||
name = data[2].get_name()
|
name = data[3].get_name()
|
||||||
self.namelist.append([name])
|
self.namelist.append([name])
|
||||||
self.namelist.set_row_data(index,person_id)
|
self.namelist.set_row_data(index,person_id)
|
||||||
index = index + 1
|
index = index + 1
|
||||||
|
@ -401,10 +401,10 @@ class ChooseParents:
|
|||||||
#self.father_model.center_selected()
|
#self.father_model.center_selected()
|
||||||
|
|
||||||
def father_select_function(self,store,path,iter,id_list):
|
def father_select_function(self,store,path,iter,id_list):
|
||||||
id_list.append(self.father_model.get_value(iter,1))
|
id_list.append(self.father_model.get_value(iter,PeopleModel.COLUMN_INT_ID))
|
||||||
|
|
||||||
def mother_select_function(self,store,path,iter,id_list):
|
def mother_select_function(self,store,path,iter,id_list):
|
||||||
id_list.append(self.mother_model.get_value(iter,1))
|
id_list.append(self.mother_model.get_value(iter,PeopleModel.COLUMN_INT_ID))
|
||||||
|
|
||||||
def get_selected_father_ids(self):
|
def get_selected_father_ids(self):
|
||||||
mlist = []
|
mlist = []
|
||||||
@ -528,7 +528,7 @@ class ChooseParents:
|
|||||||
self.db.add_transaction(trans,_("Choose Parents"))
|
self.db.add_transaction(trans,_("Choose Parents"))
|
||||||
self.close(obj)
|
self.close(obj)
|
||||||
|
|
||||||
def add_new_parent(self,epo):
|
def add_new_parent(self,epo,trans):
|
||||||
"""Adds a new person to either the father list or the mother list,
|
"""Adds a new person to either the father list or the mother list,
|
||||||
depending on the gender of the person."""
|
depending on the gender of the person."""
|
||||||
|
|
||||||
@ -536,22 +536,18 @@ class ChooseParents:
|
|||||||
id = person.get_id()
|
id = person.get_id()
|
||||||
|
|
||||||
if id == "":
|
if id == "":
|
||||||
id = self.db.add_person(person)
|
id = self.db.add_person(person,trans)
|
||||||
else:
|
else:
|
||||||
self.db.add_person_no_map(person,id)
|
self.db.add_person_no_map(person,id,trans)
|
||||||
|
|
||||||
self.type = const.save_frel(unicode(self.prel.get_text()))
|
self.type = const.save_frel(unicode(self.prel.get_text()))
|
||||||
dinfo = self.db.get_person_display(id)
|
|
||||||
rdata = [dinfo[0],dinfo[1],dinfo[3],dinfo[5],dinfo[6]]
|
|
||||||
|
|
||||||
if self.type == "Partners":
|
if self.type == "Partners":
|
||||||
self.parent_relation_changed(self.prel)
|
self.parent_relation_changed(self.prel)
|
||||||
elif person.get_gender() == RelLib.Person.male:
|
elif person.get_gender() == RelLib.Person.male:
|
||||||
self.father_model.add(rdata,None,1)
|
self.redrawf()
|
||||||
self.father_model.center_selected()
|
|
||||||
else:
|
else:
|
||||||
self.mother_model.add(rdata,None,1)
|
self.redrawm()
|
||||||
self.mother_model.center_selected()
|
|
||||||
self.full_update()
|
self.full_update()
|
||||||
|
|
||||||
def add_parent_clicked(self,obj):
|
def add_parent_clicked(self,obj):
|
||||||
|
@ -81,11 +81,11 @@ class EditPerson:
|
|||||||
"""Creates an edit window. Associates a person with the window."""
|
"""Creates an edit window. Associates a person with the window."""
|
||||||
|
|
||||||
self.person = person
|
self.person = person
|
||||||
self.orig_id = person.get_id()
|
|
||||||
self.orig_surname = person.get_primary_name().get_surname()
|
self.orig_surname = person.get_primary_name().get_surname()
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
self.orig_id = self.person.get_gramps_id()
|
||||||
if self.parent.child_windows.has_key(self.orig_id):
|
if self.parent.child_windows.has_key(self.orig_id):
|
||||||
self.parent.child_windows[self.orig_id].present(None)
|
self.parent.child_windows[self.person.get_id()].present(None)
|
||||||
return
|
return
|
||||||
self.db = db
|
self.db = db
|
||||||
self.callback = callback
|
self.callback = callback
|
||||||
@ -288,7 +288,7 @@ class EditPerson:
|
|||||||
build_dropdown(self.dplace,self.place_list)
|
build_dropdown(self.dplace,self.place_list)
|
||||||
build_dropdown(self.surname,self.db.get_surnames())
|
build_dropdown(self.surname,self.db.get_surnames())
|
||||||
|
|
||||||
self.gid.set_text(person.get_id())
|
self.gid.set_text(person.get_gramps_id())
|
||||||
self.gid.set_editable(GrampsCfg.id_edit)
|
self.gid.set_editable(GrampsCfg.id_edit)
|
||||||
|
|
||||||
self.lds_baptism = RelLib.LdsOrd(self.person.get_lds_baptism())
|
self.lds_baptism = RelLib.LdsOrd(self.person.get_lds_baptism())
|
||||||
@ -1094,7 +1094,7 @@ class EditPerson:
|
|||||||
if self.complete.get_active() != self.person.get_complete():
|
if self.complete.get_active() != self.person.get_complete():
|
||||||
changed = 1
|
changed = 1
|
||||||
|
|
||||||
if self.person.get_id() != idval:
|
if self.person.get_gramps_id() != idval:
|
||||||
changed = 1
|
changed = 1
|
||||||
if suffix != name.get_suffix():
|
if suffix != name.get_suffix():
|
||||||
changed = 1
|
changed = 1
|
||||||
@ -1449,13 +1449,13 @@ class EditPerson:
|
|||||||
self.birth.set_date(unicode(self.bdate.get_text()))
|
self.birth.set_date(unicode(self.bdate.get_text()))
|
||||||
self.birth.set_place_id(self.get_place(self.bplace,1))
|
self.birth.set_place_id(self.get_place(self.bplace,1))
|
||||||
|
|
||||||
if idval != self.person.get_id():
|
if idval != self.person.get_gramps_id():
|
||||||
m = self.db.get_person_keys()
|
m = self.db.get_person_keys()
|
||||||
if not m.has_key(idval):
|
if not m.has_key(idval):
|
||||||
if m.has_key(self.person.get_id()):
|
if m.has_key(self.person.get_gramps_id()):
|
||||||
del m[self.person.get_id()]
|
del m[self.person.get_gramps_id()]
|
||||||
m[idval] = self.person
|
m[idval] = self.person
|
||||||
self.person.set_id(idval)
|
self.person.set_gramps_id(idval)
|
||||||
else:
|
else:
|
||||||
n = GrampsCfg.nameof(m[idval])
|
n = GrampsCfg.nameof(m[idval])
|
||||||
msg1 = _("GRAMPS ID value was not changed.")
|
msg1 = _("GRAMPS ID value was not changed.")
|
||||||
@ -1605,7 +1605,6 @@ class EditPerson:
|
|||||||
|
|
||||||
self.update_lists()
|
self.update_lists()
|
||||||
if self.callback:
|
if self.callback:
|
||||||
change = (self.orig_surname != surname) or (self.orig_id != idval)
|
|
||||||
self.callback(self,trans)
|
self.callback(self,trans)
|
||||||
|
|
||||||
self.db.commit_person(self.person, trans)
|
self.db.commit_person(self.person, trans)
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
# GTK/Gnome modules
|
# GTK/Gnome modules
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
import gobject
|
|
||||||
import gtk
|
import gtk
|
||||||
import gtk.glade
|
import gtk.glade
|
||||||
from gtk.gdk import ACTION_COPY, BUTTON1_MASK
|
from gtk.gdk import ACTION_COPY, BUTTON1_MASK
|
||||||
|
from gobject import TYPE_STRING, TYPE_INT
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -158,7 +158,7 @@ class FamilyView:
|
|||||||
|
|
||||||
already_init = self.cadded[fv]
|
already_init = self.cadded[fv]
|
||||||
|
|
||||||
self.ap_model = gtk.ListStore(gobject.TYPE_STRING)
|
self.ap_model = gtk.ListStore(TYPE_STRING)
|
||||||
self.ap_data.set_model(self.ap_model)
|
self.ap_data.set_model(self.ap_model)
|
||||||
if not already_init:
|
if not already_init:
|
||||||
column = gtk.TreeViewColumn('',gtk.CellRendererText(),text=0)
|
column = gtk.TreeViewColumn('',gtk.CellRendererText(),text=0)
|
||||||
@ -166,7 +166,7 @@ class FamilyView:
|
|||||||
self.ap_data.connect('button-press-event',self.ap_button_press)
|
self.ap_data.connect('button-press-event',self.ap_button_press)
|
||||||
self.ap_data.connect('key-press-event',self.ap_key_press)
|
self.ap_data.connect('key-press-event',self.ap_key_press)
|
||||||
|
|
||||||
self.ap_parents_model = gtk.ListStore(gobject.TYPE_STRING)
|
self.ap_parents_model = gtk.ListStore(TYPE_STRING)
|
||||||
self.ap_parents.set_model(self.ap_parents_model)
|
self.ap_parents.set_model(self.ap_parents_model)
|
||||||
self.ap_selection = self.ap_parents.get_selection()
|
self.ap_selection = self.ap_parents.get_selection()
|
||||||
if not already_init:
|
if not already_init:
|
||||||
@ -175,7 +175,7 @@ class FamilyView:
|
|||||||
self.ap_parents.connect('button-press-event',self.ap_par_button_press)
|
self.ap_parents.connect('button-press-event',self.ap_par_button_press)
|
||||||
self.ap_parents.connect('key-press-event',self.ap_par_key_press)
|
self.ap_parents.connect('key-press-event',self.ap_par_key_press)
|
||||||
|
|
||||||
self.sp_parents_model = gtk.ListStore(gobject.TYPE_STRING)
|
self.sp_parents_model = gtk.ListStore(TYPE_STRING)
|
||||||
self.sp_parents.set_model(self.sp_parents_model)
|
self.sp_parents.set_model(self.sp_parents_model)
|
||||||
self.sp_selection = self.sp_parents.get_selection()
|
self.sp_selection = self.sp_parents.get_selection()
|
||||||
if not already_init:
|
if not already_init:
|
||||||
@ -184,7 +184,7 @@ class FamilyView:
|
|||||||
self.sp_parents.connect('button-press-event',self.sp_par_button_press)
|
self.sp_parents.connect('button-press-event',self.sp_par_button_press)
|
||||||
self.sp_parents.connect('key-press-event',self.sp_par_key_press)
|
self.sp_parents.connect('key-press-event',self.sp_par_key_press)
|
||||||
|
|
||||||
self.spouse_model = gtk.ListStore(gobject.TYPE_STRING)
|
self.spouse_model = gtk.ListStore(TYPE_STRING)
|
||||||
self.spouse_list.set_model(self.spouse_model)
|
self.spouse_list.set_model(self.spouse_model)
|
||||||
self.spouse_selection = self.spouse_list.get_selection()
|
self.spouse_selection = self.spouse_list.get_selection()
|
||||||
if not already_init:
|
if not already_init:
|
||||||
@ -202,15 +202,16 @@ class FamilyView:
|
|||||||
self.child_list.connect('drag_data_get', self.drag_data_get)
|
self.child_list.connect('drag_data_get', self.drag_data_get)
|
||||||
self.child_list.connect('drag_data_received',self.drag_data_received)
|
self.child_list.connect('drag_data_received',self.drag_data_received)
|
||||||
|
|
||||||
self.child_model = gtk.ListStore(gobject.TYPE_INT, gobject.TYPE_STRING,
|
self.child_model = gtk.ListStore(TYPE_INT, TYPE_STRING,
|
||||||
gobject.TYPE_STRING,gobject.TYPE_STRING,
|
TYPE_STRING,TYPE_STRING,
|
||||||
gobject.TYPE_STRING,gobject.TYPE_STRING,
|
TYPE_STRING,TYPE_STRING,
|
||||||
gobject.TYPE_STRING)
|
TYPE_STRING,TYPE_STRING)
|
||||||
|
|
||||||
self.child_selection = self.child_list.get_selection()
|
self.child_selection = self.child_list.get_selection()
|
||||||
|
|
||||||
if not already_init:
|
if not already_init:
|
||||||
self.child_list.connect('button-press-event',self.on_child_list_button_press)
|
self.child_list.connect('button-press-event',
|
||||||
|
self.on_child_list_button_press)
|
||||||
self.child_list.connect('key-press-event',self.child_key_press)
|
self.child_list.connect('key-press-event',self.child_key_press)
|
||||||
|
|
||||||
self.swap_btn.connect('clicked',self.spouse_swap)
|
self.swap_btn.connect('clicked',self.spouse_swap)
|
||||||
@ -291,7 +292,7 @@ class FamilyView:
|
|||||||
model, iter = self.child_selection.get_selected()
|
model, iter = self.child_selection.get_selected()
|
||||||
if not iter:
|
if not iter:
|
||||||
return
|
return
|
||||||
id = self.child_model.get_value(iter,2)
|
id = self.child_model.get_value(iter,7)
|
||||||
if event.keyval == gtk.gdk.keyval_from_name("Return") and not event.state:
|
if event.keyval == gtk.gdk.keyval_from_name("Return") and not event.state:
|
||||||
self.child_rel_by_id(id)
|
self.child_rel_by_id(id)
|
||||||
elif event.keyval == gtk.gdk.keyval_from_name("Return") \
|
elif event.keyval == gtk.gdk.keyval_from_name("Return") \
|
||||||
@ -431,7 +432,7 @@ class FamilyView:
|
|||||||
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
if event.type == gtk.gdk.BUTTON_PRESS and event.button == 3:
|
||||||
self.build_nav_menu(event)
|
self.build_nav_menu(event)
|
||||||
return
|
return
|
||||||
id = self.child_model.get_value(iter,2)
|
id = self.child_model.get_value(iter,7)
|
||||||
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
|
||||||
self.child_rel_by_id(id)
|
self.child_rel_by_id(id)
|
||||||
elif event.state == gtk.gdk.SHIFT_MASK and \
|
elif event.state == gtk.gdk.SHIFT_MASK and \
|
||||||
@ -484,7 +485,7 @@ class FamilyView:
|
|||||||
model, iter = self.child_selection.get_selected()
|
model, iter = self.child_selection.get_selected()
|
||||||
if not iter:
|
if not iter:
|
||||||
return
|
return
|
||||||
child = self.parent.db.get_person(self.child_model.get_value(iter,2))
|
child = self.parent.db.get_person(self.child_model.get_value(iter,7))
|
||||||
try:
|
try:
|
||||||
EditPerson.EditPerson(self.parent, child, self.parent.db, self.spouse_after_edit)
|
EditPerson.EditPerson(self.parent, child, self.parent.db, self.spouse_after_edit)
|
||||||
except:
|
except:
|
||||||
@ -616,10 +617,9 @@ class FamilyView:
|
|||||||
except:
|
except:
|
||||||
DisplayTrace.DisplayTrace()
|
DisplayTrace.DisplayTrace()
|
||||||
|
|
||||||
def spouse_after_edit(self,epo):
|
def spouse_after_edit(self,ep,trans):
|
||||||
ap = self.parent.active_person
|
ap = self.parent.active_person
|
||||||
if epo:
|
if epo:
|
||||||
trans = self.parent.db.start_transaction()
|
|
||||||
self.parent.db.commit_person(epo.person,trans)
|
self.parent.db.commit_person(epo.person,trans)
|
||||||
n = epo.person.get_primary_name().get_regular_name()
|
n = epo.person.get_primary_name().get_regular_name()
|
||||||
self.parent.db.add_transaction(trans,_("Add Person (%s)") % n)
|
self.parent.db.add_transaction(trans,_("Add Person (%s)") % n)
|
||||||
@ -738,7 +738,7 @@ class FamilyView:
|
|||||||
if not iter:
|
if not iter:
|
||||||
return
|
return
|
||||||
|
|
||||||
id = self.child_model.get_value(iter,2)
|
id = self.child_model.get_value(iter,7)
|
||||||
child = self.parent.db.get_person(id)
|
child = self.parent.db.get_person(id)
|
||||||
|
|
||||||
trans = self.parent.db.start_transaction()
|
trans = self.parent.db.start_transaction()
|
||||||
@ -785,13 +785,13 @@ class FamilyView:
|
|||||||
trans = self.parent.db.start_transaction()
|
trans = self.parent.db.start_transaction()
|
||||||
|
|
||||||
if self.selected_spouse:
|
if self.selected_spouse:
|
||||||
self.selected_spouse.remove_family_id(self.family.get_id(),trans)
|
self.selected_spouse.remove_family_id(self.family.get_id())
|
||||||
self.parent.db.commit_person(self.selected_spouse,trans)
|
self.parent.db.commit_person(self.selected_spouse,trans)
|
||||||
|
|
||||||
self.parent.db.commit_family(self.family,trans)
|
self.parent.db.commit_family(self.family,trans)
|
||||||
|
|
||||||
if len(self.family.get_child_id_list()) == 0:
|
if len(self.family.get_child_id_list()) == 0:
|
||||||
self.person.remove_family_id(self.family.get_id(),trans)
|
self.person.remove_family_id(self.family.get_id())
|
||||||
self.parent.db.commit_person(self.person,trans)
|
self.parent.db.commit_person(self.person,trans)
|
||||||
self.parent.db.delete_family(self.family.get_id(),trans)
|
self.parent.db.delete_family(self.family.get_id(),trans)
|
||||||
if len(self.person.get_family_id_list()) > 0:
|
if len(self.person.get_family_id_list()) > 0:
|
||||||
@ -868,20 +868,20 @@ class FamilyView:
|
|||||||
|
|
||||||
if bd and dd:
|
if bd and dd:
|
||||||
n = "%s [%s]\n\t%s %s\n\t%s %s " % (GrampsCfg.nameof(self.person),
|
n = "%s [%s]\n\t%s %s\n\t%s %s " % (GrampsCfg.nameof(self.person),
|
||||||
self.person.get_id(),
|
self.person.get_gramps_id(),
|
||||||
_BORN,bd.get_date(),
|
_BORN,bd.get_date(),
|
||||||
_DIED,dd.get_date())
|
_DIED,dd.get_date())
|
||||||
elif bd:
|
elif bd:
|
||||||
n = "%s [%s]\n\t%s %s" % (GrampsCfg.nameof(self.person),
|
n = "%s [%s]\n\t%s %s" % (GrampsCfg.nameof(self.person),
|
||||||
self.person.get_id(),
|
self.person.get_gramps_id(),
|
||||||
_BORN,bd.get_date())
|
_BORN,bd.get_date())
|
||||||
elif dd:
|
elif dd:
|
||||||
n = "%s [%s]\n\t%s %s" % (GrampsCfg.nameof(self.person),
|
n = "%s [%s]\n\t%s %s" % (GrampsCfg.nameof(self.person),
|
||||||
self.person.get_id(),
|
self.person.get_gramps_id(),
|
||||||
_DIED,dd.get_date())
|
_DIED,dd.get_date())
|
||||||
else:
|
else:
|
||||||
n = "%s [%s]" % (GrampsCfg.nameof(self.person),
|
n = "%s [%s]" % (GrampsCfg.nameof(self.person),
|
||||||
self.person.get_id())
|
self.person.get_gramps_id())
|
||||||
|
|
||||||
self.ap_model.clear()
|
self.ap_model.clear()
|
||||||
self.ap_data.get_selection().set_mode(gtk.SELECTION_NONE)
|
self.ap_data.get_selection().set_mode(gtk.SELECTION_NONE)
|
||||||
@ -923,7 +923,7 @@ class FamilyView:
|
|||||||
else:
|
else:
|
||||||
mdate = ""
|
mdate = ""
|
||||||
v = "%s [%s]\n\t%s%s" % (GrampsCfg.nameof(sp),
|
v = "%s [%s]\n\t%s%s" % (GrampsCfg.nameof(sp),
|
||||||
sp.get_id(),
|
sp.get_gramps_id(),
|
||||||
const.display_frel(fm.get_relationship()),
|
const.display_frel(fm.get_relationship()),
|
||||||
mdate)
|
mdate)
|
||||||
self.spouse_model.set(iter,0,v)
|
self.spouse_model.set(iter,0,v)
|
||||||
@ -982,7 +982,7 @@ class FamilyView:
|
|||||||
def nameof(self,l,p,mode):
|
def nameof(self,l,p,mode):
|
||||||
if p:
|
if p:
|
||||||
n = GrampsCfg.nameof(p)
|
n = GrampsCfg.nameof(p)
|
||||||
pid = p.get_id()
|
pid = p.get_gramps_id()
|
||||||
return _("%s: %s [%s]\n\tRelationship: %s") % (l,n,pid,_(mode))
|
return _("%s: %s [%s]\n\tRelationship: %s") % (l,n,pid,_(mode))
|
||||||
else:
|
else:
|
||||||
return _("%s: unknown") % (l)
|
return _("%s: unknown") % (l)
|
||||||
@ -1049,14 +1049,14 @@ class FamilyView:
|
|||||||
val = self.parent.db.get_person_display(child.get_id())
|
val = self.parent.db.get_person_display(child.get_id())
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
event = self.parent.db.find_event_from_id(val[3])
|
event = self.parent.db.find_event_from_id(val[4])
|
||||||
if event:
|
if event:
|
||||||
dval = event.get_date()
|
dval = event.get_date()
|
||||||
else:
|
else:
|
||||||
dval = u''
|
dval = u''
|
||||||
|
|
||||||
self.child_model.set(iter,0,i,1,val[0],2,val[1],3,val[2],
|
self.child_model.set(iter,0,i,1,val[0],2,val[1],3,val[2],
|
||||||
4,dval,5,status,6,val[6])
|
4,dval,5,status,6,val[6],7,child.get_id())
|
||||||
|
|
||||||
def build_parents_menu(self,family,event):
|
def build_parents_menu(self,family,event):
|
||||||
"""Builds the menu that allows editing operations on the child list"""
|
"""Builds the menu that allows editing operations on the child list"""
|
||||||
@ -1340,7 +1340,8 @@ class FamilyView:
|
|||||||
pname = self.person.get_primary_name()
|
pname = self.person.get_primary_name()
|
||||||
return (pname.get_surname_prefix(),pname.get_surname())
|
return (pname.get_surname_prefix(),pname.get_surname())
|
||||||
elif self.family:
|
elif self.family:
|
||||||
f = self.family.get_father_id()
|
fid = self.family.get_father_id()
|
||||||
|
f = self.parent.db.get_family_from_id(fid)
|
||||||
if f:
|
if f:
|
||||||
pname = f.get_primary_name()
|
pname = f.get_primary_name()
|
||||||
return (pname.get_surname_prefix(),pname.get_surname())
|
return (pname.get_surname_prefix(),pname.get_surname())
|
||||||
|
@ -52,6 +52,15 @@ COLUMN_NAME = 0
|
|||||||
COLUMN_NAME_SORT = 8
|
COLUMN_NAME_SORT = 8
|
||||||
COLUMN_VIEW = COLUMN_NAME_SORT + 1
|
COLUMN_VIEW = COLUMN_NAME_SORT + 1
|
||||||
COLUMN_BOLD = COLUMN_VIEW + 1
|
COLUMN_BOLD = COLUMN_VIEW + 1
|
||||||
|
COLUMN_INT_ID = COLUMN_BOLD + 1
|
||||||
|
|
||||||
|
_INT_ID_COL= 0
|
||||||
|
_ID_COL = 1
|
||||||
|
_GENDER_COL= 2
|
||||||
|
_NAME_COL = 3
|
||||||
|
_DEATH_COL = 6
|
||||||
|
_BIRTH_COL = 7
|
||||||
|
_FAMILY_COL= 9
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -194,8 +203,8 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
self.row_inserted(mypath,self.get_iter(mypath))
|
self.row_inserted(mypath,self.get_iter(mypath))
|
||||||
|
|
||||||
def byname(self,f,s):
|
def byname(self,f,s):
|
||||||
n1 = self.db.person_map.get(str(f))[2].get_sort_name()
|
n1 = self.db.person_map.get(str(f))[_NAME_COL].get_sort_name()
|
||||||
n2 = self.db.person_map.get(str(s))[2].get_sort_name()
|
n2 = self.db.person_map.get(str(s))[_NAME_COL].get_sort_name()
|
||||||
return cmp(n1,n2)
|
return cmp(n1,n2)
|
||||||
|
|
||||||
def on_get_flags(self):
|
def on_get_flags(self):
|
||||||
@ -203,7 +212,7 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
return gtk.TREE_MODEL_ITERS_PERSIST
|
return gtk.TREE_MODEL_ITERS_PERSIST
|
||||||
|
|
||||||
def on_get_n_columns(self):
|
def on_get_n_columns(self):
|
||||||
return 9
|
return COLUMN_INT_ID + 1
|
||||||
|
|
||||||
def on_get_path(self, node):
|
def on_get_path(self, node):
|
||||||
'''returns the tree path (a tuple of indices at the various
|
'''returns the tree path (a tuple of indices at the various
|
||||||
@ -235,7 +244,9 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def on_get_value(self,iter,col):
|
def on_get_value(self,iter,col):
|
||||||
if col == COLUMN_BOLD:
|
if col == COLUMN_INT_ID:
|
||||||
|
return iter
|
||||||
|
elif col == COLUMN_BOLD:
|
||||||
if self.top_iter2path.has_key(iter):
|
if self.top_iter2path.has_key(iter):
|
||||||
return pango.WEIGHT_BOLD
|
return pango.WEIGHT_BOLD
|
||||||
else:
|
else:
|
||||||
@ -318,47 +329,47 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def sort_name(self,data):
|
def sort_name(self,data):
|
||||||
return data[2].get_sort_name()
|
return data[_NAME_COL].get_sort_name()
|
||||||
|
|
||||||
def column_spouse(self,data):
|
def column_spouse(self,data):
|
||||||
id = data[0]
|
id = data[0]
|
||||||
if data[8]:
|
if data[_FAMILY_COL]:
|
||||||
fid = data[8][0]
|
fid = data[_FAMILY_COL][0]
|
||||||
else:
|
else:
|
||||||
return u""
|
return u""
|
||||||
d2 = self.db.family_map.get(str(fid))
|
d2 = self.db.family_map.get(str(fid))
|
||||||
if fid and d2 :
|
if fid and d2 :
|
||||||
if d2[1] == id:
|
if d2[1] == id:
|
||||||
return self.db.person_map.get(str(d2[2]))[2].get_name()
|
return self.db.person_map.get(str(d2[2]))[_NAME_COL].get_name()
|
||||||
else:
|
else:
|
||||||
return self.db.person_map.get(str(d2[1]))[2].get_name()
|
return self.db.person_map.get(str(d2[1]))[_NAME_COL].get_name()
|
||||||
else:
|
else:
|
||||||
return u""
|
return u""
|
||||||
|
|
||||||
def column_name(self,data):
|
def column_name(self,data):
|
||||||
return data[2].get_name()
|
return data[_NAME_COL].get_name()
|
||||||
|
|
||||||
def column_id(self,data):
|
def column_id(self,data):
|
||||||
return data[0]
|
return data[_ID_COL]
|
||||||
|
|
||||||
def column_gender(self,data):
|
def column_gender(self,data):
|
||||||
return _GENDER[data[1]]
|
return _GENDER[data[_GENDER_COL]]
|
||||||
|
|
||||||
def column_birth_day(self,data):
|
def column_birth_day(self,data):
|
||||||
if data[6]:
|
if data[_BIRTH_COL]:
|
||||||
return self.db.find_event_from_id(data[6]).get_date()
|
return self.db.find_event_from_id(data[_BIRTH_COL]).get_date()
|
||||||
else:
|
else:
|
||||||
return u""
|
return u""
|
||||||
|
|
||||||
def column_death_day(self,data):
|
def column_death_day(self,data):
|
||||||
if data[5]:
|
if data[_DEATH_COL]:
|
||||||
return self.db.find_event_from_id(data[5]).get_date()
|
return self.db.find_event_from_id(data[_DEATH_COL]).get_date()
|
||||||
else:
|
else:
|
||||||
return u""
|
return u""
|
||||||
|
|
||||||
def column_birth_place(self,data):
|
def column_birth_place(self,data):
|
||||||
if data[6]:
|
if data[_BIRTH_COL]:
|
||||||
event = self.db.find_event_from_id(data[6])
|
event = self.db.find_event_from_id(data[_BIRTH_COL])
|
||||||
if event:
|
if event:
|
||||||
place_id = event.get_place_id()
|
place_id = event.get_place_id()
|
||||||
if place_id:
|
if place_id:
|
||||||
@ -366,8 +377,8 @@ class PeopleModel(gtk.GenericTreeModel):
|
|||||||
return u""
|
return u""
|
||||||
|
|
||||||
def column_death_place(self,data):
|
def column_death_place(self,data):
|
||||||
if data[5]:
|
if data[_DEATH_COL]:
|
||||||
event = self.db.find_event_from_id(data[5])
|
event = self.db.find_event_from_id(data[_DEATH_COL])
|
||||||
if event:
|
if event:
|
||||||
place_id = event.get_place_id()
|
place_id = event.get_place_id()
|
||||||
if place_id:
|
if place_id:
|
||||||
|
@ -130,7 +130,7 @@ class PeopleView:
|
|||||||
self.person_tree.set_model(self.sort_model)
|
self.person_tree.set_model(self.sort_model)
|
||||||
|
|
||||||
def blist(self, store, path, iter, id_list):
|
def blist(self, store, path, iter, id_list):
|
||||||
id_list.append(self.sort_model.get_value(iter,1))
|
id_list.append(self.sort_model.get_value(iter,PeopleModel.COLUMN_INT_ID))
|
||||||
|
|
||||||
def get_selected_objects(self):
|
def get_selected_objects(self):
|
||||||
mlist = []
|
mlist = []
|
||||||
|
@ -30,6 +30,7 @@ import os
|
|||||||
import gtk
|
import gtk
|
||||||
import shutil
|
import shutil
|
||||||
import xml.parsers.expat
|
import xml.parsers.expat
|
||||||
|
import Utils
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -128,8 +129,6 @@ def importData(database, filename, callback=None,cl=0):
|
|||||||
ErrorDialog(_("Error reading %s") % filename,
|
ErrorDialog(_("Error reading %s") % filename,
|
||||||
_("The file is probably either corrupt or not a valid GRAMPS database."))
|
_("The file is probably either corrupt or not a valid GRAMPS database."))
|
||||||
return 0
|
return 0
|
||||||
except ValueError, msg:
|
|
||||||
pass
|
|
||||||
except:
|
except:
|
||||||
if cl:
|
if cl:
|
||||||
import traceback
|
import traceback
|
||||||
@ -273,6 +272,7 @@ class GrampsParser:
|
|||||||
self.note_list = []
|
self.note_list = []
|
||||||
self.tlist = []
|
self.tlist = []
|
||||||
self.conf = 2
|
self.conf = 2
|
||||||
|
self.gid2id = {}
|
||||||
|
|
||||||
self.ord = None
|
self.ord = None
|
||||||
self.objref = None
|
self.objref = None
|
||||||
@ -323,6 +323,7 @@ class GrampsParser:
|
|||||||
self.func_index = 0
|
self.func_index = 0
|
||||||
self.func = None
|
self.func = None
|
||||||
self.witness_comment = ""
|
self.witness_comment = ""
|
||||||
|
self.idswap = {}
|
||||||
|
|
||||||
self.func_map = {
|
self.func_map = {
|
||||||
"address" : (self.start_address, self.stop_address),
|
"address" : (self.start_address, self.stop_address),
|
||||||
@ -407,6 +408,28 @@ class GrampsParser:
|
|||||||
"url" : (self.start_url, None)
|
"url" : (self.start_url, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def find_person_by_gramps_id(self,gramps_id):
|
||||||
|
person = RelLib.Person()
|
||||||
|
intid = self.gid2id.get(gramps_id)
|
||||||
|
if intid:
|
||||||
|
person.unserialize(self.db.person_map.get(intid))
|
||||||
|
else:
|
||||||
|
intid = Utils.create_id()
|
||||||
|
person.set_id(intid)
|
||||||
|
person.set_gramps_id(gramps_id)
|
||||||
|
self.db.add_person_as(person,self.trans)
|
||||||
|
self.gid2id[gramps_id] = intid
|
||||||
|
return person
|
||||||
|
|
||||||
|
def map_gid(self,id):
|
||||||
|
if self.idswap.get(id):
|
||||||
|
return self.idswap[id]
|
||||||
|
else:
|
||||||
|
if self.db.idtrans.get(str(id)):
|
||||||
|
self.idswap[id] = self.db.find_next_gid()
|
||||||
|
else:
|
||||||
|
self.idswap[id] = id
|
||||||
|
return self.idswap[id]
|
||||||
|
|
||||||
def parse(self,file):
|
def parse(self,file):
|
||||||
self.trans = self.db.start_transaction()
|
self.trans = self.db.start_transaction()
|
||||||
@ -419,8 +442,9 @@ class GrampsParser:
|
|||||||
self.db.set_researcher(self.owner)
|
self.db.set_researcher(self.owner)
|
||||||
if self.tempDefault != None:
|
if self.tempDefault != None:
|
||||||
id = self.tempDefault
|
id = self.tempDefault
|
||||||
if self.db.has_person_id(id) and self.db.get_default_person() == None:
|
person = self.db.try_to_find_person_from_gramps_id(id)
|
||||||
self.db.set_default_person_id(id)
|
if person:
|
||||||
|
self.db.set_default_person_id(person.get_id())
|
||||||
|
|
||||||
for key in self.func_map.keys():
|
for key in self.func_map.keys():
|
||||||
del self.func_map[key]
|
del self.func_map[key]
|
||||||
@ -450,7 +474,7 @@ class GrampsParser:
|
|||||||
self.ord.set_status(int(attrs['val']))
|
self.ord.set_status(int(attrs['val']))
|
||||||
|
|
||||||
def start_sealed_to(self,attrs):
|
def start_sealed_to(self,attrs):
|
||||||
id = attrs['ref']
|
id = self.map_gid(attrs['ref'])
|
||||||
self.ord.set_family_id(self.db.find_family_no_map(id,self.trans))
|
self.ord.set_family_id(self.db.find_family_no_map(id,self.trans))
|
||||||
|
|
||||||
def start_place(self,attrs):
|
def start_place(self,attrs):
|
||||||
@ -498,7 +522,7 @@ class GrampsParser:
|
|||||||
def start_witness(self,attrs):
|
def start_witness(self,attrs):
|
||||||
self.in_witness = 1
|
self.in_witness = 1
|
||||||
if attrs.has_key('ref'):
|
if attrs.has_key('ref'):
|
||||||
self.witness = RelLib.Witness(RelLib.Event.ID,attrs['ref'])
|
self.witness = RelLib.Witness(RelLib.Event.ID,self.map_gid(attrs['ref']))
|
||||||
if attrs.has_key('name'):
|
if attrs.has_key('name'):
|
||||||
self.witness = RelLib.Witness(RelLib.Event.NAME,attrs['name'])
|
self.witness = RelLib.Witness(RelLib.Event.NAME,attrs['name'])
|
||||||
|
|
||||||
@ -553,16 +577,16 @@ class GrampsParser:
|
|||||||
self.address.private = int(attrs["priv"])
|
self.address.private = int(attrs["priv"])
|
||||||
|
|
||||||
def start_bmark(self,attrs):
|
def start_bmark(self,attrs):
|
||||||
person = self.db.find_person_no_conflicts(attrs["ref"],
|
person = self.find_person_by_gramps_id(self.map_gid(attrs["ref"]))
|
||||||
self.pmap,self.trans)
|
|
||||||
self.db.bookmarks.append(person.get_id())
|
self.db.bookmarks.append(person.get_id())
|
||||||
|
|
||||||
def start_person(self,attrs):
|
def start_person(self,attrs):
|
||||||
if self.callback != None and self.count % self.increment == 0:
|
if self.callback != None and self.count % self.increment == 0:
|
||||||
self.callback(float(self.count)/float(self.entries))
|
self.callback(float(self.count)/float(self.entries))
|
||||||
self.count = self.count + 1
|
self.count = self.count + 1
|
||||||
self.person = self.db.find_person_no_conflicts(attrs["id"],
|
|
||||||
self.pmap, self.trans)
|
self.person = self.find_person_by_gramps_id(self.map_gid(attrs['id']))
|
||||||
|
|
||||||
if attrs.has_key("complete"):
|
if attrs.has_key("complete"):
|
||||||
self.person.set_complete(int(attrs['complete']))
|
self.person.set_complete(int(attrs['complete']))
|
||||||
else:
|
else:
|
||||||
@ -573,16 +597,18 @@ class GrampsParser:
|
|||||||
self.tempDefault = attrs["default"]
|
self.tempDefault = attrs["default"]
|
||||||
|
|
||||||
def start_father(self,attrs):
|
def start_father(self,attrs):
|
||||||
self.family.set_father_id(attrs["ref"])
|
person = self.db.try_to_find_person_from_gramps_id(self.map_gid(attrs["ref"]))
|
||||||
|
self.family.set_father_id(person.get_id())
|
||||||
|
|
||||||
def start_mother(self,attrs):
|
def start_mother(self,attrs):
|
||||||
self.family.set_mother_id(attrs["ref"])
|
person = self.db.try_to_find_person_from_gramps_id(self.map_gid(attrs["ref"]))
|
||||||
|
self.family.set_mother_id(person.get_id())
|
||||||
|
|
||||||
def start_child(self,attrs):
|
def start_child(self,attrs):
|
||||||
self.family.add_child_id(attrs["ref"])
|
person = self.db.try_to_find_person_from_gramps_id(self.map_gid(attrs["ref"]))
|
||||||
|
self.family.add_child_id(person.get_id())
|
||||||
|
|
||||||
def start_url(self,attrs):
|
def start_url(self,attrs):
|
||||||
|
|
||||||
if not attrs.has_key("href"):
|
if not attrs.has_key("href"):
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
|
104
src/RelLib.py
104
src/RelLib.py
@ -45,6 +45,7 @@ import cPickle
|
|||||||
from Date import Date, SingleDate, compare_dates, not_too_old
|
from Date import Date, SingleDate, compare_dates, not_too_old
|
||||||
import GrampsCfg
|
import GrampsCfg
|
||||||
import const
|
import const
|
||||||
|
import Utils
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -359,7 +360,7 @@ class Place(SourceNote):
|
|||||||
def get_id(self):
|
def get_id(self):
|
||||||
"""Returns the gramps ID for the place object"""
|
"""Returns the gramps ID for the place object"""
|
||||||
return self.id
|
return self.id
|
||||||
|
|
||||||
def set_title(self,name):
|
def set_title(self,name):
|
||||||
"""Sets the title of the place object"""
|
"""Sets the title of the place object"""
|
||||||
self.title = name
|
self.title = name
|
||||||
@ -1145,6 +1146,7 @@ class Person(SourceNote):
|
|||||||
"""creates a new Person instance"""
|
"""creates a new Person instance"""
|
||||||
SourceNote.__init__(self)
|
SourceNote.__init__(self)
|
||||||
self.id = gid
|
self.id = gid
|
||||||
|
self.gid = ""
|
||||||
self.primary_name = Name()
|
self.primary_name = Name()
|
||||||
self.event_list = []
|
self.event_list = []
|
||||||
self.family_list = []
|
self.family_list = []
|
||||||
@ -1170,7 +1172,7 @@ class Person(SourceNote):
|
|||||||
self.db = None
|
self.db = None
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
return (self.id, self.gender,
|
return (self.id, self.gid, self.gender,
|
||||||
self.primary_name, self.alternate_names, self.nickname,
|
self.primary_name, self.alternate_names, self.nickname,
|
||||||
self.death_id, self.birth_id, self.event_list,
|
self.death_id, self.birth_id, self.event_list,
|
||||||
self.family_list, self.parent_family_list,
|
self.family_list, self.parent_family_list,
|
||||||
@ -1184,7 +1186,7 @@ class Person(SourceNote):
|
|||||||
self.note)
|
self.note)
|
||||||
|
|
||||||
def unserialize(self,data):
|
def unserialize(self,data):
|
||||||
(self.id, self.gender,
|
(self.id, self.gid, self.gender,
|
||||||
self.primary_name, self.alternate_names, self.nickname,
|
self.primary_name, self.alternate_names, self.nickname,
|
||||||
self.death_id, self.birth_id, self.event_list,
|
self.death_id, self.birth_id, self.event_list,
|
||||||
self.family_list, self.parent_family_list,
|
self.family_list, self.parent_family_list,
|
||||||
@ -1211,7 +1213,7 @@ class Person(SourceNote):
|
|||||||
bday = self.birth_id
|
bday = self.birth_id
|
||||||
dday = self.death_id
|
dday = self.death_id
|
||||||
return [ GrampsCfg.display_name(self),
|
return [ GrampsCfg.display_name(self),
|
||||||
self.id,
|
self.gid,
|
||||||
gender,
|
gender,
|
||||||
bday,
|
bday,
|
||||||
dday,
|
dday,
|
||||||
@ -1261,6 +1263,14 @@ class Person(SourceNote):
|
|||||||
"""adds a URL instance to the list"""
|
"""adds a URL instance to the list"""
|
||||||
self.urls.append(url)
|
self.urls.append(url)
|
||||||
|
|
||||||
|
def set_gramps_id(self,gid):
|
||||||
|
"""sets the gramps ID for the Person"""
|
||||||
|
self.gid = str(gid)
|
||||||
|
|
||||||
|
def get_gramps_id(self):
|
||||||
|
"""returns the gramps ID for the Person"""
|
||||||
|
return self.gid
|
||||||
|
|
||||||
def set_id(self,gid):
|
def set_id(self,gid):
|
||||||
"""sets the gramps ID for the Person"""
|
"""sets the gramps ID for the Person"""
|
||||||
self.id = str(gid)
|
self.id = str(gid)
|
||||||
@ -2350,7 +2360,10 @@ except ImportError: # try python2.2
|
|||||||
|
|
||||||
|
|
||||||
def find_surname(key,data):
|
def find_surname(key,data):
|
||||||
return str(data[2].get_surname())
|
return str(data[3].get_surname())
|
||||||
|
|
||||||
|
def find_idmap(key,data):
|
||||||
|
return str(data[1])
|
||||||
|
|
||||||
def find_eventname(key,data):
|
def find_eventname(key,data):
|
||||||
return str(data[1])
|
return str(data[1])
|
||||||
@ -2424,11 +2437,15 @@ class GrampsDB:
|
|||||||
self.surnames.set_flags(db.DB_DUP)
|
self.surnames.set_flags(db.DB_DUP)
|
||||||
self.surnames.open(name, "surnames", db.DB_HASH, flags=db.DB_CREATE)
|
self.surnames.open(name, "surnames", db.DB_HASH, flags=db.DB_CREATE)
|
||||||
|
|
||||||
|
self.idtrans = db.DB(self.env)
|
||||||
|
self.idtrans.set_flags(db.DB_DUP)
|
||||||
|
self.idtrans.open(name, "idtrans", db.DB_HASH, flags=db.DB_CREATE)
|
||||||
|
|
||||||
self.eventnames = db.DB(self.env)
|
self.eventnames = db.DB(self.env)
|
||||||
self.eventnames.set_flags(db.DB_DUP)
|
self.eventnames.set_flags(db.DB_DUP)
|
||||||
self.eventnames.open(name, "eventnames", db.DB_HASH, flags=db.DB_CREATE)
|
self.eventnames.open(name, "eventnames", db.DB_HASH, flags=db.DB_CREATE)
|
||||||
|
|
||||||
self.person_map.associate(self.surnames, find_surname, db.DB_CREATE)
|
self.person_map.associate(self.surnames, find_surname, db.DB_CREATE)
|
||||||
|
self.person_map.associate(self.idtrans, find_idmap, db.DB_CREATE)
|
||||||
self.event_map.associate(self.eventnames, find_eventname, db.DB_CREATE)
|
self.event_map.associate(self.eventnames, find_eventname, db.DB_CREATE)
|
||||||
|
|
||||||
self.undodb = db.DB()
|
self.undodb = db.DB()
|
||||||
@ -2439,6 +2456,14 @@ class GrampsDB:
|
|||||||
self.bookmarks = []
|
self.bookmarks = []
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
def find_next_gid(self):
|
||||||
|
index = self.iprefix % self.pmap_index
|
||||||
|
while self.idtrans.get(str(index)):
|
||||||
|
self.pmap_index += 1
|
||||||
|
index = self.iprefix % self.pmap_index
|
||||||
|
self.pmap_index += 1
|
||||||
|
return index
|
||||||
|
|
||||||
def get_people_view_maps(self):
|
def get_people_view_maps(self):
|
||||||
if self.metadata:
|
if self.metadata:
|
||||||
return (self.metadata.get('tp_iter'),
|
return (self.metadata.get('tp_iter'),
|
||||||
@ -2468,6 +2493,7 @@ class GrampsDB:
|
|||||||
self.metadata.close()
|
self.metadata.close()
|
||||||
self.surnames.close()
|
self.surnames.close()
|
||||||
self.eventnames.close()
|
self.eventnames.close()
|
||||||
|
self.idtrans.close()
|
||||||
self.env.close()
|
self.env.close()
|
||||||
self.undodb.close()
|
self.undodb.close()
|
||||||
|
|
||||||
@ -2532,22 +2558,22 @@ class GrampsDB:
|
|||||||
def get_person_display(self,key):
|
def get_person_display(self,key):
|
||||||
data = self.person_map.get(str(key))
|
data = self.person_map.get(str(key))
|
||||||
|
|
||||||
if data[1] == Person.male:
|
if data[2] == Person.male:
|
||||||
gender = const.male
|
gender = const.male
|
||||||
elif data[1] == Person.female:
|
elif data[2] == Person.female:
|
||||||
gender = const.female
|
gender = const.female
|
||||||
else:
|
else:
|
||||||
gender = const.unknown
|
gender = const.unknown
|
||||||
|
|
||||||
return [ data[2].get_name(),
|
return [ data[3].get_name(),
|
||||||
data[0],
|
data[1],
|
||||||
gender,
|
gender,
|
||||||
|
data[7],
|
||||||
data[6],
|
data[6],
|
||||||
data[5],
|
data[3].get_sort_name(),
|
||||||
data[2].get_sort_name(),
|
data[7],
|
||||||
data[6],
|
data[6],
|
||||||
data[5],
|
GrampsCfg.display_surname(data[3])]
|
||||||
GrampsCfg.display_surname(data[2])]
|
|
||||||
|
|
||||||
def commit_person(self,person,transaction):
|
def commit_person(self,person,transaction):
|
||||||
gid = str(person.get_id())
|
gid = str(person.get_id())
|
||||||
@ -2913,17 +2939,13 @@ class GrampsDB:
|
|||||||
|
|
||||||
def add_person(self,person,trans):
|
def add_person(self,person,trans):
|
||||||
"""adds a Person to the database, assigning a gramps' ID"""
|
"""adds a Person to the database, assigning a gramps' ID"""
|
||||||
index = self.iprefix % self.pmap_index
|
person.set_gramps_id(self.find_next_gid())
|
||||||
while self.person_map.get(str(index)):
|
person.set_id(Utils.create_id())
|
||||||
self.pmap_index = self.pmap_index + 1
|
|
||||||
index = self.iprefix % self.pmap_index
|
|
||||||
person.set_id(index)
|
|
||||||
if trans != None:
|
if trans != None:
|
||||||
trans.add(PERSON_KEY, person.get_id(),None)
|
trans.add(PERSON_KEY, person.get_id(),None)
|
||||||
self.person_map.put(str(index),person.serialize())
|
self.person_map.put(str(person.get_id()),person.serialize())
|
||||||
self.pmap_index = self.pmap_index + 1
|
|
||||||
self.genderStats.count_person (person, self)
|
self.genderStats.count_person (person, self)
|
||||||
return index
|
return person.get_id()
|
||||||
|
|
||||||
def find_person(self,gid,map,trans):
|
def find_person(self,gid,map,trans):
|
||||||
"""finds a Person in the database using the gid and map
|
"""finds a Person in the database using the gid and map
|
||||||
@ -2955,7 +2977,6 @@ class GrampsDB:
|
|||||||
If no such Person exists, a new Person is added to the database."""
|
If no such Person exists, a new Person is added to the database."""
|
||||||
|
|
||||||
data = self.person_map.get(str(val))
|
data = self.person_map.get(str(val))
|
||||||
|
|
||||||
if data:
|
if data:
|
||||||
person = Person()
|
person = Person()
|
||||||
person.unserialize(data)
|
person.unserialize(data)
|
||||||
@ -2963,6 +2984,18 @@ class GrampsDB:
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
def try_to_find_person_from_gramps_id(self,val):
|
||||||
|
"""finds a Person in the database from the passed gramps' ID.
|
||||||
|
If no such Person exists, a new Person is added to the database."""
|
||||||
|
|
||||||
|
data = self.idtrans.get(str(val))
|
||||||
|
if data:
|
||||||
|
person = Person()
|
||||||
|
person.unserialize(cPickle.loads(data))
|
||||||
|
return person
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def find_person_from_id(self,val,trans):
|
def find_person_from_id(self,val,trans):
|
||||||
"""finds a Person in the database from the passed gramps' ID.
|
"""finds a Person in the database from the passed gramps' ID.
|
||||||
If no such Person exists, a new Person is added to the database."""
|
If no such Person exists, a new Person is added to the database."""
|
||||||
@ -2976,7 +3009,6 @@ class GrampsDB:
|
|||||||
if trans != None:
|
if trans != None:
|
||||||
trans.add(PERSON_KEY, val, None)
|
trans.add(PERSON_KEY, val, None)
|
||||||
self.person_map.put(str(val), person.serialize())
|
self.person_map.put(str(val), person.serialize())
|
||||||
self.pmap_index = self.pmap_index+1
|
|
||||||
# self.genderStats.count_person (person, self)
|
# self.genderStats.count_person (person, self)
|
||||||
return person
|
return person
|
||||||
|
|
||||||
@ -2988,7 +3020,6 @@ class GrampsDB:
|
|||||||
if trans != None:
|
if trans != None:
|
||||||
trans.add(PERSON_KEY, gid, None)
|
trans.add(PERSON_KEY, gid, None)
|
||||||
self.person_map.set(str(gid),person.serialize())
|
self.person_map.set(str(gid),person.serialize())
|
||||||
self.pmap_index = self.pmap_index+1
|
|
||||||
# self.genderStats.count_person (person, self)
|
# self.genderStats.count_person (person, self)
|
||||||
return gid
|
return gid
|
||||||
|
|
||||||
@ -3032,7 +3063,6 @@ class GrampsDB:
|
|||||||
|
|
||||||
def add_event_no_map(self,event,index,trans):
|
def add_event_no_map(self,event,index,trans):
|
||||||
"""adds a Source to the database if the gramps' ID is known"""
|
"""adds a Source to the database if the gramps' ID is known"""
|
||||||
return
|
|
||||||
event.set_id(index)
|
event.set_id(index)
|
||||||
if trans != None:
|
if trans != None:
|
||||||
trans.add(EVENT_KEY,index,None)
|
trans.add(EVENT_KEY,index,None)
|
||||||
@ -3476,26 +3506,6 @@ class GrampsDB:
|
|||||||
trans.add(FAMILY_KEY,family_id,old_data)
|
trans.add(FAMILY_KEY,family_id,old_data)
|
||||||
self.family_map.delete(str(family_id))
|
self.family_map.delete(str(family_id))
|
||||||
|
|
||||||
def find_person_no_conflicts(self,gid,map,trans):
|
|
||||||
"""finds a Person in the database using the gid and map
|
|
||||||
variables to translate between the external ID and gramps'
|
|
||||||
internal ID. If no such Person exists, a new Person instance
|
|
||||||
is created.
|
|
||||||
|
|
||||||
gid - external ID number
|
|
||||||
map - map build by findPerson of external to gramp's IDs"""
|
|
||||||
|
|
||||||
person = Person()
|
|
||||||
if map.has_key(gid):
|
|
||||||
person.unserialize(self.person_map.get(str(map[gid])))
|
|
||||||
else:
|
|
||||||
if self.person_map.get(str(gid)):
|
|
||||||
map[gid] = self.add_person(person,trans)
|
|
||||||
else:
|
|
||||||
person.set_id(gid)
|
|
||||||
map[gid] = self.add_person_as(person,trans)
|
|
||||||
return person
|
|
||||||
|
|
||||||
def find_family_no_conflicts(self,gid,map,trans):
|
def find_family_no_conflicts(self,gid,map,trans):
|
||||||
"""finds a Family in the database using the gid and map
|
"""finds a Family in the database using the gid and map
|
||||||
variables to translate between the external ID and gramps'
|
variables to translate between the external ID and gramps'
|
||||||
|
@ -262,7 +262,7 @@ class SelectChild:
|
|||||||
self.add_child.scroll_to_cell(path,col,1,0.5,0.0)
|
self.add_child.scroll_to_cell(path,col,1,0.5,0.0)
|
||||||
|
|
||||||
def select_function(self,store,path,iter,id_list):
|
def select_function(self,store,path,iter,id_list):
|
||||||
id_list.append(self.refmodel.get_value(iter,1))
|
id_list.append(self.refmodel.get_value(iter,PeopleModel.COLUMN_INT_ID))
|
||||||
|
|
||||||
def get_selected_ids(self):
|
def get_selected_ids(self):
|
||||||
mlist = []
|
mlist = []
|
||||||
@ -425,8 +425,9 @@ class EditRel:
|
|||||||
})
|
})
|
||||||
|
|
||||||
f = self.child.has_family(self.family.get_id())
|
f = self.child.has_family(self.family.get_id())
|
||||||
self.fentry.set_text(_(f[2]))
|
if f:
|
||||||
self.mentry.set_text(_(f[1]))
|
self.fentry.set_text(_(f[2]))
|
||||||
|
self.mentry.set_text(_(f[1]))
|
||||||
|
|
||||||
self.fdesc.set_use_markup(gtk.TRUE)
|
self.fdesc.set_use_markup(gtk.TRUE)
|
||||||
self.mdesc.set_use_markup(gtk.TRUE)
|
self.mdesc.set_use_markup(gtk.TRUE)
|
||||||
|
14
src/Utils.py
14
src/Utils.py
@ -28,6 +28,7 @@
|
|||||||
import string
|
import string
|
||||||
import os
|
import os
|
||||||
import locale
|
import locale
|
||||||
|
import time
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -53,6 +54,15 @@ import GrampsMime
|
|||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
from gettext import gettext as _
|
from gettext import gettext as _
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Random
|
||||||
|
#
|
||||||
|
#-------------------------------------------------------------------------
|
||||||
|
import random
|
||||||
|
|
||||||
|
rand = random.Random(time.time())
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
# modified flag
|
# modified flag
|
||||||
@ -527,3 +537,7 @@ def unbold_label(label):
|
|||||||
label.set_text(text)
|
label.set_text(text)
|
||||||
label.set_use_markup(0)
|
label.set_use_markup(0)
|
||||||
|
|
||||||
|
def create_id():
|
||||||
|
return str("%08x%08x" % (
|
||||||
|
int(time.time()*10000),
|
||||||
|
rand.randint(0,0x7fffffff)))
|
||||||
|
@ -142,13 +142,15 @@ dist_pkgdata_DATA = gedcom.xml \
|
|||||||
papersize.xml \
|
papersize.xml \
|
||||||
tips.xml \
|
tips.xml \
|
||||||
gnome-mime-application-x-gramps.png \
|
gnome-mime-application-x-gramps.png \
|
||||||
|
gnome-mime-application-x-gedcom.png \
|
||||||
|
gnome-mime-application-x-gramps-package.png \
|
||||||
gramps.applications \
|
gramps.applications \
|
||||||
gramps.desktop \
|
gramps.desktop \
|
||||||
gramps.svg \
|
gramps.svg \
|
||||||
gramps.keys \
|
gramps.keys \
|
||||||
gramps.mime
|
gramps.mime
|
||||||
|
|
||||||
EXTRA_DIST = $(pkgdata_DATA)
|
EXTRA_DIST = $(dist_pkgdata_DATA)
|
||||||
all: all-recursive
|
all: all-recursive
|
||||||
|
|
||||||
.SUFFIXES:
|
.SUFFIXES:
|
||||||
@ -460,7 +462,7 @@ install-data-local:
|
|||||||
$(INSTALL) -d $(DESTDIR)$(prefix)/share/gnome/apps/Applications
|
$(INSTALL) -d $(DESTDIR)$(prefix)/share/gnome/apps/Applications
|
||||||
$(INSTALL_DATA) gramps.desktop $(DESTDIR)$(prefix)/share/applications
|
$(INSTALL_DATA) gramps.desktop $(DESTDIR)$(prefix)/share/applications
|
||||||
$(INSTALL) -d $(DESTDIR)$(prefix)/share/icons/gnome/48x48/mimetypes/
|
$(INSTALL) -d $(DESTDIR)$(prefix)/share/icons/gnome/48x48/mimetypes/
|
||||||
$(INSTALL_DATA) gnome-mime-application-x-gramps.png $(DESTDIR)$(prefix)/share/icons/gnome/48x48/mimetypes/
|
$(INSTALL_DATA) gnome-mime-application-x-*.png $(DESTDIR)$(prefix)/share/icons/gnome/48x48/mimetypes/
|
||||||
$(INSTALL) -d $(DESTDIR)$(prefix)/share/application-registry
|
$(INSTALL) -d $(DESTDIR)$(prefix)/share/application-registry
|
||||||
$(INSTALL_DATA) gramps.applications $(DESTDIR)$(prefix)/share/application-registry
|
$(INSTALL_DATA) gramps.applications $(DESTDIR)$(prefix)/share/application-registry
|
||||||
$(INSTALL) -d $(DESTDIR)$(prefix)/share/mime/packages
|
$(INSTALL) -d $(DESTDIR)$(prefix)/share/mime/packages
|
||||||
|
@ -906,49 +906,11 @@ class Gramps:
|
|||||||
|
|
||||||
def on_new_clicked(self,obj):
|
def on_new_clicked(self,obj):
|
||||||
"""Prompt for permission to close the current database"""
|
"""Prompt for permission to close the current database"""
|
||||||
|
|
||||||
QuestionDialog(_('Create a New Database'),
|
|
||||||
_('Creating a new database will close the existing database, '
|
|
||||||
'discarding any unsaved changes. You will then be prompted '
|
|
||||||
'to create a new database'),
|
|
||||||
_('_Create New Database'),
|
|
||||||
self.new_database_response,self.topWindow)
|
|
||||||
|
|
||||||
def new_database_response(self):
|
|
||||||
DbPrompter.DbPrompter(self,1,self.topWindow)
|
DbPrompter.DbPrompter(self,1,self.topWindow)
|
||||||
|
|
||||||
def clear_database(self):
|
def clear_database(self):
|
||||||
"""Clear out the database if permission was granted"""
|
"""Clear out the database if permission was granted"""
|
||||||
|
|
||||||
return
|
return
|
||||||
const.personalEvents = const.init_personal_event_list()
|
|
||||||
const.personalAttributes = const.init_personal_attribute_list()
|
|
||||||
const.marriageEvents = const.init_marriage_event_list()
|
|
||||||
const.familyAttributes = const.init_family_attribute_list()
|
|
||||||
const.familyRelations = const.init_family_relation_list()
|
|
||||||
|
|
||||||
self.history = []
|
|
||||||
self.mhistory = []
|
|
||||||
self.hindex = -1
|
|
||||||
self.redraw_histmenu()
|
|
||||||
|
|
||||||
self.relationship.set_db(self.db)
|
|
||||||
|
|
||||||
self.place_view.change_db(self.db)
|
|
||||||
self.people_view.change_db(self.db)
|
|
||||||
self.source_view.change_db(self.db)
|
|
||||||
self.media_view.change_db(self.db)
|
|
||||||
|
|
||||||
if not self.cl:
|
|
||||||
self.topWindow.set_title("GRAMPS")
|
|
||||||
self.active_person = None
|
|
||||||
|
|
||||||
self.change_active_person(None)
|
|
||||||
self.people_view.clear()
|
|
||||||
self.family_view.clear()
|
|
||||||
self.family_view.load_family()
|
|
||||||
self.pedigree_view.clear()
|
|
||||||
self.media_view.load_media()
|
|
||||||
|
|
||||||
def tool_callback(self,val):
|
def tool_callback(self,val):
|
||||||
if val:
|
if val:
|
||||||
@ -1434,7 +1396,7 @@ class Gramps:
|
|||||||
else:
|
else:
|
||||||
if GrampsCfg.status_bar <= 1:
|
if GrampsCfg.status_bar <= 1:
|
||||||
pname = GrampsCfg.nameof(self.active_person)
|
pname = GrampsCfg.nameof(self.active_person)
|
||||||
name = "[%s] %s" % (self.active_person.get_id(),pname)
|
name = "[%s] %s" % (self.active_person.get_gramps_id(),pname)
|
||||||
else:
|
else:
|
||||||
name = self.display_relationship()
|
name = self.display_relationship()
|
||||||
self.status_text(name)
|
self.status_text(name)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
#
|
#
|
||||||
|
|
||||||
# $Id$
|
v# $Id$
|
||||||
|
|
||||||
"Import from GEDCOM"
|
"Import from GEDCOM"
|
||||||
|
|
||||||
@ -204,7 +204,6 @@ class GedcomParser:
|
|||||||
def __init__(self, dbase, file, window):
|
def __init__(self, dbase, file, window):
|
||||||
self.db = dbase
|
self.db = dbase
|
||||||
self.person = None
|
self.person = None
|
||||||
self.pmap = {}
|
|
||||||
self.fmap = {}
|
self.fmap = {}
|
||||||
self.smap = {}
|
self.smap = {}
|
||||||
self.nmap = {}
|
self.nmap = {}
|
||||||
@ -219,6 +218,7 @@ class GedcomParser:
|
|||||||
self.broken_conc_list = [ 'FamilyOrigins', 'FTW' ]
|
self.broken_conc_list = [ 'FamilyOrigins', 'FTW' ]
|
||||||
self.broken_conc = 0
|
self.broken_conc = 0
|
||||||
self.is_ftw = 0
|
self.is_ftw = 0
|
||||||
|
self.idswap = {}
|
||||||
|
|
||||||
self.f = open(file,"r")
|
self.f = open(file,"r")
|
||||||
self.filename = file
|
self.filename = file
|
||||||
@ -541,16 +541,18 @@ class GedcomParser:
|
|||||||
else:
|
else:
|
||||||
self.barf(1)
|
self.barf(1)
|
||||||
|
|
||||||
def find_or_create_person(self,id):
|
def map_gid(self,id):
|
||||||
if self.pmap.has_key(id):
|
if self.idswap.get(id):
|
||||||
person = self.db.find_person_from_id(self.pmap[id],self.trans)
|
return self.idswap[id]
|
||||||
elif self.db.has_person_id(id):
|
|
||||||
person = RelLib.Person()
|
|
||||||
self.pmap[id] = self.db.add_person(person,self.trans)
|
|
||||||
else:
|
else:
|
||||||
person = RelLib.Person(id)
|
if self.db.idtrans.get(str(id)):
|
||||||
self.db.add_person_as(person,self.trans)
|
self.idswap[id] = self.db.find_next_gid()
|
||||||
self.pmap[id] = id
|
else:
|
||||||
|
self.idswap[id] = id
|
||||||
|
return self.idswap[id]
|
||||||
|
|
||||||
|
def find_or_create_person(self,id):
|
||||||
|
person = self.db.try_to_find_person_from_gramps_id(self.map_gid(id))
|
||||||
return person
|
return person
|
||||||
|
|
||||||
def parse_cause(self,event,level):
|
def parse_cause(self,event,level):
|
||||||
@ -1719,9 +1721,12 @@ class GedcomParser:
|
|||||||
return source_ref
|
return source_ref
|
||||||
|
|
||||||
def resolve_refns(self):
|
def resolve_refns(self):
|
||||||
|
return
|
||||||
|
|
||||||
prefix = self.db.iprefix
|
prefix = self.db.iprefix
|
||||||
index = 0
|
index = 0
|
||||||
new_pmax = self.db.pmap_index
|
new_pmax = self.db.pmap_index
|
||||||
|
print self.added
|
||||||
for pid in self.added.keys():
|
for pid in self.added.keys():
|
||||||
index = index + 1
|
index = index + 1
|
||||||
if self.refn.has_key(pid):
|
if self.refn.has_key(pid):
|
||||||
@ -1735,6 +1740,7 @@ class GedcomParser:
|
|||||||
if not self.db.has_person_id(new_key):
|
if not self.db.has_person_id(new_key):
|
||||||
self.db.remove_person_id(pid,self.trans)
|
self.db.remove_person_id(pid,self.trans)
|
||||||
person.set_id(new_key)
|
person.set_id(new_key)
|
||||||
|
person.set_gramps_id(new_key)
|
||||||
self.db.add_person(person,self.trans)
|
self.db.add_person(person,self.trans)
|
||||||
else:
|
else:
|
||||||
tp = self.db.find_person_from_id(new_key,self.trans)
|
tp = self.db.find_person_from_id(new_key,self.trans)
|
||||||
@ -1742,6 +1748,7 @@ class GedcomParser:
|
|||||||
if person == tp:
|
if person == tp:
|
||||||
self.db.remove_person_id(pid,self.trans)
|
self.db.remove_person_id(pid,self.trans)
|
||||||
person.set_id(new_key)
|
person.set_id(new_key)
|
||||||
|
person.set_gramps_id(new_key)
|
||||||
self.db.add_person_as(person,self.trans)
|
self.db.add_person_as(person,self.trans)
|
||||||
# give up trying to use the refn as a key
|
# give up trying to use the refn as a key
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user