7342: Split details column in events gramplet
This commit is contained in:
parent
da3bff2ec4
commit
a0bb7ddfd1
@ -20,12 +20,14 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
from gui.editors import EditEvent
|
from gui.editors import EditEvent
|
||||||
|
from gen.lib import EventRoleType
|
||||||
from ListModel import ListModel, NOSORT
|
from ListModel import ListModel, NOSORT
|
||||||
from gen.plug import Gramplet
|
from gen.plug import Gramplet
|
||||||
from gen.ggettext import gettext as _
|
from gen.ggettext import gettext as _
|
||||||
from gen.display.name import displayer as name_displayer
|
from gen.display.name import displayer as name_displayer
|
||||||
import DateHandler
|
import DateHandler
|
||||||
import Errors
|
import Errors
|
||||||
|
import Utils
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
class Events(Gramplet):
|
class Events(Gramplet):
|
||||||
@ -47,11 +49,12 @@ class Events(Gramplet):
|
|||||||
top = gtk.TreeView()
|
top = gtk.TreeView()
|
||||||
titles = [('', NOSORT, 50,),
|
titles = [('', NOSORT, 50,),
|
||||||
(_('Type'), 1, 100),
|
(_('Type'), 1, 100),
|
||||||
(_('Details'), 2, 200),
|
(_('Main Participants'), 2, 200),
|
||||||
(_('Date'), 4, 100),
|
(_('Date'), 4, 100),
|
||||||
('', 4, 100),
|
('', 4, 100),
|
||||||
(_('Place'), 5, 400),
|
(_('Place'), 5, 400),
|
||||||
(_('Role'), 6, 100)]
|
(_('Description'), 6, 150),
|
||||||
|
(_('Role'), 7, 100)]
|
||||||
self.model = ListModel(top, titles, event_func=self.edit_event)
|
self.model = ListModel(top, titles, event_func=self.edit_event)
|
||||||
return top
|
return top
|
||||||
|
|
||||||
@ -66,16 +69,24 @@ class Events(Gramplet):
|
|||||||
handle = event.get_place_handle()
|
handle = event.get_place_handle()
|
||||||
if handle:
|
if handle:
|
||||||
place = self.dbstate.db.get_place_from_handle(handle).get_title()
|
place = self.dbstate.db.get_place_from_handle(handle).get_title()
|
||||||
if spouse:
|
|
||||||
details = name_displayer.display(spouse)
|
participants = ''
|
||||||
else:
|
if int(event_ref.get_role()) == EventRoleType.FAMILY:
|
||||||
details = event.get_description()
|
if spouse:
|
||||||
|
participants = name_displayer.display(spouse)
|
||||||
|
|
||||||
|
if int(event_ref.get_role()) not in (EventRoleType.PRIMARY,
|
||||||
|
EventRoleType.FAMILY):
|
||||||
|
participants = Utils.get_participant_from_event(self.dbstate.db,
|
||||||
|
event_ref.ref)
|
||||||
|
|
||||||
self.model.add((event.get_handle(),
|
self.model.add((event.get_handle(),
|
||||||
str(event.get_type()),
|
str(event.get_type()),
|
||||||
details,
|
participants,
|
||||||
event_date,
|
event_date,
|
||||||
event_sort,
|
event_sort,
|
||||||
place,
|
place,
|
||||||
|
event.get_description(),
|
||||||
str(event_ref.get_role())))
|
str(event_ref.get_role())))
|
||||||
|
|
||||||
def edit_event(self, treeview):
|
def edit_event(self, treeview):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user