Add family gallery bottombar gramplet

svn: r17408
This commit is contained in:
Nick Hall
2011-05-04 22:59:43 +00:00
parent c6c7b23a45
commit a80b6d5f73
3 changed files with 40 additions and 1 deletions

View File

@@ -110,6 +110,30 @@ class PersonGallery(Gallery):
else:
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):
"""
Displays a gallery of media objects for an event.

View File

@@ -161,6 +161,20 @@ register(GRAMPLET,
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.3",
status = STABLE,
fname="Gallery.py",
height=200,
gramplet = 'FamilyGallery',
gramplet_title=_("Gallery"),
navtypes=["Family"],
)
register(GRAMPLET,
id="Event Gallery Gramplet",
name=_("Event Gallery Gramplet"),