2006-11-17 Don Allingham <don@gramps-project.org>

* src/ManagedWindow.py: catch missing item error



svn: r7642
This commit is contained in:
Don Allingham 2006-11-18 04:24:04 +00:00
parent 50019b38de
commit 5afb3c0e29
2 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,6 @@
2006-11-17 Don Allingham <don@gramps-project.org>
* src/ManagedWindow.py: catch missing item error
2006-11-16 Don Allingham <don@gramps-project.org>
* src/DataViews/_RelationView.py: share parents button
* src/images/share-fam.png: share parents button

View File

@ -118,11 +118,14 @@ class GrampsWindowManager:
def close_track(self,track):
# This is called when item needs to be closed
# Closes all its children and then removes the item from the tree.
item = self.get_item_from_track(track)
self.recursive_action(item,self.close_item)
# This only needs to be run once for the highest level point
# to remove.
self.remove_item(track)
try:
item = self.get_item_from_track(track)
self.recursive_action(item,self.close_item)
# This only needs to be run once for the highest level point
# to remove.
self.remove_item(track)
except IndexError:
print "Missing item from window manager", track, self.close_item
def recursive_action(self,item,func,*args):
# This function recursively calls itself over the child items