From d5b28435e01feadaaf525027fce288dc7e1afe83 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Wed, 28 Jul 2021 20:05:55 +0200 Subject: [PATCH 1/2] Place editor, lat and long text are swapped Fixes #012374 --- gramps/gui/editors/editplace.py | 8 ++++---- gramps/gui/editors/editplaceref.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 6ec6e5e45..8d4087f5b 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -187,13 +187,13 @@ class EditPlace(EditPrimary): def set_latlongitude(self, value): try: - # Bug 12349 + # Bug 12349, 12374 parts = value.split(', ') if len(parts) == 2: - longitude = parts[0].strip().replace(',', '.') - latitude = parts[1].strip().replace(',', '.') + latitude = parts[0].strip().replace(',', '.') + longitude = parts[1].strip().replace(',', '.') else: - longitude, latitude = value.split(',') + latitude, longitude = value.split(',') self.longitude.set_text(longitude) self.latitude.set_text(latitude) diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 4ec7f23fb..7833d89ba 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -180,13 +180,13 @@ class EditPlaceRef(EditReference): def set_latlongitude(self, value): try: - # Bug 12349 + # Bug 12349, 12374 parts = value.split(', ') if len(parts) == 2: - longitude = parts[0].strip().replace(',', '.') - latitude = parts[1].strip().replace(',', '.') + latitude = parts[0].strip().replace(',', '.') + longitude = parts[1].strip().replace(',', '.') else: - longitude, latitude = value.split(',') + latitude, longitude = value.split(',') self.longitude.set_text(longitude) self.latitude.set_text(latitude) From 8d355ee1841189d246d57e4c9c914d5eec7b1605 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Thu, 29 Jul 2021 10:02:28 +0200 Subject: [PATCH 2/2] Add comments for the lat-lon field of editplace --- gramps/gui/editors/editplace.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 8d4087f5b..f30497147 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -186,6 +186,32 @@ class EditPlace(EditPrimary): self.db.readonly) def set_latlongitude(self, value): + """ + This method is useful for directly copying the coordinates + of openstreetmap, googlemaps, and perhaps other if they + provide coordinates like it is define in conv_lat_lon + (see gramps/gen/utils/place.py) + + To copy the coordinates: + + - openstreetmap: + 1 - choose the place where you want to save the coordinates. + 2 - right click on this place + 3 - select "show address" + 4 - On the left side of the map, copy the coordinates of + "Result from internal" + 5 - In the latlon field of the edit place window of gramps, + type V + + - googlemap: + 1 - choose the place where you want to save the coordinates. + 2 - right click on this place + 3 - select the coordinates at the top of the popup window. + They are automaticaly copied. + 4 - In the latlon field of the edit place window of gramps, + type V + + """ try: # Bug 12349, 12374 parts = value.split(', ')