* src/PedView.py: add a '*' to the popup menu if the child has children
svn: r2400
This commit is contained in:
parent
fdbd83830b
commit
87a72111f7
@ -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.
|
||||||
|
|
||||||
|
def find_children(p):
|
||||||
childlist = []
|
childlist = []
|
||||||
for family in self.active_person.getFamilyList():
|
for family in p.getFamilyList():
|
||||||
for child in family.getChildList():
|
for child in family.getChildList():
|
||||||
childlist.append(child)
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user