From e2eebf00d1639c54b8d2ca6a05e75af6d25d7484 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 20 Aug 2002 01:39:00 +0000 Subject: [PATCH] Fixes for bad date detection ZODB source display svn: r1123 --- gramps/src/Date.py | 2 +- gramps/src/RelLib.py | 1 - gramps/src/Sources.py | 15 +++++++++------ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gramps/src/Date.py b/gramps/src/Date.py index 1023e461f..397087aae 100644 --- a/gramps/src/Date.py +++ b/gramps/src/Date.py @@ -264,7 +264,7 @@ class Date: try: return self.get_fmt(SingleDate.getDate) except: - return "DATE CONVERSION ERROR" + return "DATE ERROR (d%d/m%d/y%d)" % (self.start.day,self.start.month,self.start.year) def getQuoteDate(self): if self.calendar == GREGORIAN: diff --git a/gramps/src/RelLib.py b/gramps/src/RelLib.py index 29c953498..d10b0335e 100644 --- a/gramps/src/RelLib.py +++ b/gramps/src/RelLib.py @@ -2029,7 +2029,6 @@ class GrampsDB(Persistent): """returns a map of gramps's IDs to Source instances""" return extmap(self.sourceMap) - def getObjectMap(self): """returns a map of gramps's IDs to Object instances""" return self.objectMap diff --git a/gramps/src/Sources.py b/gramps/src/Sources.py index bb303463a..e76010bd6 100644 --- a/gramps/src/Sources.py +++ b/gramps/src/Sources.py @@ -247,21 +247,23 @@ class SourceEditor: self.author_field.set_text("") self.pub_field.set_text("") - values = self.db.getSourceMap().values() - values.sort(by_title) + values = [] + for v in self.db.getSourceKeys(): + values.append(self.db.getSourceDisplay(v)) + values.sort() sel_child = None list = [] for src in values: - l = gtk.GtkLabel("%s [%s]" % (src.getTitle(),src.getId())) + l = gtk.GtkLabel("%s [%s]" % (src[0],src[1])) l.show() l.set_alignment(0,0.5) c = gtk.GtkListItem() c.add(l) - c.set_data("s",src) + c.set_data("s",src[1]) c.show() list.append(c) - if self.active_source == src: + if self.active_source and self.active_source.getId() == src[1]: sel_child = c self.title_menu.list.append_items(list) @@ -293,7 +295,8 @@ class SourceEditor: Utils.destroy_passed_object(obj) def on_source_changed(self,obj): - self.active_source = obj.list.get_selection()[0].get_data("s") + id = obj.list.get_selection()[0].get_data("s") + self.active_source = self.db.getSource(id) if self.active_source == None: self.author_field.set_text(self.active_source.getAuthor())