8168: Sort custom place types in editors
This commit is contained in:
parent
88743af243
commit
c93e16c4af
@ -147,11 +147,13 @@ class EditPlace(EditPrimary):
|
|||||||
self.privacy = PrivacyButton(self.top.get_object("private"), self.obj,
|
self.privacy = PrivacyButton(self.top.get_object("private"), self.obj,
|
||||||
self.db.readonly)
|
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.place_type = MonitoredDataType(self.top.get_object("place_type"),
|
||||||
self.obj.set_type,
|
self.obj.set_type,
|
||||||
self.obj.get_type,
|
self.obj.get_type,
|
||||||
self.db.readonly,
|
self.db.readonly,
|
||||||
self.db.get_place_types())
|
custom_place_types)
|
||||||
|
|
||||||
self.code = MonitoredEntry(
|
self.code = MonitoredEntry(
|
||||||
self.top.get_object("code_entry"),
|
self.top.get_object("code_entry"),
|
||||||
|
@ -137,11 +137,13 @@ class EditPlaceRef(EditReference):
|
|||||||
self.privacy = PrivacyButton(self.top.get_object("private"), self.source,
|
self.privacy = PrivacyButton(self.top.get_object("private"), self.source,
|
||||||
self.db.readonly)
|
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.place_type = MonitoredDataType(self.top.get_object("place_type"),
|
||||||
self.source.set_type,
|
self.source.set_type,
|
||||||
self.source.get_type,
|
self.source.get_type,
|
||||||
self.db.readonly,
|
self.db.readonly,
|
||||||
self.db.get_place_types())
|
custom_place_types)
|
||||||
|
|
||||||
self.code = MonitoredEntry(
|
self.code = MonitoredEntry(
|
||||||
self.top.get_object("code_entry"),
|
self.top.get_object("code_entry"),
|
||||||
|
@ -555,7 +555,8 @@ class EditRule(ManagedWindow):
|
|||||||
elif v == _('Surname origin type:'):
|
elif v == _('Surname origin type:'):
|
||||||
additional = self.db.get_origin_types()
|
additional = self.db.get_origin_types()
|
||||||
elif v == _('Place type:'):
|
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)
|
t = MySelect(_name2typeclass[v], additional)
|
||||||
elif v == _('Inclusive:'):
|
elif v == _('Inclusive:'):
|
||||||
t = MyBoolean(_('Include original person'))
|
t = MyBoolean(_('Include original person'))
|
||||||
|
Loading…
Reference in New Issue
Block a user