From f824892648c6319503f23e9a030d666a4aa5417b Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Mon, 22 Mar 2004 21:04:47 +0000 Subject: [PATCH] * src/PedView.py (on_show_child_menu): Switch to id. svn: r3045 --- gramps2/ChangeLog | 1 + gramps2/src/PedView.py | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index b90e235a0..0ffc36bf0 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,5 +1,6 @@ 2004-03-22 Alex Roitman * src/docgen/LPRDoc.py: Fix colliding name. + * src/PedView.py (on_show_child_menu): Switch to id. 2004-03-21 Don Allingham * src/AddMedia.py: GenericTreeModel changes diff --git a/gramps2/src/PedView.py b/gramps2/src/PedView.py index 5e42ccb45..a0542c4ee 100644 --- a/gramps2/src/PedView.py +++ b/gramps2/src/PedView.py @@ -197,7 +197,7 @@ class PedigreeView: list = [None]*31 self.find_tree(self.active_person,0,1,list) - # determine the largest string width and height for calcuation + # determine the largest string width and height for calcuation # of box sizes. a = pango.Layout(self.canvas.get_pango_context()) @@ -360,13 +360,15 @@ class PedigreeView: childlist = [] for family_id in p.get_family_id_list(): family = self.parent.db.find_family_from_id(family_id) - for child in family.get_child_id_list(): - childlist.append(child) + for child_id in family.get_child_id_list(): + childlist.append(child_id) return childlist childlist = find_children(self.active_person) if len(childlist) == 1: - self.load_canvas(childlist[0]) + child = self.parent.db.find_person_from_id(childlist[0]) + if child: + self.load_canvas(child) elif len(childlist) > 1: myMenu = gtk.Menu() for child_id in childlist: @@ -402,7 +404,7 @@ class PedigreeView: the specified location. Attach the passed parent and the callback to the button.""" - button,arrow = self.make_arrow_button(gtk.ARROW_RIGHT,self.change_to_parent) + button,arrow = self.make_arrow_button(gtk.ARROW_RIGHT,self.change_to_parent) button.set_data(_PERSON,parent) item = self.root.add(gnome.canvas.CanvasWidget, widget=button, x=x, y=y+(h/2), @@ -451,7 +453,7 @@ class PedigreeView: def line_event(self,obj,event): """Catch X events over a line and respond to the ones we care about""" - person = obj.get_data(_PERSON) + person = obj.get_data(_PERSON) style = self.canvas.get_style() if event.type == gtk.gdk._2BUTTON_PRESS: @@ -515,7 +517,7 @@ class PedigreeView: (gtk.STOCK_GO_BACK,self.parent.back_clicked,back_sensitivity), (gtk.STOCK_GO_FORWARD,self.parent.fwd_clicked,fwd_sensitivity), #FIXME: revert to stock item when German gtk translation is fixed - #(gtk.STOCK_HOME,self.parent.on_home_clicked,1), + #(gtk.STOCK_HOME,self.parent.on_home_clicked,1), (_("Home"),self.parent.on_home_clicked,1), (None,None,0), (_("Set anchor"),self.on_anchor_set,1), @@ -526,10 +528,10 @@ class PedigreeView: for stock_id,callback,sensitivity in entries: item = gtk.ImageMenuItem(stock_id) #FIXME: remove when German gtk translation is fixed - if stock_id == _("Home"): - im = gtk.image_new_from_stock(gtk.STOCK_HOME,gtk.ICON_SIZE_MENU) - im.show() - item.set_image(im) + if stock_id == _("Home"): + im = gtk.image_new_from_stock(gtk.STOCK_HOME,gtk.ICON_SIZE_MENU) + im.show() + item.set_image(im) if callback: item.connect("activate",callback) item.set_sensitive(sensitivity)