Allow entering place latlong without space (#1190)
* Allow entering place latlong without space * Allow entering place latlong without space in editplaceref
This commit is contained in:
parent
12ee1f2b8a
commit
410cffe832
@ -187,9 +187,13 @@ class EditPlace(EditPrimary):
|
|||||||
|
|
||||||
def set_latlongitude(self, value):
|
def set_latlongitude(self, value):
|
||||||
try:
|
try:
|
||||||
coma = value.index(', ')
|
parts = value.index(', ')
|
||||||
longitude = value[coma+2:].strip().replace(',','.')
|
if len(parts) == 2:
|
||||||
latitude = value[:coma].strip().replace(',','.')
|
longitude = parts[0].strip().replace(',', '.')
|
||||||
|
latitude = parts[1].strip().replace(',', '.')
|
||||||
|
else:
|
||||||
|
longitude, latitude = value.split(',')
|
||||||
|
|
||||||
self.longitude.set_text(longitude)
|
self.longitude.set_text(longitude)
|
||||||
self.latitude.set_text(latitude)
|
self.latitude.set_text(latitude)
|
||||||
self.top.get_object("lat_entry").validate(force=True)
|
self.top.get_object("lat_entry").validate(force=True)
|
||||||
|
@ -181,9 +181,13 @@ class EditPlaceRef(EditReference):
|
|||||||
|
|
||||||
def set_latlongitude(self, value):
|
def set_latlongitude(self, value):
|
||||||
try:
|
try:
|
||||||
coma = value.index(', ')
|
parts = value.index(', ')
|
||||||
longitude = value[coma+2:].strip().replace(',','.')
|
if len(parts) == 2:
|
||||||
latitude = value[:coma].strip().replace(',','.')
|
longitude = parts[0].strip().replace(',', '.')
|
||||||
|
latitude = parts[1].strip().replace(',', '.')
|
||||||
|
else:
|
||||||
|
longitude, latitude = value.split(',')
|
||||||
|
|
||||||
self.longitude.set_text(longitude)
|
self.longitude.set_text(longitude)
|
||||||
self.latitude.set_text(latitude)
|
self.latitude.set_text(latitude)
|
||||||
self.top.get_object("lat_entry").validate(force=True)
|
self.top.get_object("lat_entry").validate(force=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user