From b6bb8ccdcc25e42784718b820432c3e2f3fae004 Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Thu, 3 Nov 2016 19:28:51 +0100 Subject: [PATCH] 9373: Added EditPlaceRef and suppressed a useless tooltip --- gramps/gui/editors/editplaceref.py | 18 +++++++ gramps/gui/glade/editplace.glade | 1 - gramps/gui/glade/editplaceref.glade | 76 ++++++++++++++++++++++++----- 3 files changed, 83 insertions(+), 12 deletions(-) diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 1adda4ed6..eede8cfd3 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -167,6 +167,24 @@ class EditPlaceRef(EditReference): #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 c6363bf1f..2b14957ed 100644 --- a/gramps/gui/glade/editplace.glade +++ b/gramps/gui/glade/editplace.glade @@ -103,7 +103,6 @@ True start Either use the two fields below to enter coordinates(latitude and longitude), - Field used to paste info from a web page like google, openstreetmap, ... True diff --git a/gramps/gui/glade/editplaceref.glade b/gramps/gui/glade/editplaceref.glade index 591df732f..4b6b4bd6c 100644 --- a/gramps/gui/glade/editplaceref.glade +++ b/gramps/gui/glade/editplaceref.glade @@ -220,6 +220,20 @@ 2 + + + True + True + start + Either use the two fields below to enter coordinates(latitude and longitude), + True + + + 0 + 3 + 5 + + True @@ -233,7 +247,7 @@ 0 - 4 + 6 @@ -246,7 +260,7 @@ 0 - 3 + 4 @@ -291,7 +305,7 @@ 0 - 5 + 7 5 @@ -320,7 +334,47 @@ 2 - 3 + 4 + + + + + True + False + 6 + + + True + False + start + or use copy/paste from your favorite map provider (format : latitude,longitude) in the following field: + True + + + False + True + 0 + + + + + True + True + Field used to paste info from a web page like google, openstreetmap, ... + True + + + + False + True + 1 + + + + + 0 + 5 + 4 @@ -369,7 +423,7 @@ 4 - 3 + 4 @@ -398,7 +452,7 @@ You can set these values via the Geography View by searching the place, or via a 1 - 3 + 4 @@ -413,7 +467,7 @@ You can set these values via the Geography View by searching the place, or via a 3 - 3 + 4 @@ -467,7 +521,7 @@ You can set these values via the Geography View by searching the place, or via a 1 - 4 + 6 @@ -479,7 +533,7 @@ You can set these values via the Geography View by searching the place, or via a 2 - 4 + 6 @@ -491,7 +545,7 @@ You can set these values via the Geography View by searching the place, or via a 3 - 4 + 6 @@ -502,7 +556,7 @@ You can set these values via the Geography View by searching the place, or via a 4 - 4 + 6