* src/NameEdit.py: convert names to unicode

* src/PeopleModel.py: convert names to uncode


svn: r5006
This commit is contained in:
Don Allingham 2005-08-03 02:31:18 +00:00
parent 544e27232f
commit 28edd32a1f
3 changed files with 14 additions and 9 deletions

View File

@ -1,4 +1,6 @@
2005-08-02 Don Allingham <don@gramps-project.org>
* 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

View File

@ -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())

View File

@ -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)