Geography : adding date in popup to person and family views ( feature request #0004882 )
svn: r17567
This commit is contained in:
parent
610442278c
commit
2f02d233bc
@ -58,6 +58,7 @@ import gen.lib
|
||||
import Utils
|
||||
import config
|
||||
import Errors
|
||||
import DateHandler
|
||||
from gen.display.name import displayer as _nd
|
||||
from PlaceUtils import conv_lat_lon
|
||||
from gui.views.pageview import PageView
|
||||
@ -394,18 +395,23 @@ class GeoFamily(GeoGraphyView):
|
||||
self.add_place_bubble_message(event, lat, lon,
|
||||
marks, menu, message, mark)
|
||||
oldplace = mark[0]
|
||||
evt = self.dbstate.db.get_event_from_gramps_id(mark[10])
|
||||
# format the date as described in preferences.
|
||||
date = DateHandler.displayer.display(evt.get_date_object())
|
||||
if date == "":
|
||||
date = _("Unknown")
|
||||
if ( mark[5] == gen.lib.EventRoleType.PRIMARY ):
|
||||
message = "%s : %s" % ( mark[7], mark[1] )
|
||||
message = "(%s) %s : %s" % ( date, mark[7], mark[1] )
|
||||
elif ( mark[5] == gen.lib.EventRoleType.FAMILY ):
|
||||
evt = self.dbstate.db.get_event_from_gramps_id(mark[10])
|
||||
(father_name, mother_name) = self._get_father_and_mother_name(evt)
|
||||
message = "%s : %s - %s" % ( mark[7], father_name, mother_name )
|
||||
message = "(%s) %s : %s - %s" % ( date, mark[7], father_name, mother_name )
|
||||
else:
|
||||
evt = self.dbstate.db.get_event_from_gramps_id(mark[10])
|
||||
descr = evt.get_description()
|
||||
if descr == "":
|
||||
descr = _('No description')
|
||||
message = "%s => %s" % ( mark[5], descr)
|
||||
message = "(%s) %s => %s" % ( date, mark[5], descr)
|
||||
prevmark = mark
|
||||
add_item = gtk.MenuItem(message)
|
||||
add_item.show()
|
||||
|
@ -59,6 +59,7 @@ import gen.lib
|
||||
import Utils
|
||||
import config
|
||||
import Errors
|
||||
import DateHandler
|
||||
from gen.display.name import displayer as _nd
|
||||
from PlaceUtils import conv_lat_lon
|
||||
from gui.views.pageview import PageView
|
||||
@ -440,19 +441,22 @@ class GeoPerson(GeoGraphyView):
|
||||
marks, menu, message, mark)
|
||||
oldplace = mark[0]
|
||||
message = ""
|
||||
print "role : ", mark[11]
|
||||
if ( mark[11] == gen.lib.EventRoleType.PRIMARY ):
|
||||
message = "%s : %s" % ( mark[2], mark[1] )
|
||||
elif ( mark[11] == gen.lib.EventRoleType.FAMILY ):
|
||||
evt = self.dbstate.db.get_event_from_gramps_id(mark[10])
|
||||
# format the date as described in preferences.
|
||||
date = DateHandler.displayer.display(evt.get_date_object())
|
||||
if date == "":
|
||||
date = _("Unknown")
|
||||
if ( mark[11] == gen.lib.EventRoleType.PRIMARY ):
|
||||
message = "(%s) %s : %s" % ( date, mark[2], mark[1] )
|
||||
elif ( mark[11] == gen.lib.EventRoleType.FAMILY ):
|
||||
(father_name, mother_name) = self._get_father_and_mother_name(evt)
|
||||
message = "%s : %s - %s" % ( mark[7], father_name, mother_name )
|
||||
message = "(%s) %s : %s - %s" % ( date, mark[7], father_name, mother_name )
|
||||
else:
|
||||
evt = self.dbstate.db.get_event_from_gramps_id(mark[10])
|
||||
descr = evt.get_description()
|
||||
if descr == "":
|
||||
descr = _('No description')
|
||||
message = "%s => %s" % ( mark[11], descr)
|
||||
message = "(%s) %s => %s" % ( date, mark[11], descr)
|
||||
prevmark = mark
|
||||
add_item = gtk.MenuItem(message)
|
||||
add_item.show()
|
||||
|
Loading…
Reference in New Issue
Block a user