9704: Events coordinates : add place ID.

This commit is contained in:
SNoiraud 2016-09-23 10:10:25 +02:00
parent 5eb348f815
commit 8258e6a399
2 changed files with 8 additions and 5 deletions

View File

@ -88,8 +88,9 @@ class GeoEvents(Gramplet, DbGUIElement):
(_('Date'), 3, 160),
('', NOSORT, 50),
(_('Place'), 4, 300),
(_('Latitude'), 5, 130),
(_('Longitude'), 6, 130)
(_('Id'), 5, 80),
(_('Latitude'), 6, 130),
(_('Longitude'), 7, 130),
]
self.model = ListModel(top, titles, event_func=self.edit_event)
return top
@ -104,10 +105,11 @@ class GeoEvents(Gramplet, DbGUIElement):
event_sort = '%012d' % event.get_date_object().get_sort_value()
place_name = place_displayer.display_event(self.dbstate.db, event)
place_handle = event.get_place_handle()
latitude = longitude = ""
place_id = latitude = longitude = ""
if place_handle:
plc = self.dbstate.db.get_place_from_handle(place_handle)
if plc:
place_id = plc.get_gramps_id()
latitude = plc.get_latitude()
longitude = plc.get_longitude()
latitude, longitude = conv_lat_lon(latitude, longitude, "D.D8")
@ -122,6 +124,7 @@ class GeoEvents(Gramplet, DbGUIElement):
event_date,
event_sort,
place_name,
place_id,
latitude,
longitude
))

View File

@ -1307,7 +1307,7 @@ register(GRAMPLET,
fname="coordinates.py",
height=200,
gramplet = 'GeoPersonEvents',
gramplet_title=_("Coordinates"),
gramplet_title=_("Events Coordinates"),
navtypes=["Person"],
)
@ -1321,6 +1321,6 @@ register(GRAMPLET,
fname="coordinates.py",
height=200,
gramplet = 'GeoFamilyEvents',
gramplet_title=_("Coordinates"),
gramplet_title=_("Events Coordinates"),
navtypes=["Family"],
)