8168: Sort custom place types in editors

This commit is contained in:
Nick Hall 2015-10-09 19:00:57 +01:00
parent 88743af243
commit c93e16c4af
3 changed files with 8 additions and 3 deletions

View File

@ -147,11 +147,13 @@ class EditPlace(EditPrimary):
self.privacy = PrivacyButton(self.top.get_object("private"), self.obj,
self.db.readonly)
custom_place_types = sorted(self.db.get_place_types(),
key=lambda s: s.lower())
self.place_type = MonitoredDataType(self.top.get_object("place_type"),
self.obj.set_type,
self.obj.get_type,
self.db.readonly,
self.db.get_place_types())
custom_place_types)
self.code = MonitoredEntry(
self.top.get_object("code_entry"),

View File

@ -137,11 +137,13 @@ class EditPlaceRef(EditReference):
self.privacy = PrivacyButton(self.top.get_object("private"), self.source,
self.db.readonly)
custom_place_types = sorted(self.db.get_place_types(),
key=lambda s: s.lower())
self.place_type = MonitoredDataType(self.top.get_object("place_type"),
self.source.set_type,
self.source.get_type,
self.db.readonly,
self.db.get_place_types())
custom_place_types)
self.code = MonitoredEntry(
self.top.get_object("code_entry"),

View File

@ -555,7 +555,8 @@ class EditRule(ManagedWindow):
elif v == _('Surname origin type:'):
additional = self.db.get_origin_types()
elif v == _('Place type:'):
additional = self.db.get_place_types()
additional = sorted(self.db.get_place_types(),
key=lambda s: s.lower())
t = MySelect(_name2typeclass[v], additional)
elif v == _('Inclusive:'):
t = MyBoolean(_('Include original person'))