* src/Editors/_EditPerson.py (_image_callback): Take three

arguments; correctly call load_photo(); rebuild gallery.
	(load_photo): Name path variable as such, for clarity.


svn: r7248
This commit is contained in:
Alex Roitman 2006-08-23 19:22:47 +00:00
parent ffcb5231e5
commit cc166bc590
2 changed files with 11 additions and 8 deletions

View File

@ -1,4 +1,7 @@
2006-08-23 Alex Roitman <shura@gramps-project.org> 2006-08-23 Alex Roitman <shura@gramps-project.org>
* src/Editors/_EditPerson.py (_image_callback): Take three
arguments; correctly call load_photo(); rebuild gallery.
(load_photo): Name path variable as such, for clarity.
* src/DataViews/_PedigreeView.py (PedigreeView.goto_active_person): * src/DataViews/_PedigreeView.py (PedigreeView.goto_active_person):
Update status bar on person change. Update status bar on person change.
* src/DataViews/_RelationView.py (RelationshipView.change_person): * src/DataViews/_RelationView.py (RelationshipView.change_person):

View File

@ -316,13 +316,13 @@ class EditPerson(EditPrimary):
win_menu_label = _("New Person") win_menu_label = _("New Person")
return (_('Edit Person'), win_menu_label) return (_('Edit Person'), win_menu_label)
def _image_callback(self, ref): def _image_callback(self, ref, obj):
""" """
Called when a media reference had been edited. This allows fot Called when a media reference had been edited. This allows fot
the updating image on the main form which has just been modified. the updating image on the main form which has just been modified.
""" """
obj = self.db.get_object_from_handle(ref.get_reference_handle()) self.load_photo(obj.get_path())
self.load_photo(obj) self.gallery_tab.edit_callback(ref, obj)
def _image_button_press(self, obj, event): def _image_button_press(self, obj, event):
""" """
@ -406,14 +406,14 @@ class EditPerson(EditPrimary):
return False return False
return False return False
def load_photo(self, photo): def load_photo(self, path):
"""loads, scales, and displays the person's main photo""" """loads, scales, and displays the person's main photo from the path"""
self.load_obj = photo self.load_obj = path
if photo == None: if path == None:
self.obj_photo.hide() self.obj_photo.hide()
else: else:
try: try:
i = gtk.gdk.pixbuf_new_from_file(photo) i = gtk.gdk.pixbuf_new_from_file(path)
ratio = float(max(i.get_height(), i.get_width())) ratio = float(max(i.get_height(), i.get_width()))
scale = float(100.0)/ratio scale = float(100.0)/ratio
x = int(scale*(i.get_width())) x = int(scale*(i.get_width()))