From 2fc9459aad875fafb144fc1cad6392d634bcc487 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Fri, 9 Oct 2015 19:00:57 +0100 Subject: [PATCH] 8168: Sort custom place types in editors --- gramps/gui/editors/editplace.py | 4 +++- gramps/gui/editors/editplaceref.py | 4 +++- gramps/gui/editors/filtereditor.py | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 8bd0043c3..6decc4c6c 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -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"), diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 59057c901..58139ef08 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -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"), diff --git a/gramps/gui/editors/filtereditor.py b/gramps/gui/editors/filtereditor.py index 8f9c58cce..9296b92f7 100644 --- a/gramps/gui/editors/filtereditor.py +++ b/gramps/gui/editors/filtereditor.py @@ -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'))