4320: Ensure that the initial person is set when clearing history
svn: r16102
This commit is contained in:
parent
56ed2ce45e
commit
389b9e0935
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user