diff options
author | Andrés Ambrois <andresambrois@gmail.com> | 2010-05-23 12:02:32 (GMT) |
---|---|---|
committer | Michael Stone <michael@laptop.org> | 2010-06-24 21:03:37 (GMT) |
commit | e81e094803b2f896dc19280e2e3ab7df318e9aa5 (patch) | |
tree | 8bce02d92e266ceab4af78fd025ff023451e7ac7 | |
parent | c950843ce0eabc86cf1820d83be2fba1fbaab2f6 (diff) |
Add a filesize column to the journal list model
This will make it easy to display the current sorting column by
associating a cell renderer with it.
Signed-off-by: Andrés Ambrois <andresambrois@gmail.com>
Signed-off-by: Michael Stone <michael@laptop.org>
-rw-r--r-- | main/src/jarabe/journal/listmodel.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/main/src/jarabe/journal/listmodel.py b/main/src/jarabe/journal/listmodel.py index ecdbc7d..a531044 100644 --- a/main/src/jarabe/journal/listmodel.py +++ b/main/src/jarabe/journal/listmodel.py @@ -46,18 +46,20 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource): COLUMN_ICON = 2 COLUMN_ICON_COLOR = 3 COLUMN_TITLE = 4 - COLUMN_DATE = 5 - COLUMN_PROGRESS = 6 - COLUMN_BUDDY_1 = 7 - COLUMN_BUDDY_2 = 8 - COLUMN_BUDDY_3 = 9 + COLUMN_TIMESTAMP = 5 + COLUMN_FILESIZE = 6 + COLUMN_PROGRESS = 7 + COLUMN_BUDDY_1 = 8 + COLUMN_BUDDY_2 = 9 + COLUMN_BUDDY_3 = 10 _COLUMN_TYPES = {COLUMN_UID: str, COLUMN_FAVORITE: bool, COLUMN_ICON: str, COLUMN_ICON_COLOR: object, COLUMN_TITLE: str, - COLUMN_DATE: str, + COLUMN_TIMESTAMP: str, + COLUMN_FILESIZE: str, COLUMN_PROGRESS: int, COLUMN_BUDDY_1: object, COLUMN_BUDDY_3: object, @@ -139,6 +141,9 @@ class ListModel(gtk.GenericTreeModel, gtk.TreeDragSource): timestamp = int(metadata.get('timestamp', 0)) self._cached_row.append(util.timestamp_to_elapsed_string(timestamp)) + size = int(metadata.get('filesize', 0)) + self._cached_row.append(util.format_size(size)) + self._cached_row.append(int(metadata.get('progress', 100))) if metadata.get('buddies', ''): |