* src/Editors/_EditPlace.py (_setup_fields): validate coordinates
* src/glade/gramps.glade: delete long, lat entries from place_editor 2007-03-13 Zsolt Foldvari <zfoldvar@users.sourceforge.net> svn: r8293
This commit is contained in:
parent
63e344754f
commit
efcaf0d6e1
@ -1,3 +1,7 @@
|
||||
2007-03-13 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
|
||||
* src/Editors/_EditPlace.py (_setup_fields): validate coordinates
|
||||
* src/glade/gramps.glade: delete long, lat entries from place_editor
|
||||
|
||||
2007-03-13 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
|
||||
* src/RelLib/_Note.py: import const from MarkupText module
|
||||
* src/MarkupText.py: use actions instead of widgets on the interface;
|
||||
|
@ -49,6 +49,7 @@ from _EditPrimary import EditPrimary
|
||||
|
||||
from DisplayTabs import *
|
||||
from GrampsWidgets import *
|
||||
from PlaceUtils import conv_lat_lon
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -134,16 +135,43 @@ class EditPlace(EditPrimary):
|
||||
self.top.get_widget("country"),
|
||||
mloc.set_country, mloc.get_country, self.db.readonly)
|
||||
|
||||
table = self.top.get_widget("table66")
|
||||
|
||||
entry = ValidatableMaskedEntry()
|
||||
entry.connect("validate", self._validate_coordinate, "lon")
|
||||
tip = gtk.Tooltips()
|
||||
tip.set_tip(entry, "East/West position, eg -2.88589, 2°53'" +
|
||||
'9.23" W or -2:53:9.23')
|
||||
entry.show()
|
||||
table.attach(entry, 3, 4, 1, 2)
|
||||
|
||||
self.longitude = MonitoredEntry(
|
||||
self.top.get_widget("longitude"),
|
||||
entry,
|
||||
self.obj.set_longitude, self.obj.get_longitude,
|
||||
self.db.readonly)
|
||||
|
||||
entry = ValidatableMaskedEntry()
|
||||
entry.connect("validate", self._validate_coordinate, "lat")
|
||||
tip = gtk.Tooltips()
|
||||
tip.set_tip(entry, "North/South position, eg 50.84988, 50°50'" +
|
||||
'59.60"N or 50:50:59.60')
|
||||
entry.show()
|
||||
table.attach(entry, 1, 2, 1, 2)
|
||||
|
||||
self.latitude = MonitoredEntry(
|
||||
self.top.get_widget("latitude"),
|
||||
entry,
|
||||
self.obj.set_latitude, self.obj.get_latitude,
|
||||
self.db.readonly)
|
||||
|
||||
def _validate_coordinate(self, widget, text, typedeg):
|
||||
if typedeg == 'lat':
|
||||
result = conv_lat_lon(text, "0", "ISO-D")
|
||||
elif typedeg == 'lon':
|
||||
result = conv_lat_lon("0", text, "ISO-D")
|
||||
|
||||
if not result:
|
||||
return ValidationError("Wrong coordinate")
|
||||
|
||||
def build_menu_names(self,place):
|
||||
return (_('Edit Place'), self.get_menu_title())
|
||||
|
||||
|
@ -1564,7 +1564,6 @@
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">latitude</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
@ -1580,28 +1579,6 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkEntry" id="latitude">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">North/South position, eg 50.84988, 50°50'59.60"N or 50:50:59.60</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label250">
|
||||
<property name="visible">True</property>
|
||||
@ -1615,7 +1592,6 @@
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="mnemonic_widget">longitude</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
@ -1631,28 +1607,6 @@
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkEntry" id="longitude">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">East/West position, eg -2.88589, 2°53'9.23" W or -2:53:9.23</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="editable">True</property>
|
||||
<property name="visibility">True</property>
|
||||
<property name="max_length">0</property>
|
||||
<property name="text" translatable="yes"></property>
|
||||
<property name="has_frame">True</property>
|
||||
<property name="invisible_char">*</property>
|
||||
<property name="activates_default">False</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">3</property>
|
||||
<property name="right_attach">4</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkEntry" id="place_title">
|
||||
<property name="visible">True</property>
|
||||
|
Loading…
Reference in New Issue
Block a user