2006-05-08 Don Allingham <don@gramps-project.org>

* src/GrampsDb/_GrampsDbBase.py: get_default_handle()
	* src/DisplayState.py: use get_default_handle, fix race condition 



svn: r6591
This commit is contained in:
Don Allingham 2006-05-09 04:15:04 +00:00
parent 1dae055ef2
commit 9bc839681b
3 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2006-05-08 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_GrampsDbBase.py: get_default_handle()
* src/DisplayState.py: use get_default_handle, fix race condition
2006-05-08 Alex Roitman <shura@gramps-project.org> 2006-05-08 Alex Roitman <shura@gramps-project.org>
* src/GrampsDb/_GrampsBSDDB.py (load): Better non-TXN support. * src/GrampsDb/_GrampsBSDDB.py (load): Better non-TXN support.
* src/UndoHistory.py (__init__): Rename list to tree. * src/UndoHistory.py (__init__): Rename list to tree.

View File

@ -329,7 +329,7 @@ class DisplayState(GrampsDb.GrampsDBCallback):
pname = NameDisplay.displayer.display(person) pname = NameDisplay.displayer.display(person)
name = "[%s] %s" % (person.get_gramps_id(),pname) name = "[%s] %s" % (person.get_gramps_id(),pname)
if Config.get(Config.STATUSBAR) > 1: if Config.get(Config.STATUSBAR) > 1:
if person.handle != self.dbstate.db.get_default_person().handle: if person.handle != self.dbstate.db.get_default_handle():
msg = self.display_relationship() msg = self.display_relationship()
if msg: if msg:
name = "%s (%s)" % (name,msg) name = "%s (%s)" % (name,msg)

View File

@ -1530,6 +1530,12 @@ class GrampsDbBase(GrampsDBCallback):
return None return None
return None return None
def get_default_handle(self):
"""returns the default Person of the database"""
if self.metadata:
return self.metadata.get('default')
return None
def get_save_path(self): def get_save_path(self):
"""returns the save path of the file, or "" if one does not exist""" """returns the save path of the file, or "" if one does not exist"""
return self.path return self.path