validate lat/lon on init

svn: r11752
This commit is contained in:
Benny Malengier 2009-01-28 11:48:20 +00:00
parent 4574406d32
commit dfb3ee201b

View File

@ -191,12 +191,16 @@ class EditPlace(EditPrimary):
self.obj.set_longitude, self.obj.get_longitude, self.obj.set_longitude, self.obj.get_longitude,
self.db.readonly) self.db.readonly)
self.longitude.connect("validate", self._validate_coordinate, "lon") self.longitude.connect("validate", self._validate_coordinate, "lon")
#force validation now with initial entry
self.top.get_widget("lon_entry").validate(force=True)
self.latitude = MonitoredEntry( self.latitude = MonitoredEntry(
self.top.get_widget("lat_entry"), self.top.get_widget("lat_entry"),
self.obj.set_latitude, self.obj.get_latitude, self.obj.set_latitude, self.obj.get_latitude,
self.db.readonly) self.db.readonly)
self.latitude.connect("validate", self._validate_coordinate, "lat") self.latitude.connect("validate", self._validate_coordinate, "lat")
#force validation now with initial entry
self.top.get_widget("lat_entry").validate(force=True)
def _validate_coordinate(self, widget, text, typedeg): def _validate_coordinate(self, widget, text, typedeg):
if (typedeg == 'lat') and not conv_lat_lon(text, "0", "ISO-D"): if (typedeg == 'lat') and not conv_lat_lon(text, "0", "ISO-D"):