From 6af02b72af60ab1d6f00a4a3455eb9cb0f9690de Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Fri, 3 Jun 2005 10:02:50 +0000 Subject: [PATCH] * src/DisplayModels.py (RepositoryModel): Display repository type as text * src/RelLib.py (Repository): Serialize type as tuple not unicode svn: r4767 --- gramps2/ChangeLog | 4 ++++ gramps2/src/DisplayModels.py | 10 ++++++++-- gramps2/src/RelLib.py | 8 ++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 83f0e34e7..7a3d16897 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2005-06-03 Martin Hawlisch + * src/DisplayModels.py (RepositoryModel): Display repository type as text + * src/RelLib.py (Repository): Serialize type as tuple not unicode + 2005-06-02 Don Allingham * src/DisplayModels.py: Handle EventRefs properly * src/FamilyView.py: handle relationship types diff --git a/gramps2/src/DisplayModels.py b/gramps2/src/DisplayModels.py index 15558cae8..d00d8f912 100644 --- a/gramps2/src/DisplayModels.py +++ b/gramps2/src/DisplayModels.py @@ -43,6 +43,8 @@ import gtk #------------------------------------------------------------------------- import NameDisplay import DateHandler +import RelLib +import Utils _GENDER = [ _(u'female'), _(u'male'), _(u'unknown') ] @@ -541,7 +543,12 @@ class RepositoryModel(BaseModel): return unicode(data[1]) def column_type(self,data): - return unicode(data[2]) + rtype = data[2] + if rtype[0] == RelLib.Event.CUSTOM or rtype[0] not in Utils.repository_types: + name = rtype[1] + else: + name = Utils.repository_types[rtype[0]] + return unicode(name) def column_name(self,data): return unicode(data[3]) @@ -597,4 +604,3 @@ class RepositoryModel(BaseModel): def column_home_url(self,data): return unicode(data[7]) - diff --git a/gramps2/src/RelLib.py b/gramps2/src/RelLib.py index 9b8ca2c79..3e26c426c 100644 --- a/gramps2/src/RelLib.py +++ b/gramps2/src/RelLib.py @@ -4410,13 +4410,13 @@ class Repository(PrimaryObject,NoteBase): self.type = (Repository.LIBRARY,"") self.name = "" self.address = Location() - self.email = "" - self.search_url = "" - self.home_url = "" + self.email = "" + self.search_url = "" + self.home_url = "" self.note = Note() def serialize(self): - return (self.handle, self.gramps_id, unicode(self.type), + return (self.handle, self.gramps_id, self.type, unicode(self.name), self.address, unicode(self.email), unicode(self.search_url), unicode(self.home_url),