From ae1c5c6aee049507dad00d4b17bfc106a8444f30 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 27 Apr 2006 21:18:59 +0000 Subject: [PATCH] svn: r6474 --- src/DisplayTabs.py | 8 +++++--- src/Editors/_EditPerson.py | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/DisplayTabs.py b/src/DisplayTabs.py index bf15c18f5..da8b8d19d 100644 --- a/src/DisplayTabs.py +++ b/src/DisplayTabs.py @@ -1503,9 +1503,10 @@ class NoteTab(GrampsTab): #------------------------------------------------------------------------- class GalleryTab(ButtonTab): - def __init__(self, dbstate, uistate, track, media_list): + def __init__(self, dbstate, uistate, track, media_list, update=None): ButtonTab.__init__(self, dbstate, uistate, track, _('Gallery'), True) self.media_list = media_list + self.update = update self.rebuild() self.show_all() @@ -1555,8 +1556,6 @@ class GalleryTab(ButtonTab): item.show() menu.append(item) menu.popup(None, None, None, event.button, event.time) - - def get_icon_name(self): return 'gramps-media' @@ -1603,6 +1602,8 @@ class GalleryTab(ButtonTab): self.media_list.pop() for i in newlist: self.media_list.append(i) + if self.update: + self.update() self.changed = True def get_data(self): @@ -1619,6 +1620,7 @@ class GalleryTab(ButtonTab): self._connect_icon_model() self._set_label() self._selection_changed() + self.update() def get_selected(self): node = self.iconlist.get_selected_items() diff --git a/src/Editors/_EditPerson.py b/src/Editors/_EditPerson.py index 4c9fc1960..ad615a858 100644 --- a/src/Editors/_EditPerson.py +++ b/src/Editors/_EditPerson.py @@ -270,7 +270,8 @@ class EditPerson(EditPrimary): self.gallery_tab = self._add_tab( notebook, GalleryTab(self.dbstate, self.uistate, self.track, - self.obj.get_media_list())) + self.obj.get_media_list(), + self.load_person_image)) self.web_list = self._add_tab( notebook, @@ -563,10 +564,12 @@ class EditPerson(EditPrimary): Loads the primary image into the main form if it exists. """ media_list = self.obj.get_media_list() + print media_list if media_list: photo = media_list[0] object_handle = photo.get_reference_handle() obj = self.db.get_object_from_handle(object_handle) + print photo, obj.get_path() if self.load_obj != obj.get_path(): mime_type = obj.get_mime_type() if mime_type and mime_type.startswith("image"):