* src/DisplayModels/_NoteModel.py: colorize using marker

svn: r8404
This commit is contained in:
Martin Hawlisch 2007-04-19 12:18:38 +00:00
parent 44321f2c89
commit 5face56141
2 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,6 @@
2007-04-19 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/DisplayModels/_NoteModel.py: colorize using marker
2007-04-18 Benny Malengier <bm@cage.ugent.be> 2007-04-18 Benny Malengier <bm@cage.ugent.be>
* src/DisplayTabs/_EmbeddedList.py * src/DisplayTabs/_EmbeddedList.py
* src/DisplayTabs/_BackRefList.py * src/DisplayTabs/_BackRefList.py

View File

@ -55,6 +55,7 @@ import RelLib
class NoteModel(BaseModel): class NoteModel(BaseModel):
HANDLE_COL = 2 HANDLE_COL = 2
_MARKER_COL = 6
def __init__(self,db,scol=0,order=gtk.SORT_ASCENDING,search=None, def __init__(self,db,scol=0,order=gtk.SORT_ASCENDING,search=None,
skip=set(), sort_map=None): skip=set(), sort_map=None):
@ -66,6 +67,7 @@ class NoteModel(BaseModel):
self.column_marker, self.column_marker,
self.column_preview, self.column_preview,
self.column_handle, self.column_handle,
self.column_marker_color,
] ]
self.smap = [ self.smap = [
self.column_id, self.column_id,
@ -73,7 +75,9 @@ class NoteModel(BaseModel):
self.column_marker, self.column_marker,
self.column_preview, self.column_preview,
self.column_handle, self.column_handle,
self.column_marker_color,
] ]
self.marker_color_column = 5
BaseModel.__init__(self, db, scol, order, BaseModel.__init__(self, db, scol, order,
search=search, skip=skip, sort_map=sort_map) search=search, skip=skip, sort_map=sort_map)
@ -108,3 +112,15 @@ class NoteModel(BaseModel):
else: else:
return note 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