From eac59d932d35736716edb8412e6bd6ac052108c9 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Sat, 22 Oct 2016 12:12:49 +0200 Subject: [PATCH] 9373: Ability to be able to enter comma separated latitude/longitude pairs --- gramps/gui/editors/editplace.py | 18 ++++++++++++++++++ gramps/gui/glade/editplace.glade | 28 ++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 985f79fef..9b0d14ef1 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -174,6 +174,24 @@ class EditPlace(EditPrimary): #force validation now with initial entry self.top.get_object("lat_entry").validate(force=True) + self.latlon = MonitoredEntry( + self.top.get_object("latlon_entry"), + self.set_latlongitude, self.get_latlongitude, + self.db.readonly) + + def set_latlongitude(self, value): + try: + coma = value.index(',') + self.longitude.set_text(value[coma+1:]) + self.latitude.set_text(value[:coma]) + self.top.get_object("lat_entry").validate(force=True) + self.top.get_object("lon_entry").validate(force=True) + except: + pass + + def get_latlongitude(self): + return "" + def _validate_coordinate(self, widget, text, typedeg): if (typedeg == 'lat') and not conv_lat_lon(text, "0", "ISO-D"): return ValidationError(_("Invalid latitude (syntax: 18\u00b09'") + diff --git a/gramps/gui/glade/editplace.glade b/gramps/gui/glade/editplace.glade index a3dacc324..76e5e3e27 100644 --- a/gramps/gui/glade/editplace.glade +++ b/gramps/gui/glade/editplace.glade @@ -127,6 +127,21 @@ 3 + + + True + False + start + LatLon_gitude: + True + center + latlon_entry + + + 0 + 5 + + True @@ -185,6 +200,19 @@ You can set these values via the Geography View by searching the place, or via a 3 + + + True + True + Field used to paste info from a web page like google, openstreetmap, ... + True + + + + 1 + 5 + + True