2006-12-23 Don Allingham <don@gramps-project.org>

* 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
This commit is contained in:
Don Allingham 2006-12-24 05:51:31 +00:00
parent f2ea382a46
commit e21731926f
3 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,7 @@
2006-12-23 Don Allingham <don@gramps-project.org>
* 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 <shura@phy.ucsf.edu>
* src/GrampsDb/_WriteGedcom.py (write_source_ref): Write PAGE as a
single line.
@ -37,13 +41,13 @@
2006-12-20 Don Allingham <don@gramps-project.org>
* 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

View File

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

View File

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