From 5face561416873fc2326f848794c17416c821fe1 Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Thu, 19 Apr 2007 12:18:38 +0000 Subject: [PATCH] * src/DisplayModels/_NoteModel.py: colorize using marker svn: r8404 --- ChangeLog | 3 +++ src/DisplayModels/_NoteModel.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 06d3d7071..549c74767 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-04-19 Martin Hawlisch + * src/DisplayModels/_NoteModel.py: colorize using marker + 2007-04-18 Benny Malengier * src/DisplayTabs/_EmbeddedList.py * src/DisplayTabs/_BackRefList.py diff --git a/src/DisplayModels/_NoteModel.py b/src/DisplayModels/_NoteModel.py index c3fc971d9..f586bca56 100644 --- a/src/DisplayModels/_NoteModel.py +++ b/src/DisplayModels/_NoteModel.py @@ -55,6 +55,7 @@ import RelLib class NoteModel(BaseModel): HANDLE_COL = 2 + _MARKER_COL = 6 def __init__(self,db,scol=0,order=gtk.SORT_ASCENDING,search=None, skip=set(), sort_map=None): @@ -66,6 +67,7 @@ class NoteModel(BaseModel): self.column_marker, self.column_preview, self.column_handle, + self.column_marker_color, ] self.smap = [ self.column_id, @@ -73,7 +75,9 @@ class NoteModel(BaseModel): self.column_marker, self.column_preview, self.column_handle, + self.column_marker_color, ] + self.marker_color_column = 5 BaseModel.__init__(self, db, scol, order, search=search, skip=skip, sort_map=sort_map) @@ -108,3 +112,15 @@ class NoteModel(BaseModel): else: return note + def column_marker_color(self, data): + try: + col = data[NoteModel._MARKER_COL][0] + if col == RelLib.MarkerType.COMPLETE: + return self.complete_color + elif col == RelLib.MarkerType.TODO_TYPE: + return self.todo_color + elif col == RelLib.MarkerType.CUSTOM: + return self.custom_color + except IndexError: + pass + return None