2773: Primary participant(s) in Events View

svn: r13083
This commit is contained in:
Benny Malengier 2009-08-19 22:27:06 +00:00
parent 3d34996343
commit 5f0c935256
3 changed files with 11 additions and 3 deletions

View File

@ -69,6 +69,7 @@ class EventView(PageView.ListView):
_('Description'),
_('ID'),
_('Type'),
_('First Main Participant'),
_('Date'),
_('Place'),
_('Last Changed'),

View File

@ -44,6 +44,7 @@ import ToolTips
import GrampsLocale
import DateHandler
import gen.lib
import Utils
from gui.views.treemodels.flatbasemodel import FlatBaseModel
#-------------------------------------------------------------------------
@ -75,6 +76,7 @@ class EventModel(FlatBaseModel):
self.column_description,
self.column_id,
self.column_type,
self.column_participant,
self.column_date,
self.column_place,
self.column_change,
@ -85,13 +87,14 @@ 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_handle,
self.column_tooltip,
]
FlatBaseModel.__init__(self, db, scol, order, tooltip_column=8,
FlatBaseModel.__init__(self, db, scol, order, tooltip_column=9,
search=search, skip=skip, sort_map=sort_map)
def on_get_n_columns(self):
@ -100,6 +103,9 @@ class EventModel(FlatBaseModel):
def column_description(self,data):
return data[COLUMN_DESCRIPTION]
def column_participant(self,data):
return Utils.get_participant_from_event(self.db, data[COLUMN_HANDLE])
def column_place(self,data):
if data[COLUMN_PLACE]:
return self.db.get_place_from_handle(data[COLUMN_PLACE]).get_title()

View File

@ -2472,8 +2472,9 @@ class GrampsDbBase(Callback):
Return the Event display common information stored in the database's
metadata.
"""
default = [(1, 0, 200), (1, 1, 75), (1, 2, 100), (1, 3, 150),
(1, 4, 200), (0, 5, 100)]
default = [(1, 0, 200), (1, 1, 75), (1, 2, 100),
(0, 3, 0), (1, 4, 150),
(1, 5, 200), (0, 6, 100)]
return self.__get_columns(EVENT_COL_KEY, default)
def get_repository_column_order(self):