4320: Ensure that the initial person is set when clearing history

svn: r16102
This commit is contained in:
Nick Hall 2010-11-01 19:02:32 +00:00
parent 56ed2ce45e
commit 389b9e0935
2 changed files with 7 additions and 6 deletions

View File

@ -82,6 +82,8 @@ class History(gen.utils.Callback):
def __init__(self, dbstate, nav_type):
gen.utils.Callback.__init__(self)
self.dbstate = dbstate
self.nav_type = nav_type
self.clear()
dbstate.connect('database-changed', self.connect_signals)
@ -105,6 +107,11 @@ class History(gen.utils.Callback):
self.index = -1
self.lock = False
if self.dbstate.open and self.nav_type == 'Person':
initial_person = self.dbstate.db.find_initial_person()
if initial_person:
self.push(initial_person.get_handle())
def remove(self, handle, old_id=None):
"""
Remove a handle from the history list

View File

@ -274,12 +274,6 @@ class CLIManager(object):
config.set('paths.recent-file', filename)
try:
initial_person = self.dbstate.db.find_initial_person().get_handle()
self.uistate.set_active(initial_person, 'Person')
except:
pass
RecentFiles.recent_files(filename, name)
self.file_loaded = True