2006-08-25 Don Allingham <don@gramps-project.org>
* src/DisplayModels/_MediaModel.py (MediaModel.sort_date): add sorting by date value instead of by text string svn: r7266
This commit is contained in:
parent
46248ee75f
commit
8755164dad
@ -1,3 +1,7 @@
|
||||
2006-08-25 Don Allingham <don@gramps-project.org>
|
||||
* src/DisplayModels/_MediaModel.py (MediaModel.sort_date): add
|
||||
sorting by date value instead of by text string
|
||||
|
||||
2006-08-25 Alex Roitman <shura@gramps-project.org>
|
||||
* src/ViewManager.py (preferences_activate): Use uistate to emit.
|
||||
* src/DisplayState.py (DisplayState.__signals__): Add new signal.
|
||||
|
@ -75,13 +75,14 @@ class MediaModel(BaseModel):
|
||||
self.column_handle,
|
||||
self.column_tooltip
|
||||
]
|
||||
|
||||
self.smap = [
|
||||
self.column_description,
|
||||
self.column_id,
|
||||
self.column_mime,
|
||||
self.column_path,
|
||||
self.sort_change,
|
||||
self.column_date,
|
||||
self.sort_date,
|
||||
self.column_handle,
|
||||
]
|
||||
BaseModel.__init__(self, db, scol, order, tooltip_column=7,
|
||||
@ -118,6 +119,15 @@ class MediaModel(BaseModel):
|
||||
return unicode(DateHandler.displayer.display(date))
|
||||
return u''
|
||||
|
||||
def sort_date(self,data):
|
||||
obj = RelLib.MediaObject()
|
||||
obj.unserialize(data)
|
||||
d = obj.get_date_object()
|
||||
if d:
|
||||
return "%09d" % d.get_sort_value()
|
||||
else:
|
||||
return ''
|
||||
|
||||
def column_handle(self,data):
|
||||
return unicode(data[0])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user