From cc166bc590aed68646fdec1c8d6ef216daf0cd42 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Wed, 23 Aug 2006 19:22:47 +0000 Subject: [PATCH] * 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 --- gramps2/ChangeLog | 3 +++ gramps2/src/Editors/_EditPerson.py | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index f77da9164..a1a068759 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,7 @@ 2006-08-23 Alex Roitman + * 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): diff --git a/gramps2/src/Editors/_EditPerson.py b/gramps2/src/Editors/_EditPerson.py index 1570bdb0c..1bd9f85d1 100644 --- a/gramps2/src/Editors/_EditPerson.py +++ b/gramps2/src/Editors/_EditPerson.py @@ -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()))