* src/PersonView.py: history

* src/EditPerson.py: start the save routine.


svn: r5871
This commit is contained in:
Don Allingham 2006-02-03 05:31:42 +00:00
parent a7cf78b9b7
commit 64ba0101d4
3 changed files with 11 additions and 27 deletions

View File

@ -1,4 +1,6 @@
2006-02-02 Don Allingham <don@gramps-project.org> 2006-02-02 Don Allingham <don@gramps-project.org>
* src/PersonView.py: history
* src/EditPerson.py: start the save routine.
* src/DdTargets.py: add support for data items in sources * src/DdTargets.py: add support for data items in sources
* src/EventEdit.py: use DisplayTabs * src/EventEdit.py: use DisplayTabs
* src/gramps.glade: New EventEditor with display tabs * src/gramps.glade: New EventEditor with display tabs

View File

@ -93,7 +93,8 @@ class EditPerson(DisplayState.ManagedWindow):
self.dd = DateHandler.displayer self.dd = DateHandler.displayer
self.nd = NameDisplay.displayer self.nd = NameDisplay.displayer
self.orig_handle = person.get_handle() self.person = person
self.orig_handle = self.person.get_handle()
if self.orig_handle: if self.orig_handle:
self.person = state.db.get_person_from_handle(self.orig_handle) self.person = state.db.get_person_from_handle(self.orig_handle)
@ -173,26 +174,16 @@ class EditPerson(DisplayState.ManagedWindow):
self.birth_ref = person.get_birth_ref() self.birth_ref = person.get_birth_ref()
self.death_ref = person.get_death_ref() self.death_ref = person.get_death_ref()
self.pname = RelLib.Name(person.get_primary_name()) self.pname = RelLib.Name(self.person.get_primary_name())
self.gender.set_active(person.get_gender()) self.gender.set_active(self.person.get_gender())
self.nlist = person.get_alternate_names()[:]
self.alist = person.get_attribute_list()[:]
self.ulist = person.get_url_list()[:]
self.plist = person.get_address_list()[:]
if person:
self.srcreflist = person.get_source_references()
else:
self.srcreflist = []
self.place_list = self.pdmap.keys() self.place_list = self.pdmap.keys()
self.place_list.sort() self.place_list.sort()
build_dropdown(self.surname,self.db.get_surname_list()) build_dropdown(self.surname,self.db.get_surname_list())
gid = person.get_gramps_id() gid = self.person.get_gramps_id()
if gid: if gid:
self.gid.set_text(gid) self.gid.set_text(gid)
self.gid.set_editable(True) self.gid.set_editable(True)
@ -459,8 +450,6 @@ class EditPerson(DisplayState.ManagedWindow):
changed = False changed = False
name = self.person.get_primary_name() name = self.person.get_primary_name()
#TODO#if self.complete.get_active() != self.person.get_complete_flag():
# changed = True
if self.private.get_active() != self.person.get_privacy(): if self.private.get_active() != self.person.get_privacy():
changed = True changed = True
@ -727,8 +716,6 @@ class EditPerson(DisplayState.ManagedWindow):
n = self.nd.display(self.person) n = self.nd.display(self.person)
print "title",self.person.primary_name.get_title()
self.db.transaction_commit(trans,_("Edit Person (%s)") % n) self.db.transaction_commit(trans,_("Edit Person (%s)") % n)
self.close() self.close()

View File

@ -415,14 +415,8 @@ class PersonView(PageView.PersonNavView):
#self.remove_from_history(handle) #self.remove_from_history(handle)
self.dbstate.db.remove_person(handle, trans) self.dbstate.db.remove_person(handle, trans)
if self.uistate.phistory.index >= 0: self.uistate.phistory.back()
handle = self.uistate.phistory.history[self.index]
self.active_person = self.dbstate.db.get_person_from_handle(handle)
else:
self.dbstate.change_active_person(None)
self.dbstate.db.transaction_commit(trans,_("Delete Person (%s)") % n) self.dbstate.db.transaction_commit(trans,_("Delete Person (%s)") % n)
#self.redraw_histmenu()
#self.enable_interface()
def build_columns(self): def build_columns(self):
for column in self.columns: for column in self.columns:
@ -492,7 +486,7 @@ class PersonView(PageView.PersonNavView):
for node in handle_list: for node in handle_list:
person = self.dbstate.db.get_person_from_handle(node) person = self.dbstate.db.get_person_from_handle(node)
top = person.get_primary_name().get_group_name() top = person.get_primary_name().get_group_name()
self.model.rebuild_data(self.DataFilter) self.model.rebuild_data()
if not self.model.is_visable(node): if not self.model.is_visable(node):
continue continue
if (not self.model.sname_sub.has_key(top) or if (not self.model.sname_sub.has_key(top) or
@ -520,7 +514,7 @@ class PersonView(PageView.PersonNavView):
self.model.row_deleted(path) self.model.row_deleted(path)
except KeyError: except KeyError:
pass pass
self.model.rebuild_data(self.DataFilter,skip=node) self.model.rebuild_data()
def person_updated(self,handle_list): def person_updated(self,handle_list):
for node in handle_list: for node in handle_list:
@ -551,6 +545,7 @@ class PersonView(PageView.PersonNavView):
# if paths same, just issue row changed signal # if paths same, just issue row changed signal
if oldpath == newpath: if oldpath == newpath:
print "row change", pathval, pnode
self.model.row_changed(pathval,pnode) self.model.row_changed(pathval,pnode)
else: else:
# paths different, get the new surname list # paths different, get the new surname list