* src/DisplayState.py: Manage history on db change
* src/Navigation.py: Manage history on db change svn: r5918
This commit is contained in:
parent
ebba95652f
commit
9617f77079
@ -1,4 +1,6 @@
|
||||
2006-02-09 Don Allingham <don@gramps-project.org>
|
||||
* src/DisplayState.py: Manage history on db change
|
||||
* src/Navigation.py: Manage history on db change
|
||||
* src/PedView.py: fix quote
|
||||
* src/PersonView.py: reset db and build tree on database reload
|
||||
* src/GrampsDb/_GrampsDbBase.py: clear active on database change
|
||||
|
@ -585,6 +585,9 @@ class DisplayState(GrampsDb.GrampsDBCallback):
|
||||
self.log.setLevel(logging.WARN)
|
||||
self.log.addHandler(self.rh)
|
||||
|
||||
def clear_history(self):
|
||||
self.phistory.clear()
|
||||
|
||||
def set_busy_cursor(self,value):
|
||||
if value:
|
||||
self.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
|
||||
|
@ -46,11 +46,14 @@ class BaseNavigation:
|
||||
def __init__(self,uistate,history,title):
|
||||
self.title = title
|
||||
self.ui = _top+_btm
|
||||
history.connect('menu-changed', self.update_menu)
|
||||
self.uistate = uistate
|
||||
self.action_group = gtk.ActionGroup(self.title)
|
||||
self.active = DISABLED
|
||||
self.uistate = uistate
|
||||
self.items = []
|
||||
self.history = history
|
||||
|
||||
def clear(self):
|
||||
self.history.clear()
|
||||
|
||||
def disable(self):
|
||||
"""
|
||||
|
@ -234,8 +234,8 @@ class ViewManager:
|
||||
self.uistate.set_open_widget(openbtn)
|
||||
toolbar.insert(openbtn,1)
|
||||
|
||||
person_nav = Navigation.PersonNavigation(self.uistate)
|
||||
self.navigation_type[PageView.NAVIGATION_PERSON] = (person_nav,None)
|
||||
self.person_nav = Navigation.PersonNavigation(self.uistate)
|
||||
self.navigation_type[PageView.NAVIGATION_PERSON] = (self.person_nav,None)
|
||||
self.recent_manager = DisplayState.RecentDocsMenu(self.uistate,self.state,
|
||||
self.read_file)
|
||||
self.recent_manager.build()
|
||||
@ -654,6 +654,7 @@ class ViewManager:
|
||||
except:
|
||||
pass
|
||||
self.state.change_database(GrampsDb.gramps_db_factory(const.app_gramps)())
|
||||
self.uistate.clear_history()
|
||||
self.read_file(filename)
|
||||
self.change_page(None,None)
|
||||
# Add the file to the recent items
|
||||
@ -693,6 +694,7 @@ class ViewManager:
|
||||
RecentFiles.recent_files(filename,filetype)
|
||||
self.recent_manager.build()
|
||||
|
||||
self.uistate.clear_history()
|
||||
return success
|
||||
|
||||
def read_file(self,filename,callback=None):
|
||||
@ -932,6 +934,7 @@ class ViewManager:
|
||||
self.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
|
||||
self.progress.show()
|
||||
GrampsDb.gramps_db_reader_factory(filetype)(self.state.db,filename,self.pulse_progressbar)
|
||||
self.uistate.clear_history()
|
||||
self.progress.hide()
|
||||
self.window.window.set_cursor(None)
|
||||
return True
|
||||
@ -940,6 +943,7 @@ class ViewManager:
|
||||
self.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
|
||||
self.progress.show()
|
||||
GrampsDb.gramps_db_reader_factory(filetype)(self.state.db,filename,self.pulse_progressbar)
|
||||
self.uistate.clear_history()
|
||||
self.progress.hide()
|
||||
self.window.window.set_cursor(None)
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user