From e21731926fe054bc9f79570a0ae2ca50c7c9a817 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 24 Dec 2006 05:51:31 +0000 Subject: [PATCH] 2006-12-23 Don Allingham * src/DisplayTabs/_EventRefModel.py: properly sort events by date (bug #508) * src/DisplayTabs/_EventEmbedList.py: properly sort events by date (bug #508) loss of data (bug #777) loss of data (bug #777) loss of data (bug #777) loss of data (bug #777) svn: r7843 --- ChangeLog | 12 ++++++++---- src/DisplayTabs/_EventEmbedList.py | 2 +- src/DisplayTabs/_EventRefModel.py | 11 ++++++++++- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41fc5b77c..e2719605c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-12-23 Don Allingham + * src/DisplayTabs/_EventRefModel.py: properly sort events by date (bug #508) + * src/DisplayTabs/_EventEmbedList.py: properly sort events by date (bug #508) + 2006-12-22 Alex Roitman * src/GrampsDb/_WriteGedcom.py (write_source_ref): Write PAGE as a single line. @@ -37,13 +41,13 @@ 2006-12-20 Don Allingham * src/DataViews/_PersonView.py: use a container for bookmarks to prevent - lost of data (bug #777) + loss of data (bug #777) * src/GrampsDb/_GrampsDbBase.py: use a container for bookmarks to prevent - lost of data (bug #777) + loss of data (bug #777) * src/GrampsDb/_GrampsBSDDB.py: use a container for bookmarks to prevent - lost of data (bug #777) + loss of data (bug #777) * src/Bookmarks.py: use a container for bookmarks to prevent - lost of data (bug #777) + loss of data (bug #777) * src/DisplayModels/_BaseModel.py (BaseModel.__init__): choose correct sort column diff --git a/src/DisplayTabs/_EventEmbedList.py b/src/DisplayTabs/_EventEmbedList.py index 16ab83b2e..5f0aeeb89 100644 --- a/src/DisplayTabs/_EventEmbedList.py +++ b/src/DisplayTabs/_EventEmbedList.py @@ -60,7 +60,7 @@ class EventEmbedList(EmbeddedList): (_('Type'), 0, 100), (_('Description'), 1, 175), (_('ID'), 2, 60), - (_('Date'), 3, 150), + (_('Date'), 6, 150), (_('Place'), 4, 140), (_('Role'), 5, 80), ] diff --git a/src/DisplayTabs/_EventRefModel.py b/src/DisplayTabs/_EventRefModel.py index ad6f72b9e..40d6e73a1 100644 --- a/src/DisplayTabs/_EventRefModel.py +++ b/src/DisplayTabs/_EventRefModel.py @@ -42,7 +42,7 @@ import DateHandler class EventRefModel(gtk.ListStore): def __init__(self, event_list, db): - gtk.ListStore.__init__(self, str, str, str, str, str, str, object) + gtk.ListStore.__init__(self, str, str, str, str, str, str, str, object) self.db = db for event_ref in event_list: event = db.get_event_from_handle(event_ref.ref) @@ -53,6 +53,7 @@ class EventRefModel(gtk.ListStore): self.column_date(event_ref), self.column_place(event_ref), self.column_role(event_ref), + self.column_sort_date(event_ref), event_ref ]) @@ -63,6 +64,14 @@ class EventRefModel(gtk.ListStore): event = self.db.get_event_from_handle(event_ref.ref) return DateHandler.get_date(event) + def column_sort_date(self, event_ref): + event = self.db.get_event_from_handle(event_ref.ref) + date = event.get_date_object() + if date: + return "%09d" % date.get_sort_value() + else: + return "" + def column_place(self, event_ref): if event_ref and event_ref.ref: event = self.db.get_event_from_handle(event_ref.ref)