* 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 e5fb9ee657
commit dfe1287d4f
2 changed files with 11 additions and 8 deletions

View File

@ -1,4 +1,7 @@
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):
Update status bar on person change.
* src/DataViews/_RelationView.py (RelationshipView.change_person):

View File

@ -316,13 +316,13 @@ class EditPerson(EditPrimary):
win_menu_label = _("New Person")
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
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)
self.load_photo(obj.get_path())
self.gallery_tab.edit_callback(ref, obj)
def _image_button_press(self, obj, event):
"""
@ -406,14 +406,14 @@ class EditPerson(EditPrimary):
return False
return False
def load_photo(self, photo):
"""loads, scales, and displays the person's main photo"""
self.load_obj = photo
if photo == None:
def load_photo(self, path):
"""loads, scales, and displays the person's main photo from the path"""
self.load_obj = path
if path == None:
self.obj_photo.hide()
else:
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()))
scale = float(100.0)/ratio
x = int(scale*(i.get_width()))