From 8258e6a399481c64db0a6ea521216c6e92aea192 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Fri, 23 Sep 2016 10:10:25 +0200 Subject: [PATCH] 9704: Events coordinates : add place ID. --- gramps/plugins/gramplet/coordinates.py | 9 ++++++--- gramps/plugins/gramplet/gramplet.gpr.py | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gramps/plugins/gramplet/coordinates.py b/gramps/plugins/gramplet/coordinates.py index 854b27ad1..9f81af9f3 100644 --- a/gramps/plugins/gramplet/coordinates.py +++ b/gramps/plugins/gramplet/coordinates.py @@ -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 )) diff --git a/gramps/plugins/gramplet/gramplet.gpr.py b/gramps/plugins/gramplet/gramplet.gpr.py index feab83850..2a274a3ad 100644 --- a/gramps/plugins/gramplet/gramplet.gpr.py +++ b/gramps/plugins/gramplet/gramplet.gpr.py @@ -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"], )