From 28edd32a1f1051d2e9fcabc63dc13b7e4a5f2d69 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 3 Aug 2005 02:31:18 +0000 Subject: [PATCH] * src/NameEdit.py: convert names to unicode * src/PeopleModel.py: convert names to uncode svn: r5006 --- gramps2/ChangeLog | 2 ++ gramps2/src/NameEdit.py | 9 +++++---- gramps2/src/PeopleModel.py | 12 +++++++----- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 0352642da..9e583c493 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2005-08-02 Don Allingham + * src/NameEdit.py: convert names to unicode + * src/PeopleModel.py: convert names to uncode * src/DateHandler.py: handle <> for about * src/plugins/NavWebPage.py: cleanup * src/EditPerson.py: call new PersonEventEditor diff --git a/gramps2/src/NameEdit.py b/gramps2/src/NameEdit.py index a7195eed4..0db19c700 100644 --- a/gramps2/src/NameEdit.py +++ b/gramps2/src/NameEdit.py @@ -181,7 +181,8 @@ class NameEditor: if self.name and self.name.get_group_as() != self.name.get_surname(): val = self.name.get_group_as() else: - val = self.db.get_name_group_mapping(self.surname_field.get_text()) + name = unicode(self.surname_field.get_text()) + val = self.db.get_name_group_mapping(name) self.group_as.set_text(val) def on_group_over_toggled(self,obj): @@ -189,7 +190,7 @@ class NameEditor: self.group_as.set_sensitive(True) self.group_as.set_editable(True) else: - field_value = self.surname_field.get_text() + field_value = unicode(self.surname_field.get_text()) mapping = self.db.get_name_group_mapping(field_value) self.group_as.set_text(mapping) self.group_as.set_sensitive(False) @@ -268,8 +269,8 @@ class NameEditor: self.name.set_source_reference_list(self.srcreflist) - grp_as = self.group_as.get_text() - srn = self.surname_field.get_text() + grp_as = unicode(self.group_as.get_text()) + srn = unicode(self.surname_field.get_text()) if self.name.get_display_as() != self.display_as.get_active(): self.name.set_display_as(self.display_as.get_active()) diff --git a/gramps2/src/PeopleModel.py b/gramps2/src/PeopleModel.py index d4f90c4ea..cd3f45289 100644 --- a/gramps2/src/PeopleModel.py +++ b/gramps2/src/PeopleModel.py @@ -121,24 +121,26 @@ class PeopleModel(gtk.GenericTreeModel): self.sortnames = {} cursor = self.db.get_person_cursor() node = cursor.next() + + ngn = NameDisplay.displayer.name_grouping_name + nsn = NameDisplay.displayer.sorted_name while node: if node[0] in flist: primary_name = node[1][_NAME_COL] - surname = NameDisplay.displayer.name_grouping_name(self.db,primary_name) - self.sortnames[node[0]] = NameDisplay.displayer.sorted_name(primary_name) - + surname = unicode(ngn(self.db,primary_name)) + self.sortnames[node[0]] = unicode(nsn(primary_name)) if self.temp_sname_sub.has_key(surname): self.temp_sname_sub[surname].append(node[0]) else: self.temp_sname_sub[surname] = [node[0]] node = cursor.next() cursor.close() - + self.temp_top_path2iter = self.temp_sname_sub.keys() self.temp_top_path2iter.sort(locale.strcoll) for name in self.temp_top_path2iter: self.build_sub_entry(name) - + def build_sub_entry(self,name): slist = map(lambda x: (self.sortnames[x],x),self.temp_sname_sub[name]) slist.sort(self.byname)