svn: r6474
This commit is contained in:
parent
64c9d21d43
commit
ae1c5c6aee
@ -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()
|
||||
|
@ -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"):
|
||||
|
Loading…
Reference in New Issue
Block a user