diff --git a/src/DataViews/EventView.py b/src/DataViews/EventView.py index 11c8c5467..1b510941a 100644 --- a/src/DataViews/EventView.py +++ b/src/DataViews/EventView.py @@ -69,10 +69,10 @@ class EventView(PageView.ListView): _('Description'), _('ID'), _('Type'), - _('First Main Participant'), _('Date'), _('Place'), _('Last Changed'), + _('Main Participants'), ] ADD_MSG = _("Add a new event") diff --git a/src/DisplayModels/_EventModel.py b/src/DisplayModels/_EventModel.py index d8e58c2aa..70b0d6032 100644 --- a/src/DisplayModels/_EventModel.py +++ b/src/DisplayModels/_EventModel.py @@ -76,10 +76,10 @@ class EventModel(FlatBaseModel): self.column_description, self.column_id, self.column_type, - self.column_participant, self.column_date, self.column_place, self.column_change, + self.column_participant, self.column_handle, self.column_tooltip, ] @@ -87,10 +87,10 @@ class EventModel(FlatBaseModel): self.column_description, self.column_id, self.column_type, - self.column_participant, self.sort_date, self.column_place, self.sort_change, + self.column_participant, self.column_handle, self.column_tooltip, ] diff --git a/src/Utils.py b/src/Utils.py index 0d980a074..dda50dbb7 100644 --- a/src/Utils.py +++ b/src/Utils.py @@ -1012,33 +1012,45 @@ def get_participant_from_event(db, event_handle): """ Obtain the first primary or family participant to an event we find in the database. Note that an event can have more than one primary or - family participant, only one is returned. + family participant, only one is returned, adding ellipses if there are + more. """ participant = "" + ellipses = False result_list = [i for i in db.find_backlink_handles(event_handle, include_classes=['Person', 'Family'])] - people = [x[1] for x in result_list if x[0] == 'Person'] - families = [x[1] for x in result_list if x[0] == 'Family'] + #obtain handles without duplicates + people = set([x[1] for x in result_list if x[0] == 'Person']) + families = set([x[1] for x in result_list if x[0] == 'Family']) for personhandle in people: person = db.get_person_from_handle(personhandle) for event_ref in person.get_event_ref_list(): if event_handle == event_ref.ref and \ event_ref.get_role() == gen.lib.EventRoleType.PRIMARY: - participant = name_displayer.display(person) + if participant: + ellipses = True + else: + participant = name_displayer.display(person) break - if participant: + if ellipses: break - if participant: - return participant + if ellipses: + return _('%s, ...') % participant for familyhandle in families: family = db.get_family_from_handle(familyhandle) for event_ref in family.get_event_ref_list(): if event_handle == event_ref.ref and \ event_ref.get_role() == gen.lib.EventRoleType.FAMILY: - participant = family_name(family, db) + if participant: + ellipses = True + else: + participant = family_name(family, db) break - if participant: + if ellipses: break - return participant + if ellipses: + return _('%s, ...') % participant + else: + return participant diff --git a/src/gen/db/base.py b/src/gen/db/base.py index 1724c0fe5..e063284d1 100644 --- a/src/gen/db/base.py +++ b/src/gen/db/base.py @@ -2473,8 +2473,8 @@ class GrampsDbBase(Callback): metadata. """ default = [(1, 0, 200), (1, 1, 75), (1, 2, 100), - (0, 3, 0), (1, 4, 150), - (1, 5, 200), (0, 6, 100)] + (0, 6, 230), (1, 3, 150), + (1, 4, 200), (0, 5, 100)] return self.__get_columns(EVENT_COL_KEY, default) def get_repository_column_order(self):