Skip to content

Commit ddebca1

Browse files
committed
Add Associations tab
1 parent 602effa commit ddebca1

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

CombinedView/combinedview.gpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
id = 'combinedview',
2323
name = _("Combined"),
2424
description = _("A view showing relationships and events for a person"),
25-
version = '1.0.13',
25+
version = '1.0.14',
2626
gramps_target_version = '5.1',
2727
status = STABLE,
2828
fname = 'combinedview.py',

CombinedView/combinedview.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ def _change_person(self, handle):
561561
self.write_events(person)
562562
self.write_album(person)
563563
self.write_timeline(person)
564+
self.write_associations(person)
564565

565566
#self.stack.set_visible_child_name(self.person_tab)
566567

@@ -1368,6 +1369,36 @@ def write_media(self, media_list, event):
13681369
self.vbox2.attach_next_to(vbox, image,
13691370
Gtk.PositionType.RIGHT, 1, 1)
13701371

1372+
##############################################################################
1373+
#
1374+
# Associations
1375+
#
1376+
##############################################################################
1377+
1378+
def write_associations(self, person):
1379+
1380+
self.vbox2 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
1381+
1382+
scroll = Gtk.ScrolledWindow()
1383+
scroll.add(self.vbox2)
1384+
scroll.show_all()
1385+
self.stack.add_titled(scroll, 'associations', _('Associations'))
1386+
1387+
for person_ref in person.get_person_ref_list():
1388+
self.write_association(person_ref)
1389+
1390+
1391+
def write_association(self, person_ref):
1392+
1393+
vbox = self.write_person('assoc', person_ref.ref)
1394+
rel = Gtk.Label(person_ref.rel)
1395+
rel.set_halign(Gtk.Align.START)
1396+
vbox.pack_start(rel, False, False, 0)
1397+
eventbox = self.make_dragbox(vbox, 'Person', person_ref.ref)
1398+
eventbox.show_all()
1399+
self.vbox2.pack_start(eventbox, False, False, 1)
1400+
1401+
13711402
##############################################################################
13721403
#
13731404
# Participants list

0 commit comments

Comments
 (0)