expand/collapse all nodes in Person View

svn: r6505
This commit is contained in:
Don Allingham 2006-05-01 21:28:31 +00:00
parent f9942e1e10
commit 0ff454d71a
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2006-05-01 Don Allingham <don@gramps-project.org>
* src/DataViews/_PersonView.py (PersonView.define_actions): add
expand and collapse all node menu entries
2006-05-01 Alex Roitman <shura@gramps-project.org> 2006-05-01 Alex Roitman <shura@gramps-project.org>
* various: merge changes from gramps20. * various: merge changes from gramps20.

View File

@ -114,6 +114,10 @@ class PersonView(PageView.PersonNavView):
callback=self.edit) callback=self.edit)
self.add_action('Remove', gtk.STOCK_REMOVE, "_Remove", self.add_action('Remove', gtk.STOCK_REMOVE, "_Remove",
callback=self.remove) callback=self.remove)
self.add_action('OpenAllNodes', None, "Expand all nodes",
callback=self.open_all_nodes)
self.add_action('CloseAllNodes', None, "Close all nodes",
callback=self.close_all_nodes)
self.add_action('Jump', None, "_Jump", self.add_action('Jump', None, "_Jump",
accel="<control>j",callback=self.jumpto) accel="<control>j",callback=self.jumpto)
@ -250,6 +254,9 @@ class PersonView(PageView.PersonNavView):
<menuitem action="Forward"/> <menuitem action="Forward"/>
<menuitem action="HomePerson"/> <menuitem action="HomePerson"/>
<separator/> <separator/>
<menuitem action="OpenAllNodes"/>
<menuitem action="CloseAllNodes"/>
<separator/>
<menuitem action="Add"/> <menuitem action="Add"/>
<menuitem action="Edit"/> <menuitem action="Edit"/>
<menuitem action="Remove"/> <menuitem action="Remove"/>
@ -402,6 +409,12 @@ class PersonView(PageView.PersonNavView):
except Errors.WindowActiveError: except Errors.WindowActiveError:
pass pass
def open_all_nodes(self,obj):
self.tree.expand_all()
def close_all_nodes(self,obj):
self.tree.collapse_all()
def remove(self,obj): def remove(self,obj):
mlist = self.get_selected_objects() mlist = self.get_selected_objects()
if len(mlist) == 0: if len(mlist) == 0: