* src/PedView.py: add a '*' to the popup menu if the child has children

svn: r2400
This commit is contained in:
Don Allingham 2003-11-28 21:23:59 +00:00
parent fdbd83830b
commit 87a72111f7

View File

@ -298,17 +298,23 @@ class PedigreeView:
# button. The menu consists of the children of the current root # button. The menu consists of the children of the current root
# person of the tree. Attach a child to each menu item. # person of the tree. Attach a child to each menu item.
childlist = [] def find_children(p):
for family in self.active_person.getFamilyList(): childlist = []
for child in family.getChildList(): for family in p.getFamilyList():
childlist.append(child) for child in family.getChildList():
childlist.append(child)
return childlist
childlist = find_children(self.active_person)
if len(childlist) == 1: if len(childlist) == 1:
self.load_canvas(childlist[0]) self.load_canvas(childlist[0])
elif len(childlist) > 1: elif len(childlist) > 1:
myMenu = gtk.Menu() myMenu = gtk.Menu()
for child in childlist: for child in childlist:
menuitem = gtk.MenuItem(GrampsCfg.nameof(child)) cname = GrampsCfg.nameof(child)
if len(find_children(child)) > 0:
cname = cname + " *"
menuitem = gtk.MenuItem(cname)
myMenu.append(menuitem) myMenu.append(menuitem)
menuitem.set_data(_PERSON,child) menuitem.set_data(_PERSON,child)
menuitem.connect("activate",self.on_childmenu_changed) menuitem.connect("activate",self.on_childmenu_changed)