Add family gallery bottombar gramplet
svn: r17408
This commit is contained in:
parent
c6c7b23a45
commit
a80b6d5f73
@ -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.
|
||||
|
@ -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"),
|
||||
|
@ -345,7 +345,8 @@ class FamilyView(ListView):
|
||||
Define the default gramplets for the sidebar and bottombar.
|
||||
"""
|
||||
return (("Family Filter Gramplet",),
|
||||
("Family Events Gramplet",
|
||||
("Family Gallery Gramplet",
|
||||
"Family Events Gramplet",
|
||||
"Family Children Gramplet",
|
||||
"Family Sources Gramplet",
|
||||
"Family Notes Gramplet",
|
||||
|
Loading…
Reference in New Issue
Block a user