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):
|
||||
try:
|
||||
coma = value.index(', ')
|
||||
longitude = value[coma+2:].strip().replace(',','.')
|
||||
latitude = value[:coma].strip().replace(',','.')
|
||||
parts = value.index(', ')
|
||||
if len(parts) == 2:
|
||||
longitude = parts[0].strip().replace(',', '.')
|
||||
latitude = parts[1].strip().replace(',', '.')
|
||||
else:
|
||||
longitude, latitude = value.split(',')
|
||||
|
||||
self.longitude.set_text(longitude)
|
||||
self.latitude.set_text(latitude)
|
||||
self.top.get_object("lat_entry").validate(force=True)
|
||||
|
@ -181,9 +181,13 @@ class EditPlaceRef(EditReference):
|
||||
|
||||
def set_latlongitude(self, value):
|
||||
try:
|
||||
coma = value.index(', ')
|
||||
longitude = value[coma+2:].strip().replace(',','.')
|
||||
latitude = value[:coma].strip().replace(',','.')
|
||||
parts = value.index(', ')
|
||||
if len(parts) == 2:
|
||||
longitude = parts[0].strip().replace(',', '.')
|
||||
latitude = parts[1].strip().replace(',', '.')
|
||||
else:
|
||||
longitude, latitude = value.split(',')
|
||||
|
||||
self.longitude.set_text(longitude)
|
||||
self.latitude.set_text(latitude)
|
||||
self.top.get_object("lat_entry").validate(force=True)
|
||||
|
Loading…
Reference in New Issue
Block a user