9373: Added EditPlaceRef and suppressed a useless tooltip

This commit is contained in:
SNoiraud 2016-11-03 19:28:51 +01:00 committed by Nick Hall
parent 593d57dbc0
commit b6bb8ccdcc
3 changed files with 83 additions and 12 deletions

View File

@ -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'") +

View File

@ -103,7 +103,6 @@
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Either use the two fields below to enter coordinates(latitude and longitude),</property>
<property name="tooltip_text" translatable="yes">Field used to paste info from a web page like google, openstreetmap, ... </property>
<property name="hexpand">True</property>
</object>
<packing>

View File

@ -220,6 +220,20 @@
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="comment1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="label" translatable="yes">Either use the two fields below to enter coordinates(latitude and longitude),</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label504">
<property name="visible">True</property>
@ -233,7 +247,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
@ -246,7 +260,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
@ -291,7 +305,7 @@
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="top_attach">7</property>
<property name="width">5</property>
</packing>
</child>
@ -320,7 +334,47 @@
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
<object class="GtkBox" id="copypaste">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
<object class="GtkLabel" id="comment2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="label" translatable="yes">or use copy/paste from your favorite map provider (format : latitude,longitude) in the following field:</property>
<property name="use_underline">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="ValidatableMaskedEntry" id="latlon_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Field used to paste info from a web page like google, openstreetmap, ... </property>
<property name="hexpand">True</property>
<property name="invisible_char">●</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">5</property>
<property name="width">4</property>
</packing>
</child>
<child>
@ -369,7 +423,7 @@
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
@ -398,7 +452,7 @@ You can set these values via the Geography View by searching the place, or via a
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
@ -413,7 +467,7 @@ You can set these values via the Geography View by searching the place, or via a
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">3</property>
<property name="top_attach">4</property>
</packing>
</child>
<child>
@ -467,7 +521,7 @@ You can set these values via the Geography View by searching the place, or via a
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">4</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
@ -479,7 +533,7 @@ You can set these values via the Geography View by searching the place, or via a
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">4</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
@ -491,7 +545,7 @@ You can set these values via the Geography View by searching the place, or via a
</object>
<packing>
<property name="left_attach">3</property>
<property name="top_attach">4</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>
@ -502,7 +556,7 @@ You can set these values via the Geography View by searching the place, or via a
</object>
<packing>
<property name="left_attach">4</property>
<property name="top_attach">4</property>
<property name="top_attach">6</property>
</packing>
</child>
<child>