Add family gallery bottombar gramplet

svn: r17409
This commit is contained in:
Nick Hall 2011-05-04 23:00:30 +00:00
parent 299bef1c74
commit 455c5ef4a0
3 changed files with 40 additions and 1 deletions

View File

@ -110,6 +110,30 @@ class PersonGallery(Gallery):
else: else:
self.set_has_data(False) self.set_has_data(False)
class FamilyGallery(Gallery):
"""
Displays a gallery of media objects for a family.
"""
def db_changed(self):
self.dbstate.db.connect('family-update', self.update)
self.connect_signal('Family', self.update)
self.update()
def update_has_data(self):
active_handle = self.get_active('Family')
active = self.dbstate.db.get_family_from_handle(active_handle)
self.set_has_data(self.get_has_data(active))
def main(self):
active_handle = self.get_active('Family')
active = self.dbstate.db.get_family_from_handle(active_handle)
self.clear_images()
if active:
self.load_images(active)
else:
self.set_has_data(False)
class EventGallery(Gallery): class EventGallery(Gallery):
""" """
Displays a gallery of media objects for an event. Displays a gallery of media objects for an event.

View File

@ -161,6 +161,20 @@ register(GRAMPLET,
navtypes=["Person"], navtypes=["Person"],
) )
register(GRAMPLET,
id="Family Gallery Gramplet",
name=_("Family Gallery Gramplet"),
description = _("Gramplet showing media objects for a family"),
version="1.0.0",
gramps_target_version="3.4",
status = STABLE,
fname="Gallery.py",
height=200,
gramplet = 'FamilyGallery',
gramplet_title=_("Gallery"),
navtypes=["Family"],
)
register(GRAMPLET, register(GRAMPLET,
id="Event Gallery Gramplet", id="Event Gallery Gramplet",
name=_("Event Gallery Gramplet"), name=_("Event Gallery Gramplet"),

View File

@ -345,7 +345,8 @@ class FamilyView(ListView):
Define the default gramplets for the sidebar and bottombar. Define the default gramplets for the sidebar and bottombar.
""" """
return (("Family Filter Gramplet",), return (("Family Filter Gramplet",),
("Family Events Gramplet", ("Family Gallery Gramplet",
"Family Events Gramplet",
"Family Children Gramplet", "Family Children Gramplet",
"Family Sources Gramplet", "Family Sources Gramplet",
"Family Notes Gramplet", "Family Notes Gramplet",